[antlr-interest] Rookie attempt at ANTLR 3 (Using ANTLRWORKS second correction attempt)

Foolish Ewe foolishewe at hotmail.com
Thu Oct 26 11:43:26 PDT 2006


Hello All:

I had a catastrophe during the edit of my previous attempt at a correction,
so now I'm really groveling, please forgive me if you get a redundant reply.
I'm using ANTLR3 using ANTLRworks (which seems very nice so far) under
Windows XP in case you are wondering. There should be a MIME attached
ANTLR3 grammar to this message.

When I try to compile TestGrammar.g (a MIME attached file), I get the 
following errors in the
console tab in the bottom subwindow.  Although the prior posting omitted the 
grammar
(just as well, since I got to correct the java code in the @members 
section), there really
was some code generating that message.
[14:40:33] grammar TestGrammar: no start rule (no rule can obviously be 
followed by EOF)
[14:40:33] [Long path omitted]TestGrammar.g:44:3: The following alternatives 
are unreachable: 3

Note that I'm trying this approach because I've got a strange language that 
I'm trying
to scan which has "undelimited" strings (for historical reasons, this wasn't 
my doing),
so I sometimes would like to suppress key word recognition.  If I could scan 
in the language
properly, I think the parsing itself might not be too bad.

If I comment out the first and second alternative, (so that startRule->end 
NEWLINE) then
ANTLR will generate source but instead I get  (what seems to be) a Java code 
generation error.

13:06:08] [Long Path Snipped]\TestGrammar.java:78: illegal start of 
expression
[13:06:08]         void endtoken = null;
[13:06:08]         ^
[13:06:08] 1 error

Once again, sorry about cluttering up the mailing list with the prior 
malformed message,
I hope this one is well formed.

Thanks:

Bill M.

>From: "Jim Idle" <jimi at intersystems.com>
>To: "Foolish Ewe" <foolishewe at hotmail.com>,<antlr-interest at antlr.org>
>Subject: Re: [antlr-interest] Rookie attempt at ANTLR 3 (using 
>thecurrentANTLRWorks under Window XP)
>Date: Wed, 25 Oct 2006 18:24:46 -0400
>
>Bill,
>
>Unless you have missed some of the grammar out from this post, it looks
>to me like you don't actually have any rules in the grammar, only some
>member functions? I would think that that you do really have some rules
>but just have not posted them? ;-)
>
>If I take out the java code from your post, we are left with:
>
>// Test hoisting and use of predicates to allow us to use "undelimited
>strings"
>grammar TestGrammar;
>
>// I'm not using tokens in this langauge yet.
>//tokens = { }
>
>
>If this is really your grammar, then I would think it is pretty obvious
>;-), that there is no rule for ANTLR to look for EOF in.
>
>Jim
>
>-----Original Message-----
>From: antlr-interest-bounces at antlr.org
>[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Foolish Ewe
>Sent: Wednesday, October 25, 2006 1:30 PM
>To: antlr-interest at antlr.org
>Subject: [antlr-interest] Rookie attempt at ANTLR 3 (using the
>currentANTLRWorks under Window XP)
>
>Hi Folks:
>
>I'm trying ANTLR 3 today, using ANTLRworks (so far it seems like Bovet
>and
>Parr have some
>reallly neat stuff in there).
>
>I'm trying to compile the attached grammar in the tool and am getting a
>message:
>
>Cannot generate the grammar because grammar TestGrammar : no start rule
>(no
>rule can
>obviously be followed by EOF).
>
>This will probably out me to my coauthors and students, but I'm not a
>big
>fan of the words
>obviously/easily or their variants :-).
>
>What does this message mean, how can I better convey to ANTLR that
>startRule
>is the start rule?
>
>Thanks:
>
>Bill M.
>
>_________________________________________________________________
>Use your PC to make calls at very low rates
>https://voiceoam.pcs.v2s.live.com/partnerredirect.aspx
>
>
>--
>No virus found in this incoming message.
>Checked by AVG Free Edition.
>Version: 7.1.408 / Virus Database: 268.13.11/496 - Release Date:
>10/24/2006
>

_________________________________________________________________
Stay in touch with old friends and meet new ones with Windows Live Spaces 
http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestGrammar.g
Type: application/octet-stream
Size: 2771 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20061026/6064576b/attachment.obj 


More information about the antlr-interest mailing list