Hello again,
since you helped me nicely last time a have an other question:
Is it now possible to use a list in a tree grammar? I found a mail from
2007 saying it will be implemented soon.
But when I try it, I get a very long error Message.
Here is the grammar:
tree grammar TreeWalker;
options{
Dear Jim
On 01.02.2011 18:15, Jim Idle wrote:
>
>
> I think
> that in 3.3 I have fixed a bug that was not releasing memory references
> when building a tree until the tree was freed. Try making a version that
> does not build a tree and see how it differs.
>
>
Ok, made a version of my grammar t
I think that the fix is in there, which means that your input is too big
to build the tree in the way it is being done. Write an input stream
wrapper that splits the input by just returning EOF at the split point
then resets to the next unit.
How are you ending up with 640,000 lines of C input?
J
I was reading about the following grammar on page 287 of the PDF document
grammar t;
s : X r A B
| Y r B
;
r : A
|
;
I don't see where the problem is since the alternatives in s begin with two
different tokens X and Y. I think that since these two tokens are different I
can easily con
On 02.02.2011 18:01, Jim Idle wrote:
> I think that the fix is in there, which means that your input is too big
> to build the tree in the way it is being done. Write an input stream
> wrapper that splits the input by just returning EOF at the split point
> then resets to the next unit.
Actually I
Please contact Brent at brero...@cisco.com if you are interested in the job
opening listed below.
Regards,
Brent
Senior Software Engineer
Location San Jose, California
Security Technology Business Unit (STBU) within WSRTG, is seeking a Software
Engineer. STBU offers network and content sec
try for rule 'r' though ;)
Ter
On Feb 2, 2011, at 9:07 AM, Alan D. Cabrera wrote:
> I was reading about the following grammar on page 287 of the PDF document
>
> grammar t;
> s : X r A B
> | Y r B
> ;
>
> r : A
> |
> ;
>
> I don't see where the problem is since the alternatives in s begin w
Hi there. I am having trouble with the error handling.
I have a grammar for recoignize linear expression. And it works great!.
The grammar for a linear expresion is the following:
tokens
{
PLUS= '+';
MINUS = '-';
MUL = '*';
DIV = '/';
}
The problem is the decision inside rule r. Since ANTLR uses lookahead only
(as opposed to lookbehind), the decision making doesn't know which instance
of r is being parsed. The following would resolve the issue:
s : X r1 A B
| Y r2 B
;
r1 : A | ;
r2 : A | ;
-Original Message-
From:
Your grammar does not mention the EOF token. (more below...)
On Wed, 2011-02-02 at 16:18 -0300, Victor Giordano wrote:
> Hi there. I am having trouble with the error handling.
> I have a grammar for recoignize linear expression. And it works great!.
> The grammar for a linear expresion is the follo
Ahh, the DFA for the 'r' rule. That makes sense now. Interesting example.
Thanks Terence and Sam!
Regards,
Alan
On Feb 2, 2011, at 11:17 AM, Terence Parr wrote:
> try for rule 'r' though ;)
> Ter
> On Feb 2, 2011, at 9:07 AM, Alan D. Cabrera wrote:
>
>> I was reading about the following gra
Here's a draft of "LL(*): The Foundation of the ANTLR Parser Generator"
http://www.antlr.org/papers/LL-star-PLDI11.pdf
Explains the LL(*) parsing strategy and ANTLR's analysis algorithm that builds
LL(*) parsers. [warning: written for academic audiences.]
Ter
List: http://www.antlr.org/mailman
Thanks for your anwser John. Your explanation was very clear and most
welcome!.
Thinks seem to go better beacuse kwow the parser is throwing an
MissingTokenExeption.
I will capture and use it for the cause!!
Grettins and thanks again!.
Víctor.
El 02/02/2011 05:32 p.m., John B. Brodie escribió:
Just a little more on the issue below, when I swapped the tree
grammars that were provoking the "Can't set single child to a list"
error from pattern matching mode (filter = true) to complete grammars
(filter = false) the tree rewrites run successfully.
I'd still be interested to hear if issue AN
I'm designing a project for my compiler class, and we are at the stage
of building an interpreter for our grammar. Before going farther, let me
say first that ANTLR is great and makes the whole process a lot easier.
However, I'm converting the course and, being new to ANTLR, have a few
questions. H
Okey. So adding and EOF forces the parser to go to the end of the input
in search of others tokens in correct order.
1)But a still have a problem, consider the following grammar:
grammar LinearMath;
tokens
{
PLUS = '+';
MINUS = '-';
MUL= '*';
DIV= '/'
[Updated]I am watching when i use the generated lexer and parser
(Generated from the LinearMath grammar below) in a java application is
that do really emit somekind of warning about two thinks:
1)extraneous input '' expecting EOF *Only when a append the
EOF token at the end of the rule*
2)requi
>So would it be better to have an example like the Pie language use a
>tree grammar or is the hand-written visitor code a better approach? What
>are the pros and cons? Any help appreciated.
A pure interpreter would read statements one by one and execute them directly.
A compiler would read the who
18 matches
Mail list logo