[il-antlr-interest: 20766] Re: [antlr-interest] The problem of return struct

2008-12-01 Thread Gavin Lambert
At 20:47 1/12/2008, chain one wrote: >entity_id returns [String eid] >@init{ eid=null; } > : { isFirst }? id=IDENT { eid=id.getText(); > /*addId(eid,ENTITY_IDENT);*/ }-> ^(ENTITY_ID[] $id) > | id2=ENTITY_IDENT { > eid=id2.getText();$id2.setType(IDENT);} -> ^(ENTITY_IDENT[] $id

[il-antlr-interest: 20767] Re: [antlr-interest] help - Parser problem

2008-12-01 Thread Jim Idle
On Mon, 2008-12-01 at 20:30 +1300, Gavin Lambert wrote: > At 18:56 1/12/2008, virg g wrote: > >If the command is > Step 3: notice how your 'literal' rule doesn't mention any of the > other literal tokens mentioned in step 1, so it's not surprising > that it doesn't match them. > > Step 4: re

[il-antlr-interest: 20768] Re: [antlr-interest] wildcard in tree grammar

2008-12-01 Thread Terence Parr
On Nov 30, 2008, at 11:15 PM, Gavin Lambert wrote: > At 09:29 1/12/2008, Terence Parr wrote: > >not sure. I guess i left out as it's weird. When would you write: > > > >^(. ID). It's always the root that says what kind of thing it is, > > > >right? > > This is a completely fabricated example,

[il-antlr-interest: 20769] Re: [antlr-interest] wildcard in tree grammar

2008-12-01 Thread Sam Harwell
Here's a fictional example of why you might want to distinguish "any node or tree" from "any node" in a tree parser. Input: (3)+(2) Resulting Tree: ^(+ ^(expr 3) ^(expr 2)) Goal: pattern rewrite in a filter tree parser to remove some nodes resulting from unnecessary parentheses. Pattern: remove

[il-antlr-interest: 20770] Re: [antlr-interest] wildcard in tree grammar

2008-12-01 Thread Oliver Zeigermann
2008/12/1 Terence Parr <[EMAIL PROTECTED]>: > > On Nov 30, 2008, at 11:15 PM, Gavin Lambert wrote: >> >> And then of course there's Oliver's example, where he just wanted to >> traverse the (sub)tree regardless of structure (presumably to pretty-print >> it or something). > > If you don't care abo

[il-antlr-interest: 20771] Re: [antlr-interest] wildcard in tree grammar

2008-12-01 Thread Terence Parr
On Dec 1, 2008, at 10:16 AM, Oliver Zeigermann wrote: > 2008/12/1 Terence Parr <[EMAIL PROTECTED]>: >> >> On Nov 30, 2008, at 11:15 PM, Gavin Lambert wrote: >>> >>> And then of course there's Oliver's example, where he just wanted to >>> traverse the (sub)tree regardless of structure (presumably

[il-antlr-interest: 20772] Re: [antlr-interest] wildcard in tree grammar

2008-12-01 Thread Terence Parr
On Dec 1, 2008, at 9:57 AM, Sam Harwell wrote: > Here's a fictional example of why you might want to distinguish "any > node or tree" from "any node" in a tree parser. > > Input: (3)+(2) > Resulting Tree: ^(+ ^(expr 3) ^(expr 2)) > Goal: pattern rewrite in a filter tree parser to remove some nod

[il-antlr-interest: 20773] Re: [antlr-interest] wildcard in tree grammar

2008-12-01 Thread Gavin Lambert
At 05:43 2/12/2008, Terence Parr wrote: >'.' is great to avoid a subtree or any random operand node >you don't care about. As a root, it can only be a node so >it's pretty easy to give the set of valid roots if necessary. "Easy" is a relative term, depending on how many of them there are :)

[il-antlr-interest: 20774] Re: [antlr-interest] wildcard in tree grammar

2008-12-01 Thread Terence Parr
On Dec 1, 2008, at 11:51 AM, Gavin Lambert wrote: > If ID on its own can match a tree of ^(FOO ID), then that's a bug. not in a tree pattern matching (filter=true) mode. >> If you don't care about structure, one could argue why you're > using >> a grammar to do that ;) > > You might not care *s

[il-antlr-interest: 20775] [antlr-interest] Sorry, o ne more try, now with more information…

2008-12-01 Thread Philip Mötteli
Hi, I'm a complete newbie to ANTLR and so I thought to start with the simple 'Expression Evaluator Tutorial'. I downloaded the most recent version of ANTLRworks for Mac OS X (I run the most recent version 10.5.5), pasted the grammar into the editor, picked 'prog', entered '2+3*4' and pre

[il-antlr-interest: 20776] Re: [antlr-interest] Sorr y, one more try, now with more information…

2008-12-01 Thread Terence Parr
Hi. that error is what happens when you do what exactly? You must say "debug" to get the dialog up to enter info. The debugger pane is for seeing what the lexer is emitting; it's not an input pane. though it is confusing. Interpreter was just warning you that it can't handle those things..

[il-antlr-interest: 20777] [antlr-interest] Help converting a parser grammar to a tree grammar

2008-12-01 Thread Diligent Warrior
Hello everyone, I'm working on a grammar for a Java-like language and I'm stuck at this one part. I'm looking to write the tree grammar from this parser grammar: callExpression :(primary -> primary) (s=selector -> ^(CALL $callExpression $s))* ; The code would look like: nodeObject.g

[il-antlr-interest: 20778] Re: [antlr-interest] Help converting a parser grammar to a tree grammar

2008-12-01 Thread Jim Idle
On Tue, 2008-12-02 at 00:27 +, Diligent Warrior wrote: > Hello everyone, > > I'm working on a grammar for a Java-like language and I'm stuck at > this one part. I'm looking to write the tree grammar from this parser > grammar: > > callExpression > :(primary -> primary) (s=selector ->

[il-antlr-interest: 20779] Re: [antlr-interest] Sorr y, one more try, now with more information…

2008-12-01 Thread Jean Bovet
There is indeed a problem in ANTLRWorks. This will be fixed for the next release. In the meantime, you can use the following workaround: save the project to the disk and it will work fine. Regards, Jean On Dec 1, 2008, at 2:46 PM, Philip Mötteli wrote: > Hi, > > > I'm a complete newbie to

[il-antlr-interest: 20780] [antlr-interest] C runtime const correctness

2008-12-01 Thread Gary R. Van Sickle
Shouldn't this: ANTLR3_API pANTLR3_INPUT_STREAM antlr3AsciiFileStreamNew(pANTLR3_UINT8 fileName); Really be this: ANTLR3_API pANTLR3_INPUT_STREAM antlr3AsciiFileStreamNew(const pANTLR3_UINT8 fileName); ? -- Gary R. Van Sickle List: http://www.antlr.org:8080/mailman/listinfo/antlr-i