ANTLR grammar
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   jon_bob
Posted On:   Sunday, May 27, 2007 11:30 AM

Hello I am trying to bring a string into an object structure. The string look like “ name[1..2] name[1..2] name[1..2] “. So i have three blocks and the second two are optional. I just want to sort this three substrings into three nearly the same rules. Only the semantic action are different. I am trying something like that: “: i0=getAssociationEndName() {a0.setIdentifiableElement(i0); a.set(0,a0);} (i1=getAssociationEndName(){a1.setIdentifiableElement(i1); a.set(1,a1);})? ( i2=getAssociationEndName(){a2.setIdentifiableElement(i2); a.set(2,a2);} )? ; “ If I use more the one question mark, then it does not work. I need that order. Pleas help me with that trivial problem   More>>

Hello I am trying to bring a string into an object structure.
The string look like “ name[1..2] name[1..2] name[1..2] “.
So i have three blocks and the second two are optional.
I just want to sort this three substrings into three nearly the same rules. Only the semantic action are different.
I am trying something like that:
“:
i0=getAssociationEndName() {a0.setIdentifiableElement(i0); a.set(0,a0);}
(i1=getAssociationEndName(){a1.setIdentifiableElement(i1); a.set(1,a1);})?
( i2=getAssociationEndName(){a2.setIdentifiableElement(i2); a.set(2,a2);} )? ;
“
If I use more the one question mark, then it does not work. I need that order.
Pleas help me with that trivial problem.
Thanks

jon

   <<Less
About | Sitemap | Contact