[antlr-interest] While using preliminary C# code generator.

dinurp dinurp at yahoo.com
Tue Apr 23 05:32:51 PDT 2002


Hi,
I am trying to use the new C# code generator. I faced a peculiar 
problem while using it for tree construction. 

condition :
    boolean_term ( OR! boolean_term )*
    {
        if ( null != ##.getNextSibling() )
            ## = #(#[OR],##);
    }
    ;

OR token is defined in another grammer and the grammer from which the 
above piece is extracted imports that grammer.

The code generated by the CSharp generator doen't recognize OR in #
[OR]. This is because the symbol OR is not known to the Parser class. 
It is defined in TokenTypes class. Now I can go ahead and re-write it 
as #[TokenTypes.OR]. But is that the correct way? All the samples I 
have seen, they are for Java or C++, use #[OR] construct.

For the time being I copied all definitions from TokenTypes to the 
Parser class.

What are your suggestions?
Thanks,
Dinu


 

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



More information about the antlr-interest mailing list