[il-antlr-interest: 31311] [antlr-interest] tree grammar and list via +=

2011-02-02 Thread Bastian Asam
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;

[il-antlr-interest: 31313] Re: [antlr-interest] Memory management of C target

2011-02-02 Thread Marco Trudel
Dear Jim On 01.02.2011 18:15, Jim Idle wrote: snip 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. snip Ok, made a version of my grammar

[il-antlr-interest: 31314] Re: [antlr-interest] Memory management of C target

2011-02-02 Thread Jim Idle
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?

[il-antlr-interest: 31315] [antlr-interest] SLL(2) in The Definitive ANTLR Reference

2011-02-02 Thread Alan D. Cabrera
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

[il-antlr-interest: 31316] Re: [antlr-interest] Memory management of C target

2011-02-02 Thread Marco Trudel
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

[il-antlr-interest: 31317] [antlr-interest] JOB: Senior Software Engineer with Parsing Expertise needed at CISCO

2011-02-02 Thread breroger
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

[il-antlr-interest: 31318] Re: [antlr-interest] SLL(2) in The Definitive ANTLR Reference

2011-02-02 Thread Terence Parr
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 with two

[il-antlr-interest: 31319] [antlr-interest] Question of Repetead tokens and early termination

2011-02-02 Thread Victor Giordano
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 = '/';

[il-antlr-interest: 31321] Re: [antlr-interest] Question of Repetead tokens and early termination

2011-02-02 Thread John B. Brodie
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

[il-antlr-interest: 31322] Re: [antlr-interest] SLL(2) in The Definitive ANTLR Reference

2011-02-02 Thread Alan D. Cabrera
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 grammar

[il-antlr-interest: 31326] Re: [antlr-interest] tree pattern matching rewrite bug ?

2011-02-02 Thread Michael Bedward
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

[il-antlr-interest: 31328] [antlr-interest] Catching errors

2011-02-02 Thread Victor Giordano
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=

[il-antlr-interest: 31330] Re: [antlr-interest] Which approach for an Interpreter: Tree Grammar vs AST-Visitor

2011-02-02 Thread Hiran Chaudhuri
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 whole