[il-antlr-interest: 32379] Re: [antlr-interest] Function Expressions

2011-05-04 Thread Jeff Hair
Oh, and thanks. I've put your code through a bunch of crazy scenarios after adapting it to my full needs and it works perfectly. I can now move forward with changes to the tree parser and interpreter. Thanks again. On Wed, May 4, 2011 at 6:19 PM, John B. Brodie wrote: > I think that basically yo

[il-antlr-interest: 32378] Re: [antlr-interest] Function Expressions

2011-05-04 Thread Jeff Hair
This does indeed work as expected. Wouldn't have been able to come up with that on my own. I started down the path of putting function calls in between term and booleanExpression, and that was *sort of* working. But I also uncovered some other issues with properties (what you are calling projection

[il-antlr-interest: 32377] Re: [antlr-interest] Function Expressions

2011-05-04 Thread John B. Brodie
Greetings! On Wed, 2011-05-04 at 12:27 -0400, Jeff Hair wrote: > Hello all, > > I have a simple C/JavaScript-style grammar for my interpreter project. Right > now, functions can be called via identifier(), or identifier(param1, > param2). This works fine for simple cases, but in my language funct

[il-antlr-interest: 32376] Re: [antlr-interest] Function Expressions

2011-05-04 Thread Jeff Hair
Right. That's basically what I'm doing right now. The problem is that I can't call do stuff like anonymous function calls (which can be generated by an expression). So I'm trying to figure out how to do enable that without getting the recursion errors. JavaScript allows you to do stuff like (funct

[il-antlr-interest: 32375] Re: [antlr-interest] Inserting missing nodes

2011-05-04 Thread Jim Idle
Don't use the interpreter, use the debugger. Jim > -Original Message- > From: Jean-Sebastien Vachon [mailto:jean- > sebastien.vac...@wantedtech.com] > Sent: Wednesday, May 04, 2011 9:33 AM > To: Jim Idle; antlr-interest@antlr.org > Subject: RE: [antlr-interest] Inserting missing nodes > >

[il-antlr-interest: 32374] Re: [antlr-interest] Function Expressions

2011-05-04 Thread Jim Idle
Generally when parsing you do this: expr ... atom : i=ID ( LPAREN e=exprList RPAREN ->^(FUNC $i $e) | -> ^(IDENT $i) ) ... Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Jef

[il-antlr-interest: 32373] Re: [antlr-interest] Inserting missing nodes

2011-05-04 Thread Jean-Sebastien Vachon
Ok I've changed my lexer and parser as you suggested but it didn't help. However, I found why the interpreter Is not able to generate the tree in Eclipse. I found the cause but not the explanation... It has something to do with the definition of the and_expr rule and_expr : (u1=or_expr (AND

[il-antlr-interest: 32372] [antlr-interest] Function Expressions

2011-05-04 Thread Jeff Hair
Hello all, I have a simple C/JavaScript-style grammar for my interpreter project. Right now, functions can be called via identifier(), or identifier(param1, param2). This works fine for simple cases, but in my language functions are first-class objects. I'm in the process of redoing my identifier

[il-antlr-interest: 32371] Re: [antlr-interest] Inserting missing nodes

2011-05-04 Thread Jim Idle
You need to fix your lexer first: WORDLIST: ((PREFIX | WORD | SENTENCE)(','(WS)* (PREFIX | WORD | > SENTENCE))+); is ambiguous with: > PREFIX: WORDCHAR+(STAR); > WORD: WORDCHAR+(('-'|'+')WORDCHAR*)*; You need to contstruct the lists in the parser not the lexer and shoul

[il-antlr-interest: 32370] Re: [antlr-interest] Inserting missing nodes

2011-05-04 Thread Jean-Sebastien Vachon
Thanks for your input. So here is the whole thing with two use cases that are not giving me the expected results... (Sorry for the long post) INPUT = abc def zyx toto RESULT = (DEFAULT_OP abc def) (DEFAULT_OP zyx toto) EXPECTED = (DEFAULT_OP (DEFAULT_OP abc def) (DEFAULT_OP zyx toto)) INPUT = s

[il-antlr-interest: 32369] Re: [antlr-interest] Source code level of ANTLRWorks

2011-05-04 Thread Jim Idle
That just means you are calling a compiler that has a default level less than 1.5. So, chance the javacc command in the preferences or remove the old compiler and install 1.6, or makes sure that 1.6 is the first on the command line. ANTLR works does not influence the Java compiler - it only calls t

[il-antlr-interest: 32368] Re: [antlr-interest] Memory requirements of C runtime when backtracking

2011-05-04 Thread Jim Idle
You should not be using backtrack=true if you are short on memory, but without seeing your grammar I cannot comment on the ram usage. It might be that your grammar causes the generation of huge DFA tables. Backtracking itself does not cost lots of memory though. jim > -Original Message- >

[il-antlr-interest: 32367] Re: [antlr-interest] Inserting missing nodes

2011-05-04 Thread Bart Kiers
On Wed, May 4, 2011 at 4:12 PM, Jean-Sebastien Vachon < jean-sebastien.vac...@wantedtech.com> wrote: > No one can help me with this? :S > Let me know if something is not clear. I need to fix this issue as soon as > I can. > > Thanks The fact that you didn't provide the lexer rules (although they

[il-antlr-interest: 32366] Re: [antlr-interest] Inserting missing nodes

2011-05-04 Thread Jean-Sebastien Vachon
No one can help me with this? :S Let me know if something is not clear. I need to fix this issue as soon as I can. Thanks -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Jean-Sebastien Vachon Sent: April-28-11 4:07 PM To:

[il-antlr-interest: 32365] [antlr-interest] Source code level of ANTLRWorks

2011-05-04 Thread Ben Corne
Hi Is there a way to set the source code level of antlrworks? I've checked the preferences pane and launchers with no avail. I need to set it to > 1.5, since I'm using Java Generics: [15:47:58] 102. ERROR in /home/bcorne/Downloads/at2-parser-3/grammar/output/ATGrammar3Lexer.java (at line 114) [1

[il-antlr-interest: 32364] [antlr-interest] Memory requirements of C runtime when backtracking

2011-05-04 Thread Ivan Brezina
Hi all doing some unit test of Oracle SQL grammar I'm facing problems with memory requirements when parsing input having many parenthesis. In general the grammar can have three types of statements which can be enclosed in parens. 1. value expression like (A),(1+2). For an sql_expression there