[antlr-interest] A simple question

yjargudo yjargudo at tiscali.es
Tue Aug 3 03:59:40 PDT 2004


hello,

I need to parse a file twice. In each parsing I have to use the same
grammar only with different antlr actions added.

What I have to do?

I tried the following but It doesn't works

CPPLexer lex=new CPPLexer(anInputStream);
lex.setTokenObjectClass("antlr.CommonHiddenStreamToken");
TokenStreamHiddenTokenFilter filter=new 
        TokenStreamHiddenTokenFilter(lex);
filter.hide(CPPParser.Comment);
filter.hide(CPPParser.CPPComment);
parser = new CPPParser(filter);
parser.translation_unit(this);


CPPLexer2 lex2=new CPPLexer2(anInputStream);
lex2.setTokenObjectClass("antlr.CommonHiddenStreamToken");
TokenStreamHiddenTokenFilter filter2=new 
       TokenStreamHiddenTokenFilter(lex2);
filter2.hide(CPPParser2.Comment);
filter2.hide(CPPParser2.CPPComment);
parser2 = new CPPParser2(filter2);
parser2.translation_unit(this);


Thanks a lot,

Yolanda



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list