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 > Javacc: two tok...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 7 Topic 529 of 549
Post > Topic >>

Javacc: two tokens have the same definition ?

by Link <leon.lim.info@[EMAIL PROTECTED] > Apr 23, 2008 at 06:52 AM

Hi everyone !

I use JTB/JavaCC to developpe a compiler for my language.

I have a trivial JavaCC problem which is blocking me from otherwise
having a JTB/JavaCC
solution.

In the grammar specification rules, i have two tokens which have the
same definition.
....
TOKEN:{
    <#IDENT: ["A"-"Z"](["a"-"z","A"-"Z","0"-"9","-","_"])*>
|   <IdentTypeA: <IDENT> >
|   <IdentTypeB: <IDENT> >
}
....

In spite of having the same definition, I would like to keep theses
two tokens.

JTB and JavaCC read and generate files without problem.
And IdenTypeA is well defined but not for IdentTypeB.

This problem is some kind of "First declared Firs Defined".
(Yes it's true that the rule that appears first in the specification
file has priority)

Do you have any idea of this problem ?
Is there a  way to get around this problem ?

Thank

Best regards
Link
 




 7 Posts in Topic:
Javacc: two tokens have the same definition ?
Link <leon.lim.info@[E  2008-04-23 06:52:49 
Re: Javacc: two tokens have the same definition ?
Cesare Zecca <Cesare.Z  2008-04-24 05:08:02 
Re: Javacc: two tokens have the same definition ?
Link <leon.lim.info@[E  2008-04-24 11:41:12 
Re: Javacc: two tokens have the same definition ?
Chris F Clark <cfc@[EM  2008-04-26 00:12:37 
Re: Javacc: two tokens have the same definition ?
Link <leon.lim.info@[E  2008-04-28 04:17:30 
Re: Javacc: two tokens have the same definition ?
Link <leon.lim.info@[E  2008-04-28 04:23:36 
Re: Javacc: two tokens have the same definition ?
Link <leon.lim.info@[E  2008-04-28 04:36:21 

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:58 CDT 2008.