[antlr-interest] Problems with token class-type override feature (with C# codegen)

micheal_jor open.zone at virgin.net
Sat Jul 27 01:32:38 PDT 2002


Hi,

While exploring the idea of custom AST classes, I noticed that the 
feature is supposed to that allow me to specify alternative AST 
classes on a per-token basis isn't working.

I specified the following in my grammar but in the generated code the 
default AST class type is still used for all nodes. There is no 
reference to the specified class type at all.

    tokens
    {
      LOCK_STMT<AST=LockStatement>;
    }

I though it might be related to the fact that I use manual 
treebuilding commands such as:

    lockStatement
      :  LOCK! 
         (  ( LPAREN! stmtList )=> LPAREN! expression RPAREN! block
            { ## = #( [LOCK_STMT, "LOCK_STMT"], ##); } 
         |  block
            { ## = #( [LOCK_DIRECTIVE, "LOCK_DIRECTIVE"], ##); } 
         )
      ;

This is with C#. Does this feature work at all?. If it does, can 
anyone give me a quick pointer to what I should look out for in 
fixing the C# codegen pls (it needs an update soon anyways methinks).

Micheal



 

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



More information about the antlr-interest mailing list