Hi All,
The problem I am facing is while reading a string if a letter matches a
TOKEN it starts acting funny.
Example
text_content
funny boys are Tom Hardy Donald
serious guys are not funny either
grammar
options {
language=Java;
k=1;
}
start
: 'funny' call_funny_parse
| 'serious' call_serious_parse
;
call_funny_parse
@init {
ArrayList<String> person = new ArrayList<String>(); //this should contain
Tom Hardy Donald
}
: jackT=TOKEN //boys
macT=TOKEN //are
(nextPersonT=TOKEN { person.add($nextPersonT.text); })* // Tom Hardy
Donald
;
call_serious_parse
@init {
String line = "";
}
: (stringT=TOKEN { line = line + $stringT.text; })* // This is where is
fails and says funny is expecting something else
How do I get around this
Thanks
Hiten
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.