[il-antlr-interest: 23482] Re: [antlr-interest] "explosion" rewrite

2009-05-01 Thread Steve Ebersole
The problem is that sometimes you want the VECTOR_EXPR as such. And when you want which is not evident from the context of executing these 'expression' rules. Perhaps this is a use-case for scopes? And we haven't even gotten to the difficult cases of handling these tuples (think something like

[il-antlr-interest: 23481] Re: [antlr-interest] "explosion" rewrite

2009-05-01 Thread Steve Ebersole
sortKey : expression; expression : QUOTED_IDENTIFIER -> ^( COLUMN ALIAS_REF[Template.TEMPLATE] QUOTED_IDENTIFIER[$QUOTED_IDENTIFIER] ) // we treat the so-called standard functions differently because they are handled differently by the HQL lexer which we also use here... | standardFu

[il-antlr-interest: 23480] Re: [antlr-interest] "explosion" rewrite

2009-05-01 Thread Terence Parr
On May 1, 2009, at 5:03 PM, Steve Ebersole wrote: > Lets say sortKey comes back as > ^( VECTOR_EXPR >^( COLUMN >ALIAS_REF["a"] IDENTIFIER["col1"] >) >^( COLUMN >ALIAS_REF["a"] IDENTIFIER["col2"] >) > ) > > I'd really like sortSpecification to go from: > > ^( SORT_

[il-antlr-interest: 23479] Re: [antlr-interest] "explosion" rewrite

2009-05-01 Thread Steve Ebersole
Lets say sortKey comes back as ^( VECTOR_EXPR ^( COLUMN ALIAS_REF["a"] IDENTIFIER["col1"] ) ^( COLUMN ALIAS_REF["a"] IDENTIFIER["col2"] ) ) I'd really like sortSpecification to go from: ^( SORT_SPEC ^( VECTOR_EXPR["see above"] ) ) to: ^( SORT_SPEC ^( COLUMN

[il-antlr-interest: 23478] Re: [antlr-interest] New Mave n artifacts, some fixes, buidlable source

2009-05-01 Thread Michael Bedward
many thanks for all that Jim ! Michael List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

[il-antlr-interest: 23477] [antlr-interest] New Maven artifacts, some fixes, buidlable source

2009-05-01 Thread Jim Idle
Hi, We have a new Maven artifact available: maven-gunit-plugin, this automates the running of gunit tests as part of a Maven build. Documentation to follow, but it is fairly easy to work out if you already know ANTLR and gUnit. It can be used as:    org.antlr    maven-gunit-plugin   

[il-antlr-interest: 23476] Re: [antlr-interest] "explosion" rewrite

2009-05-01 Thread Jim Idle
Steve Ebersole wrote: > Is there a syntax to "explode" a subrule result (sorry don't know a > better term). > > I have a rule: > > sortSpecification > : sortKey collationSpecification? orderingSpecification? > -> ^( SORT_SPEC sortKey collationSpecification? > orderingSpecification? ) >

[il-antlr-interest: 23475] Re: [antlr-interest] "explosion" rewrite

2009-05-01 Thread Terence Parr
Hi Steve, what's the tree you need rather than the output? Thanks, T On May 1, 2009, at 1:14 PM, Steve Ebersole wrote: > Is there a syntax to "explode" a subrule result (sorry don't know a > better term). > > I have a rule: > > sortSpecification >: sortKey collationSpecification? orderingSpec

[il-antlr-interest: 23474] [antlr-interest] "explosion" rewrite

2009-05-01 Thread Steve Ebersole
Is there a syntax to "explode" a subrule result (sorry don't know a better term). I have a rule: sortSpecification : sortKey collationSpecification? orderingSpecification? -> ^( SORT_SPEC sortKey collationSpecification? orderingSpecification? ) ; The result of the sortKey subrul

[il-antlr-interest: 23473] Re: [antlr-interest] C# code generation errors

2009-05-01 Thread Gavin Lambert
At 06:32 2/05/2009, Bill Steer wrote: >INT : (DIGIT)+ ; >FLOAT : INT > | INT '.' INT > | '.' INT >; >CONSTANT: FLOAT > | FLOAT ('e' | 'E') ('+' | '-')? INT >; [...] >IDENT : LETTER (LETTER | DIGIT)* ; >REGISTER: I

[il-antlr-interest: 23472] Re: [antlr-interest] C# code generation errors

2009-05-01 Thread Johannes Luber
> Hi Bill, > > In the 'expr' rule, you have the following action that is missing a > semicolon: > {$value = $e.value} > > In the 'atom' rule, you have an action with a call to toInt32 instead of > ToInt32. > > You should add a cast to ArrayList in your action in the 'elist' rule. > > I can't r

[il-antlr-interest: 23471] Re: [antlr-interest] C# code generation errors

2009-05-01 Thread Sam Harwell
Hi Bill, In the 'expr' rule, you have the following action that is missing a semicolon: {$value = $e.value} In the 'atom' rule, you have an action with a call to toInt32 instead of ToInt32. You should add a cast to ArrayList in your action in the 'elist' rule. I can't reproduce the 'eee' error

[il-antlr-interest: 23470] [antlr-interest] C# code generation errors

2009-05-01 Thread Bill Steer
I've now found four errors in the generation of the C# code for my grammar: 1. A statement is missing a semicolon 2. A statement is missing a cast from IList to ArrayList 3. A statement contains "Convert.toInt32" instead of "Convert.ToInt32" 4. An exception variable is "eee1" but it is referenced

[il-antlr-interest: 23469] Re: [antlr-interest] Flumoxed by Javascript Target

2009-05-01 Thread Jim Idle
Hugo Leeney wrote: > I'm thinking I need to stick with http://www.antlr.org/download.html > for my purposes. If I understand correctly there are files missing > from the source distro there at the moment so a full build of that is > not currently possible but should be soon. I can go into the sepa

[il-antlr-interest: 23468] [antlr-interest] Possible gunit bug (NPE) with empty input

2009-05-01 Thread Petteri Räty
The attached grammar seems to parse fine when given empty input and calling into the parsing method but with gunit I it gives me NullPointerException. betelge...@pena ~/python/depend $ gunit Depend.testsuite --- executing testsuit

[il-antlr-interest: 23467] Re: [antlr-interest] Weird problem with semantic predicates. Incorrect warning message

2009-05-01 Thread Gavin Lambert
At 09:51 1/05/2009, Gabriel Petrovay wrote: >ANTLR could either ignore ambiguous rules (if the computed k is >t large, give up) and proceed with normal computation. >Another thing ANTLR could do is be to compute k per-rule and >not per grammar. k is already computed per-rule, or possibly

[il-antlr-interest: 23466] Re: [antlr-interest] Flumoxed by Javascript Target

2009-05-01 Thread Hugo Leeney
I'm thinking I need to stick with http://www.antlr.org/download.html for my purposes. If I understand correctly there are files missing from the source distro there at the moment so a full build of that is not currently possible but should be soon. I can go into the separate directories (tool/ run