Safiye Celik wrote: > Hi, > I created two grammars, one is a lexer-parser grammar including tokens > and the parser rules, and the other is the tree grammar which walks on > the tree the lexer-parser grammar creates. But the problem is that, the > two grammar files create two .tokens files (each creates one) and the > token reference numbers are different in those files for the same token. > And in the .tokens file, the corresponding strings to the tokens are > represented because there are lexical rules in my lexer-parser grammar, > whereas in the .tokens file of the tree grammar, there are only the > string names and their token numbers. So, the two grammars do not know > they are related. How should I make them know this?Should I import > lexer-parser grammar in the tree grammar or sth like that?
Try the grammar option tokenVocab, explained in the context of treegrammars at http://www.antlr.org/wiki/display/ANTLR3/4.+Tree+Parsing -- Sam Barnett-Cormack List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---
