[antlr-interest] urgent help required ...
James Ladd
james_ladd at hotmail.com
Tue Dec 27 00:03:17 PST 2011
Hi Bart and all ....
The main no viable alternative errors occur around line 25 of Smalltalk.g
in the rule:
method returns [Method n]
: o = NAME c= '_class_'? '>>' messagePattern '[' primitive?
temporaries? statements ']' {$n = MethodFactory.create($o.text,
$c.text, $messagePattern.n, $primitive.n, $temporaries.n,
$statements.n);}
;
To get started with building and
parsing you can either use Antrl works or the getting started here:
http://www.redline.st/discover/getting-started.html
The project sources are here: https://github.com/redline-smalltalk/redline-smalltalk
In a nutshell there are a few binarySymbol methods that cause this rule to break with a "no viable" alternative.
If you goto the file Magnitude.st and change line 14 from
- \> aMagnitude
to
- > aMagnitude
You will then start to get the error.
If you were to make the line
- , aMagnitude
That will cause the error as well and it should not.
The second error I get is on the same rule. Essentially I changed the file PreProcessor.g to spit out a
'_class_' rather than 'class' to overcome a no viable alternative error I was getting. Id like to make sure
the preprocessor did NOT put out _class_ and that the method pattern rule on line 25 of Smalltalk.g
was ok with 'o = NAME c= 'class'? '>>' messagePattern'
Not it is ok for a method to look like the following:
- class
^ nil
You could modify Magnitude.st to have a method like this for testing.
Rgs, James.
Date: Tue, 27 Dec 2011 08:41:35 +0100
Subject: Re: [antlr-interest] urgent help required ...
From: bkiers at gmail.com
To: james_ladd at hotmail.com
CC: antlr-interest at antlr.org
Hi James,
On Mon, Dec 26, 2011 at 10:05 PM, James Ladd <james_ladd at hotmail.com> wrote:
You are right Bart.
This list is always very quick to respond and very thorough with the responses.
I don't mean to be demanding.
No problem James.
Jim has helped me previously and has offered to help again, so I'll wait to see
how this turns out. Should I post again, Ill be sure to do as you suggest, and
include the rules and errors.
Yes, please do.
Thanks All.
Rgs, James.
Regards,
Bart.
More information about the antlr-interest
mailing list