Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compiler Tools JavaCC > multi-part name...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 455 of 549
Post > Topic >>

multi-part names in single token

by "mwnorman@[EMAIL PROTECTED] " <mwnorman@[EMAIL PROTECTED] > Apr 2, 2007 at 10:06 AM

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
 




 2 Posts in Topic:
multi-part names in single token
"mwnorman@[EMAIL PRO  2007-04-02 10:06:50 
Re: multi-part names in single token
Quintria <mikronik@[EM  2007-04-15 16:20:55 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 14:31:42 CDT 2008.