How do I pass Java String parameters from the Parser to the Lexer?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Richard_Gillingwater
Posted On:   Thursday, January 31, 2002 08:08 AM

My Parser/Lexer is:


			
class AnyLexer extends Lexer;
AnyT [String str2]
: { // use parameter str2 }
;

class AnyParser extends Parser;
anyText [String str1] returns [String strs]
{ strs = new String(); }
: p:AnyT // pass parameter str1 somehow?
strs += p.getText();
}
;

Re: How do I pass Java String parameters from the Parser to the Lexer?

Posted By:   Terence_Parr  
Posted On:   Thursday, January 31, 2002 06:25 PM

The parser does not call the lexer explicitly to obtain tokens. The lexer fills a queue that the parser uses. Feedback from the parser to the lexer is considered a problem. Can you think of another way to solve your problem?
About | Sitemap | Contact