multi-part names in single token
- From: "mwnorman@xxxxxxxxx" <mwnorman@xxxxxxxxx>
- Date: 2 Apr 2007 10:06:50 -0700
I have some productions that have to deal with names that can be 'bar'
or 'foo.bar'
ASTProgramUnit programUnit() #ProgramUnit : {}
{
(
(<FUNCTION> | <PROCEDURE>) programUnitName()
...
)
{ return jjtThis; }
}
ASTProgramUnitName programUnitName() #ProgramUnitName : {}
{
(LOOKAHEAD(2) ID()".")? ID()
{ return jjtThis; }
}
How do I get a single token whose image is either 'bar' or 'foo.bar'?
When I walk my tree, ASTProgramUnitName's _first , _next and _last
tokens
are 'foo', '.', and 'bar'.
Thanks in advance,
Mike Norman
.
- Follow-Ups:
- Re: multi-part names in single token
- From: Quintria
- Re: multi-part names in single token
- Prev by Date: Re: testing AST nodes
- Next by Date: AST execution/traversal
- Previous by thread: Re: testing AST nodes
- Next by thread: Re: multi-part names in single token
- Index(es):