[antlr-interest] ANTLR3 Template rewrite not outputting anything...

Kailey Joanette kaileyjo at bigbluebubble.com
Mon Mar 26 05:58:54 PDT 2007


I have a rewrite that looks like this:

 

primary

    :           

    parExpression

    |   nonWildcardTypeArguments

        (explicitGenericInvocationSuffix | 'this' arguments)

    |   'this' (arguments)?

    |   'super' superSuffix

    |   literal {System.out.println("lit!"+$literal.text);}-> singleton(
name={$literal.text} )

    |   'new' creator

//    |   Identifier ('.' Identifier)* (identifierSuffix)?

    |   primitiveType ('[' ']')* '.' 'class'

    |   'void' '.' 'class'

                ;

 

I'm not worried about the other targets but literal DOES get used.  The lit!
prints out the correct value but when it returns the StringTemplate nothing
has been added to it.  I'm 95% sure that there are ST rewrites all along the
hierarchy that leads to primary.  Is there anything that could cause this?

 

Also, on that same note, is there any way to have every rule return an ST
without having to explicitly say it?  So that it's subrules take care of
everything if that's what I want?

Kailey

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070326/4079f3ab/attachment.html 


More information about the antlr-interest mailing list