[il-antlr-interest: 19807] Re: [antlr-interest] THE STEAMROLLER PROBLEM!

2008-10-02 Thread Loring Craymer
This one is easy with the ^ annotation: opRule : term ( OP^ term ( OP! term )* )? ; --Loring - Original Message > From: Randall R

[il-antlr-interest: 19811] Re: [antlr-interest] ANTLR 3.1.1 test failures

2008-10-02 Thread Hartmuth Gutsche
I just looked at the generated T.g file and that one looks like this: grammar T; options {output=AST;} s : x+=a x+=b {System.out.println($x);} ;a : 'a'; b : 'b'; WS : (' '|' ') {skip();}; Which means that the problem shows up in the generated test grammar file. Does the actual test generation h

[il-antlr-interest: 19810] Re: [antlr-interest] ANTLR 3.1.1 test failures

2008-10-02 Thread Hartmuth Gutsche
Definitely such a kind of problem. One of the cases I am looking at is the following: ... public void testRuleLabelOnTwoDifferentRulesAST() throws Exception { String grammar = "grammar T;\n"+ "options {output=AST;}\n"+ "s : x+=a x+=b {System.out.println($x);} ;" + "a : 'a';\n"+ "b : 'b';\n"+ "WS

[il-antlr-interest: 19809] Re: [antlr-interest] THE STEAMROLLER PROBLEM!

2008-10-02 Thread John B. Brodie
On Thursday 02 October 2008 09:43:44 pm Randall R Schulz wrote: > Hi, > > Sorry for shouting, but I really would like a definitive answer to this > question. ("Steamroller" referring to creating a flat AST.) > > If one is to parse an infix operator notation, exemplified by this > input: > > 1

[il-antlr-interest: 19808] Re: [antlr-interest] your Or ast question

2008-10-02 Thread John B. Brodie
On Thursday 02 October 2008 09:34:11 pm Randall R Schulz wrote: > On Thursday 02 October 2008 17:54, you wrote: > > Mr. Schulz :- > > I'm sorry. My father isn't here right now... I happen to believe that everyone deserves respect... > > Sorry for this disconnected reply to your last message to m

[il-antlr-interest: 19806] [antlr-interest] THE STEAMROLLER PROBLEM!

2008-10-02 Thread Randall R Schulz
Hi, Sorry for shouting, but I really would like a definitive answer to this question. ("Steamroller" referring to creating a flat AST.) If one is to parse an infix operator notation, exemplified by this input: 1 OP 2 OP 3 OP 4 OP 5 and produce from it this AST: (OP 1 2 3 4 5)

[il-antlr-interest: 19805] Re: [antlr-interest] your Or ast question

2008-10-02 Thread Randall R Schulz
On Thursday 02 October 2008 17:54, you wrote: > Mr. Schulz :- I'm sorry. My father isn't here right now... > Sorry for this disconnected reply to your last message to me. It's OK. I hope you don't mind my sending the reply back to the list. I'm surprised this seems so difficult (not yet conce

[il-antlr-interest: 19804] [antlr-interest] ANTLRWorks Glitch Exporting Bitmaps

2008-10-02 Thread Randall R Schulz
Hi, I've noticed that if I've reduced the scale of parse tree or AST depiction using the the scale / zoom slider and export an image, it is improperly clipped. Specifically, the bounding box of the exported image is too small and portions at the lower and right edge are lost. It doesn't happe

[il-antlr-interest: 19803] Re: [antlr-interest] Rewriting to Flat Tree Nodes for Associative Multiary Operators

2008-10-02 Thread Randall R Schulz
On Thursday 02 October 2008 16:15, you wrote: > ... > > yes the second (non-recursion form) acts as you report > > > however the former, recursive, form generates (for me) > > (Or p (Or q (Or r s))) > > for your input string. I can't remember anymore, is that what you > wanted? Nope. I can get th

[il-antlr-interest: 19802] Re: [antlr-interest] Rewriting to Flat Tree Nodes for Associative Multiary Operators

2008-10-02 Thread Randall R Schulz
On Thursday 02 October 2008 15:23, Jim Idle wrote: > On Thu, 2008-10-02 at 15:01 -0700, Randall R Schulz wrote: > > On Thursday 02 October 2008 14:29, Jim Idle wrote: > > > Have you tried: > > > > > > > > > o : v1=nextrule > > > ( > > > (Or v2+=nextrule )+ ->^(OR $v1 $v2+)

[il-antlr-interest: 19800] Re: [antlr-interest] Rewriting to Flat Tree Nodes for Associative Multiary Operators

2008-10-02 Thread Randall R Schulz
On Thursday 02 October 2008 14:29, Jim Idle wrote: > On Thu, 2008-10-02 at 14:23 -0700, Randall R Schulz wrote: > > Hi, > > > > Next question. > > > > (I've been spoiled by working mostly with strictly prefix languages > > in the past...) > > > > > > How might I alter a rule such as this one: > >

[il-antlr-interest: 19801] Re: [antlr-interest] Rewritin g to Flat Tree Nodes for Associative Multiary Operators

2008-10-02 Thread Jim Idle
On Thu, 2008-10-02 at 15:01 -0700, Randall R Schulz wrote: > On Thursday 02 October 2008 14:29, Jim Idle wrote: > > Have you tried: > > > > > > o : v1=nextrule > > ( > > (Or v2+=nextrule )+ ->^(OR $v1 $v2+) > > > > | // No OR's, default tree > > > >

[il-antlr-interest: 19799] Re: [antlr-interest] Rewriting to Flat Tree Nodes for Associative Multiary Operators

2008-10-02 Thread John B. Brodie
Greetings! On Thursday 02 October 2008 05:23:09 pm Randall R Schulz wrote: > How might I alter a rule such as this one: > > op790Formula >     :   (op780Formula -> op780Formula) >         ( >             Or rDisjunct = op790Formula >         ->  ^(Or $op790Formula $rDisjunct) >         ) ? >    

[il-antlr-interest: 19798] Re: [antlr-interest] Rewriting to Flat Tree Nodes for Associative Multiary Operators

2008-10-02 Thread Randall R Schulz
On Thursday 02 October 2008 15:01, Randall R Schulz wrote: > ... > > Whether you include an empty alternative (as you showed) or make the > entire sub-rule optional, as I'd tried earlier: > > op790FormulaFlat > : (op780FormulaFlat -> op780FormulaFlat) > ( Or rDisjuncts = op790Formula

[il-antlr-interest: 19797] Re: [antlr-interest] Rewritin g to Flat Tree Nodes for Associative Multiary Operators

2008-10-02 Thread Jim Idle
On Thu, 2008-10-02 at 14:48 -0700, Randall R Schulz wrote: > On Thursday 02 October 2008 14:33, Jim Idle wrote: > > ... > > > > I should add that this won't be as useful a tree for processing > > unless this is a translator and you want to spit this stuff out in > > that kind of arrangement. > > >

[il-antlr-interest: 19796] Re: [antlr-interest] Rewriting t o Flat Tree Nodes for Associative Multiary Operators

2008-10-02 Thread Randall R Schulz
On Thursday 02 October 2008 14:33, Jim Idle wrote: > ... > > I should add that this won't be as useful a tree for processing > unless this is a translator and you want to spit this stuff out in > that kind of arrangement. > > Jim Well, in fact I am just writing a transliterator, and since AND and

[il-antlr-interest: 19793] [antlr-interest] Rewriting to Flat Tree Nodes for Associative Multiary Operators

2008-10-02 Thread Randall R Schulz
Hi, Next question. (I've been spoiled by working mostly with strictly prefix languages in the past...) How might I alter a rule such as this one: op790Formula : (op780Formula -> op780Formula) ( Or rDisjunct = op790Formula -> ^(Or $op790Formula $rDisjunct)

[il-antlr-interest: 19794] Re: [antlr-interest] Rewritin g to Flat Tree Nodes for Associative Multiary Operators

2008-10-02 Thread Jim Idle
On Thu, 2008-10-02 at 14:23 -0700, Randall R Schulz wrote: > Hi, > > Next question. > > (I've been spoiled by working mostly with strictly prefix languages in > the past...) > > > How might I alter a rule such as this one: > > op790Formula > : (op780Formula -> op780Formula) > (

[il-antlr-interest: 19792] Re: [antlr-interest] Rewriting Repeatable Prefix Operators To Nested AST Structure

2008-10-02 Thread Randall R Schulz
On Thursday 02 October 2008 12:31, Jim Idle wrote: > On Thu, 2008-10-02 at 12:24 -0700, Randall R Schulz wrote: > > Hi, > > > > I have a couple of productions that use a prefix operator that may > > be repeated arbitrarily. One of them (negation) just has the > > operator symbol. The other has a k

[il-antlr-interest: 19790] Re: [antlr-interest] Rewritin g Repeatable Prefix Operators To Nested AST Structure

2008-10-02 Thread Jim Idle
On Thu, 2008-10-02 at 12:24 -0700, Randall R Schulz wrote: > Hi, > > I have a couple of productions that use a prefix operator that may be > repeated arbitrarily. One of them (negation) just has the operator > symbol. The other has a keyword (two different keywords, actually) > followed by an ide

[il-antlr-interest: 19791] Re: [antlr-interest] Rewriting Repeatable Prefix Operators To Nested AST Structure

2008-10-02 Thread Gavin Lambert
At 08:24 3/10/2008, Randall R Schulz wrote: >op350Formula >: ( >Not -> ^(Not $op350Formula) >) * >(primitiveFormula -> primitiveFormula) >; The reason why you're getting the RewriteEmptyStreamException there is that on the first pass through you're tr

[il-antlr-interest: 19789] [antlr-interest] Rewriting Repeatable Prefix Operators To Nested AST Structure

2008-10-02 Thread Randall R Schulz
Hi, I have a couple of productions that use a prefix operator that may be repeated arbitrarily. One of them (negation) just has the operator symbol. The other has a keyword (two different keywords, actually) followed by an identifier. For example, with the negation operator, this: ---p

[il-antlr-interest: 19788] Re: [antlr-interest] ANTLR 3.1.1 test failures

2008-10-02 Thread Terence Parr
On Oct 2, 2008, at 11:02 AM, Hartmuth Gutsche wrote: > I am trying to run the tests under “org.antlr.test” and get 503 > failures > out of 1095 tests. Are they supposed to pass without failure? > > I see this in two different Windows environments. Mostly likely \n and \r issue. T List: http

[il-antlr-interest: 19787] [antlr-interest] ANTLR 3.1.1 test failures

2008-10-02 Thread Hartmuth Gutsche
I am trying to run the tests under “org.antlr.test” and get 503 failures out of 1095 tests. Are they supposed to pass without failure? I see this in two different Windows environments. Thanks! Hartmuth List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest Unsubscribe: http://

[il-antlr-interest: 19786] Re: [antlr-interest] ANTLR v3.1.1 released

2008-10-02 Thread Randall R Schulz
On Thursday 02 October 2008 10:06, Randall R Schulz wrote: > On Thursday 02 October 2008 09:57, Terence Parr wrote: > > On Oct 2, 2008, at 7:08 AM, Randall R Schulz wrote: > > > On Thursday 02 October 2008 06:48, Randall R Schulz wrote: > > >> On Wednesday 01 October 2008 14:36, Terence Parr wrote

[il-antlr-interest: 19784] Re: [antlr-interest] ANTLR v3.1.1 released

2008-10-02 Thread Terence Parr
On Oct 2, 2008, at 7:08 AM, Randall R Schulz wrote: > On Thursday 02 October 2008 06:48, Randall R Schulz wrote: >> On Wednesday 01 October 2008 14:36, Terence Parr wrote: >>> 3.1.1 released: >> >> I'm starting a new parser and upgraded (to 3.1, yesterday and then to >> 3.1.1, later yesterday...

[il-antlr-interest: 19785] Re: [antlr-interest] ANTLR v3.1.1 released

2008-10-02 Thread Randall R Schulz
On Thursday 02 October 2008 09:57, Terence Parr wrote: > On Oct 2, 2008, at 7:08 AM, Randall R Schulz wrote: > > On Thursday 02 October 2008 06:48, Randall R Schulz wrote: > >> On Wednesday 01 October 2008 14:36, Terence Parr wrote: > >>> 3.1.1 released: > >> > >> I'm starting a new parser and upg

[il-antlr-interest: 19783] FREE Home Based Online Job Offer for Indians 4

2008-10-02 Thread [EMAIL PROTECTED]
FREE Home Based Online Job Offer for Indians Dear Friend, Do you want to earn extra income in your spare time working from home? To Join Click the link below 1. http://bestways-makemoneyonline.50webs.com/   <<>>   2. http://bestways-makemoneyonline.50webs.com/earn

[il-antlr-interest: 19782] Re: [antlr-interest] ANTLR v3.1.1 released

2008-10-02 Thread Randall R Schulz
On Thursday 02 October 2008 06:48, Randall R Schulz wrote: > On Wednesday 01 October 2008 14:36, Terence Parr wrote: > > 3.1.1 released: > > I'm starting a new parser and upgraded (to 3.1, yesterday and then to > 3.1.1, later yesterday...). Anyway, I was wondering if the ANTLR > command-line inter

[il-antlr-interest: 19781] Re: [antlr-interest] ANTLR v3.1.1 released

2008-10-02 Thread Randall R Schulz
On Wednesday 01 October 2008 14:36, Terence Parr wrote: > 3.1.1 released: I'm starting a new parser and upgraded (to 3.1, yesterday and then to 3.1.1, later yesterday...). Anyway, I was wondering if the ANTLR command-line interface (org.antlr.Tool#main(), i.e.) gives a non-zero exit code when

[il-antlr-interest: 19780] Re: [antlr-interest] Avoiding ClassCastExceptions in org.antlr.runtime.tree.BaseTree (Limitation in ANTLR v 3.1)

2008-10-02 Thread Tim Halloran
3.1.1 didn't fix the below problem. I can't get into Jira; but I think the below is really a bug. On Wed, Sep 24, 2008 at 2:03 PM, Tim Halloran <[EMAIL PROTECTED]> wrote: > I'm using the standard Tree implementations (extending BaseTree) in > combination with a custom implementation of Tree. Th