2 problems with lexer inheritance
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Vladimir_Kats
Posted On:   Thursday, April 18, 2002 05:53 AM

1. I've got a lexer and I want to create another lexer with the same rules and wider tokens vocabulary, so I create a derived lexer. But if the derived lexer contains no own rules (only inherited ones), ANTLR reports an error ("unexpected token: null") at the next position after the last symbol of the file. 2. When I create two lexers in different files, one derived from another, the "child" (after expansion) doesn't contain tokens from tokens section of "parent". Instead of this it contains option exportVocab with reference to "parent"'s vocabulary, so I have to process "parent" by ANTLR before processing "child", in spite of that I don't need "parent" itself   More>>

1. I've got a lexer and I want to create another lexer with the same rules and wider tokens vocabulary, so I create a derived lexer. But if the derived lexer contains no own rules (only inherited ones), ANTLR reports an error ("unexpected token: null") at the next position after the last symbol of the file.


2. When I create two lexers in different files, one derived from another, the "child" (after expansion) doesn't contain tokens from tokens section of "parent". Instead of this it contains option exportVocab with reference to "parent"'s vocabulary, so I have to process "parent" by ANTLR before processing "child", in spite of that I don't need "parent" itself.

   <<Less
About | Sitemap | Contact