Open
Description
It would be nice to have a way to include another file. For example:
lexer grammar Keywords;
NEW: 'new';
NULL: 'null';
lexer grammar IdentifierLexer;
import Keywords;
Identifier: [a-zA-Z]+;
Then 'new'
and 'null'
would be recognized as not keywords but Identifier
.
This is because the imported grammars are placed after all current rules, but sometimes we need it before or even in the middle of current rule set. It would be useful to have a way to just include another grammar file in place, just like #include "file"
in C.
Metadata
Metadata
Assignees
Labels
No labels