I think you can solve this with something like: OR ... ( ("GANISM") { _ttype = ORGANISM; } ... ) ; Also if k is set to be 3 in this case the "OR" and "ORG"...
I am writing a macro processor in Java and I have to admit that I have gotten lost in the possible ways to ignore text in ANTLR. Given <EXAMPLE> .include...
1109
Ken Lidster
Ken.Lidster@xxxxxxxx....
Dec 1, 1999 8:21 pm
Jack, Wouldn't it be easiest to simply extend the IDENT rule to check for these? I'm not sure of the exact syntax (I don't know java that well), but the ...
1110
parrt@xxxxx.xxxx
Dec 2, 1999 3:26 am
Folks, I've just resurfaced after 3 months hard labor co-building http://www.jguru.com This is a groovy Java programmer39;s portal, which now contains the ANTLR...
1111
Michael Schmitt
schmitt@xxx.xxxxxxxxx...
Dec 2, 1999 11:18 am
Hello, ... 2.7.0a9??? Where can I get that from? I have never ever seen a link to that version. ... Could you please tell us what 'Sather39; means? Is that a...
1112
parrt@xxxxx.xxxx
Dec 2, 1999 6:03 pm
... http://www.antlr.org/nirvana/antlr-2.7.0a9.zip ... Sather is a language built at Bezerkeley I think. ... Won't have hoisting for a while ;) ... Hmm...can't...
1113
kevin.burton@xxxxxxxx...
Dec 2, 1999 7:13 pm
I am trying to use some of the same rules that I used for YACC type grammer description with ANTLR and either they do not work as I expect or I get aan error...
1114
Sinan
sinan.karasu@xxxxxx.x...
Dec 2, 1999 8:14 pm
... para ... (textpara ... ) (para)? ... ; Rule: Always consume something before recursing...... Sinan...
1115
Sinan
sinan.karasu@xxxxxx.x...
Dec 2, 1999 8:44 pm
Any comments on this method for keeping track of lineno and column no ? Sinan PS: I realize I still have to handle tabs but that is for another hour...... { ...
1116
kevin.burton@xxxxxxxx...
Dec 3, 1999 10:33 pm
I am still rather new to ANTLR so hopefully this is a quick question. How do I ignore all <CR> <LF>39;s ? Kevin Burton Kevin.Burton@......
1117
Devendra Bahirat
devendra@xxxxx.xxxx.x...
Dec 6, 1999 3:34 am
I am using older version of ANTLR (V1.1). It has got a limitation on an action buffer size (192 Bytes). Is there any option to increase this buffer size. ...
1118
kevin.burton@xxxxxxxx...
Dec 4, 1999 6:10 pm
I have long lists in the lexer portion of my parser that look like: TQDEC ... ; TLDOT ... ; TLHYPH ... ; CHBGDCROSS ... ( ("cross") (WS)?! { _ttype = ...
1119
kevin.burton@xxxxxxxx...
Dec 4, 1999 5:57 pm
I think I can answer my own question (sort of). I made a rule: IGNORE : ('\r39;|'\n'|"92;r\n") { newline(); } Then as one of the options for the Lexer I set...
1120
kevin.burton@xxxxxxxx...
Dec 6, 1999 3:19 pm
I started to try and change my parser so that it would build an AST and I ran into a few problems. Hopefully there is someone on this list that either knows of...
1121
Michael T. Richter
mtr@xxx.xxxx
Dec 6, 1999 4:24 pm
... I'm finding that problem myself for the ASN.1 system I'm working on. Here are a couple of things I've found I've had to do to solve the problems. More...
1122
kevin.burton@xxxxxxxx...
Dec 6, 1999 6:02 pm
Thank you. These suggestions helped alot. Of course they generated some other questions. 1) Michael indicated that I should create a seperate secfmts rule to...
1123
Michael T. Richter
mtr@xxx.xxxx
Dec 6, 1999 6:18 pm
... When I tried exactly this approach, I got only the last element of the list of rules in the ()* expression. I had to move it down to a subrule to get the...
1124
kevin.burton@xxxxxxxx...
Dec 6, 1999 7:46 pm
How do I handle recursion? If I have a rule para ... The first portion of the rule I guess would become something like: OGROUP! p:para CGROUP! { #para = #p; } ...
1125
Michael T. Richter
mtr@xxx.xxxx
Dec 6, 1999 8:04 pm
... Gut feel (i.e. I'm not positive this is correct): I'd just leave it alone. The final rule would look like something this. para ... { #para = #(p); } ... ; ...
... You're telling it to. The '!' character at the end of docsecfmtitems, hdrftritems and paraitems tells ANTLR to ignore this rule unless you manually build...
1128
kevin.burton@xxxxxxxx...
Dec 7, 1999 4:21 pm
If I change the rules to look like: document ... CGROUP! EOF! ; rtfheader ... (colortbl)? (stylesheet)? ; rtfdocument ... ; section! ... (hf:hdrftritems)?...
1129
Michael T. Richter
mtr@xxx.xxxx
Dec 7, 1999 4:46 pm
... We're well out of my league now. -- Michael T. Richter <mtr@...> http://www.igs.net/~mtr/ PGP Key: http://www.igs.net/~mtr/pgp-key.html PGP...
1130
parrt@xxxxx.xxxx
Dec 7, 1999 5:51 pm
... This looks weird to me. Get rid of the extra parens. #(...) is a tree. #label is a reference to a tree. Also, you use ^, but you have ! on the rule...
1131
kevin.burton@xxxxxxxx...
Dec 7, 1999 6:03 pm
I really do not want #(#(df), #(hf), #(p)). I agree that it does not make sense to have a tree as a root node. Is what I want is to form three separate trees,...
1132
Ken Lidster
Ken.Lidster@xxxxxxxx....
Dec 7, 1999 7:18 pm
Kevin, I'm certainly not an expert, but you might want to consider something like sectionList ... ; section! ... { ## = #(SECT #(PARA #p) #(DOCSEC #d) #(HDRFTR...
1133
kevin.burton@xxxxxxxx...
Dec 7, 1999 7:51 pm
Ken, Thanks for your comments. Is this the correct syntax? I tried it and am getting "Syntax error in action: Error: line(62), mismatched char: '#' expected...
1134
kevin.burton@xxxxxxxx...
Dec 7, 1999 9:34 pm
Ken, Thanks to your comments I was able to put together the following code that does mostly what I want. tokens { SECTION; DOCSEC; HDRFTR; PARA; } . . . . . ...
1135
Ken Lidster
Ken.Lidster@xxxxxxxx....
Dec 7, 1999 9:42 pm
Sorry. I haven't worked with ANTLR for about 8 months. That syntax should be { ## = #([SECT], #([PARA], p), #([DOCSEC], d), #([HDRFTR], h)); } Also, if you...