Skip to content
Discussion options

You must be logged in to vote

Hey @dhrubomoy,

unfortunately, that's an inherent limitation of how LL language parsers work. During the tokenization phase, you have rather limited information about what the tokens in the input actually represent. Due to the other from keyword in your language, even features such as lexer modes or positive lookbehind in the regex will not work as expected. Other systems such as PEG can take the context of the current rule into account during the parsing/tokenization of the input (PEG has no separate lexing/parsing phase), but PEG parsers are rather slow as a consequence.

My recommendation would be to use a system similar to TypeScript, which uses STRING terminals for imports. See also o…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dhrubomoy
Comment options

Answer selected by dhrubomoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants