[il-antlr-interest: 34916] Re: [antlr-interest] Having trouble with creating a parser for my desired grammar. Running afoul of multiple alternatives warnings

2011-11-16 Thread Bart Kiers
Hi John, On Tue, Nov 15, 2011 at 11:46 PM, John B. Brodie j...@acm.org wrote: Greetings! ... I do not think you want to recognize floating point values in the parser. any tokens you send to the HIDDEN $channel (or skip();) will be silently accepted before and after the '.' of the float.

[il-antlr-interest: 34917] [antlr-interest] [C] my v3 Parser no reuse() slower 20% than v2. With reuse() 2GB leaks, oops.

2011-11-16 Thread Ruslan Zasukhin
Hi Jim, I have spent 2 days running around this, and now I am ready describe what I see, to get your help, and it seems exists bug/leaks in reuse() area. Or I not correctly use it, but I do as you described in single letter 3 months ago. So ... Long story :-) * I have simple bench that do 100K

[il-antlr-interest: 34918] [antlr-interest] question on java.g 1.6

2011-11-16 Thread Jeremy Long
I am still fairly new to antlr and when looking at the 1.6 Java grammar I noticed the following statement rule: statement : block | ('assert' ) expression (':' expression)? ';' | 'assert' expression (':' expression)? ';' | 'if' parExpression statement

[il-antlr-interest: 34920] Re: [antlr-interest] [C] my v3 Parser no reuse() slower 20% than v2. With reuse() 2GB leaks, oops.

2011-11-16 Thread Jim Idle
[C] my v3 Parser no reuse() slower 20% than v2. With reuse() 2GB leaks, oops. Do not use the $text annotations if you want performance, they are purely for convenience – I must have said this 5000 times and I wish I had never added that bit ;) I also told you 3 or 4 times in various emails not to

[il-antlr-interest: 34922] Re: [antlr-interest] [C] my v3 Parser no reuse() slower 20% than v2. With reuse() 2GB leaks, oops.

2011-11-16 Thread Jim Idle
All your assumptions below are correct - the methods you are calling there are public to grammar programmers for this reason. Just lose the $text and have your own helper methods - for instance you only want the text when it is time to actually do something with it, and not just to create a new

[il-antlr-interest: 34924] Re: [antlr-interest] [C] my v3 Parser no reuse() slower 20% than v2. With reuse() 2GB leaks, oops.

2011-11-16 Thread Ruslan Zasukhin
On 11/16/11 6:00 PM, Jim Idle j...@temporal-wave.com wrote: xxx: s=HEX_NUMBER { $s.type = CONST_STR_HEX; } ; Jim, This gives error as SqlParser_v3.g:879:21: cannot write to read only attribute: $u.type -- Best regards, Ruslan Zasukhin VP Engineering and New Technology Paradigma

[il-antlr-interest: 34925] Re: [antlr-interest] [C] my v3 Parser no reuse() slower 20% than v2. With reuse() 2GB leaks, oops.

2011-11-16 Thread Jim Idle
Do it without the .type then, just use C code directly. Don't forget that you can do things like: { pANTLR3_BASE_TOKEN t; t = LT(-1); t-type = XXCX; } Or perhaps myHelper($s, MYTYPE); Jim -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-

[il-antlr-interest: 34926] Re: [antlr-interest] Having trouble with creating a parser for my desired grammar. Running afoul of multiple alternatives warnings

2011-11-16 Thread Jarrod Roberson
On Tue, Nov 15, 2011 at 5:46 PM, John B. Brodie j...@acm.org wrote: Greetings! I think you have issues with your function, number, and ATOM rules. see below... apparently I did I have attached my complete, modified, grammar that successfully parses your input sample. thanks for taking

[il-antlr-interest: 34927] Re: [antlr-interest] Having trouble with creating a parser for my desired grammar. Running afoul of multiple alternatives warnings

2011-11-16 Thread Bart Kiers
Hi, On Wed, Nov 16, 2011 at 8:21 PM, Jarrod Roberson jar...@vertigrated.comwrote: actually thanks to Bart I need the FLOAT rule as a parser rule with the predicate because I want to be able to match But John raises a valid point that I didn't mention: by promoting such a rule to a parser

[il-antlr-interest: 34928] Re: [antlr-interest] Having trouble with creating a parser for my desired grammar. Running afoul of multiple alternatives warnings

2011-11-16 Thread Bart Kiers
On Wed, Nov 16, 2011 at 8:38 PM, Bart Kiers bki...@gmail.com wrote: Hi, On Wed, Nov 16, 2011 at 8:21 PM, Jarrod Roberson jar...@vertigrated.comwrote: actually thanks to Bart I need the FLOAT rule as a parser rule with the predicate because I want to be able to match But John raises a

[il-antlr-interest: 34929] Re: [antlr-interest] Having trouble with creating a parser for my desired grammar. Running afoul of multiple alternatives warnings

2011-11-16 Thread Jarrod Roberson
On Wed, Nov 16, 2011 at 2:39 PM, Bart Kiers bki...@gmail.com wrote: On Wed, Nov 16, 2011 at 8:38 PM, Bart Kiers bki...@gmail.com wrote: Hi, On Wed, Nov 16, 2011 at 8:21 PM, Jarrod Roberson jar...@vertigrated.comwrote: actually thanks to Bart I need the FLOAT rule as a parser rule with

[il-antlr-interest: 34930] Re: [antlr-interest] Having trouble with creating a parser for my desired grammar. Running afoul of multiple alternatives warnings

2011-11-16 Thread Bart Kiers
On Wed, Nov 16, 2011 at 8:45 PM, Jarrod Roberson jar...@vertigrated.comwrote: Or even the input: 123 /* some comments */ . /* more comments */ 5 would be a valid `number`... :) Is there a way to support both a - 1. b - 1.1. in a pure lexer rule then, I didn't think there was? See

[il-antlr-interest: 34931] Re: [antlr-interest] Having trouble with creating a parser for my desired grammar. Running afoul of multiple alternatives warnings

2011-11-16 Thread Jarrod Roberson
On Wed, Nov 16, 2011 at 2:55 PM, Bart Kiers bki...@gmail.com wrote: On Wed, Nov 16, 2011 at 8:45 PM, Jarrod Roberson jar...@vertigrated.comwrote: Or even the input: 123 /* some comments */ . /* more comments */ 5 would be a valid `number`... :) Is there a way to support both a -

[il-antlr-interest: 34933] Re: [antlr-interest] question on java.g 1.6

2011-11-16 Thread Eric
Hi Jeremy, This is not an answer but my thoughts after reading it. It looks like the first option originally had some other text with it that was removed and the second option was valid as originally written. If it was me, I would try and find earlier versions from either antlr 2.x or something

[il-antlr-interest: 34934] Re: [antlr-interest] This should be easy - but I can't figure it out

2011-11-16 Thread John B. Brodie
On 11/16/2011 12:02 AM, Voelkel, Andy wrote: array: '[' FLOAT+ | STRING+ ']' - ^(ARRAY FLOAT+ STRING+) ; the separate lists on the right of the - work because your syntax specifies separate lists. [Andy - this approach doesn't work - I get exceptions thrown. I haven't debugged that