On 26.01.2017 12:23, Jesper Steen Møller wrote:
Hi Jochen and Daniel Not entirely correct: There are some ways to extend a grammar with new opperators, as demonstrated in http://stackoverflow.com/questions/29894457/dynamic-operator-tokens-in-antlr4 However, this still needs to happen before lexing and parsing, so you can't "fix" it with an AST transformer.
before lexing is fine, if the lexer had a dynamic way of adding and replacing grammar rules. Because the usage you want to have is the base lexer and some kind of plugin which is not a new full antlr4 generated parser/lexer. On the other hand, maybe that would be better, since the grammar rules will easily get in conflict with each other
bye Jochen