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

2008-11-30 Thread chain one
options { output=AST; } 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[] $id2) ; vari

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

2008-11-30 Thread Gavin Lambert
At 18:56 1/12/2008, virg g wrote: >If the command is >TESTCMD CNT=2 VAL=TYPE:CNT > >It returs error "EarlyExitException" , if i change lexer rules i >get Mismatchtokenexception. But command is never successful. I >have figured out that If the literal contains any of these >keywords CNT, VAL, TY

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

2008-11-30 Thread Gavin Lambert
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, but your tree structure might dictate that at that position

[il-antlr-interest: 20762] how to stop parser on lexical error???

2008-11-30 Thread david.lygagnon
Hi I am trying to stop parsing on a lexical error, and it just doesn't want to stop. I have tried this thread : http://www.antlr.org/wiki/pages/viewpage.action?pageId=5341217 and it doesn't work. I am using antlr 3.1.1. I have also tried adding the catch rules in my grammar: @members { prote

[il-antlr-interest: 20761] Re: [antlr-interest] added pattern rewriting example

2008-11-30 Thread Terence Parr
On Nov 30, 2008, at 1:53 PM, Oliver Zeigermann wrote: > I think I understand now. > > So this would also work by repetitively traversing the tree until no > more simplificaions are possible (which would of course have a bad > performance), right? It repeatedly applies all bottomup rules while on

[il-antlr-interest: 20760] [antlr-interest] help - Parser problem

2008-11-30 Thread virg g
Hi, I have set of commands which I need to parse. This is my sample grammar file. It is able to parse if command is "TESTCMD CNT=2 VAL=TYPE:test123" If the command is TESTCMD CNT=2 VAL=TYPE:CNT It returs error "EarlyExitException" , if i change lexer rules i get Mismatchtokenexception. But comm

[il-antlr-interest: 20759] Re: [antlr-interest] ANTLR installation/use on Unix

2008-11-30 Thread Gary R. Van Sickle
> From: Jim Idle > > On Sun, 2008-11-30 at 03:06 -0600, Gary R. Van Sickle wrote: > > > > From: Jim Idle > > > > On Fri, 2008-11-28 at 21:28 -0600, Gary R. Van Sickle wrote: > > > > > > Hi Terence et al, > > > >

[il-antlr-interest: 20758] [antlr-interest] New release of ANTLR Testing

2008-11-30 Thread Jeremy Frens
ANTLR Testing is a unit testing library for ANTLR grammars using JUnit and a fluid interface. I use it on a couple of my own projects, and I have students using it as well. I released version 0.8 today. You can get it here: http://antlr-testing.sourceforge.net/ . It has some nice new features:

[il-antlr-interest: 20757] Re: [antlr-interest] added pattern rewriting example

2008-11-30 Thread Oliver Zeigermann
2008/11/30 Terence Parr <[EMAIL PROTECTED]>: > > On Nov 30, 2008, at 1:07 PM, Oliver Zeigermann wrote: > >> OK. I do not quite grok it. Looking at >> >> topdown >> : ^('*' INT ^(VEC (e+=.)+)) -> ^(VEC ^('*' INT $e)+) >> ; >> >> bottomup >> : ^('*' a=. b=INT {$b.int==0}?) -> $b // x*0 -> 0

[il-antlr-interest: 20756] Re: [antlr-interest] added pattern rewriting example

2008-11-30 Thread Terence Parr
On Nov 30, 2008, at 1:07 PM, Oliver Zeigermann wrote: > OK. I do not quite grok it. Looking at > > topdown >: ^('*' INT ^(VEC (e+=.)+)) -> ^(VEC ^('*' INT $e)+) >; > > bottomup >: ^('*' a=. b=INT {$b.int==0}?) -> $b // x*0 -> 0 >; > > Why has the second to be in bottomup? x*(

[il-antlr-interest: 20755] [antlr-interest] added pattern rewriting example

2008-11-30 Thread Terence Parr
http://www.antlr.org/wiki/display/~admin/2008/11/30/ You'll need to visit here for software: http://www.antlr.org/download/build and look for for class.* (example walker) and antlr-oliver.tar.gz for the dev branch software. Ter --~--~-~--~~~---~--~~ You receive

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

2008-11-30 Thread Oliver Zeigermann
My use case was just traversing a tree, not matter how it looks. But having ^(. ID) could mean "anything that has an ID as its first child". No idea what would be the use case, so I know where you are coming from. Maybe just add it for the sake of completeness and so that my tree rule finally w

[il-antlr-interest: 20753] Re: [antlr-interest] sneak preview of ANTLR v3.2 (book release version)

2008-11-30 Thread Terence Parr
On Nov 30, 2008, at 9:35 AM, Oliver Zeigermann wrote: > I tried this out and it actually works great :) Hooray! Should I add some rewrite examples? > I am wondering if "bottomup" is really needed, though. I only need > "topdown" as the whole structure already is encoded in the tree. So > ther

[il-antlr-interest: 20752] Re: [antlr-interest] ANTLR installation/use on Unix

2008-11-30 Thread Terence Parr
true. adding. http://www.antlr.org:/browse/ANTLR-369 Ter On Nov 30, 2008, at 12:00 PM, Gavin Lambert wrote: > At 06:55 1/12/2008, Jim Idle wrote: >> All you need is the composite jar and: >> >> #! /bin/bash >> java -jar whereverthejaris.jar $* > > Plus the knowledge that this is how you ac

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

2008-11-30 Thread Terence Parr
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? added http://www.antlr.org:/browse/ANTLR-368 Ter On Nov 30, 2008, at 1:55 AM, Oliver Zeigermann wrote: > Great. Thanks! > > Can we expect that i

[il-antlr-interest: 20750] Re: [antlr-interest] ANTLR installation/use on Unix

2008-11-30 Thread Gavin Lambert
At 06:55 1/12/2008, Jim Idle wrote: >All you need is the composite jar and: > >#! /bin/bash >java -jar whereverthejaris.jar $* Plus the knowledge that this is how you actually get it to run :) >With make install, you have to detect the java install, find the >dependencies, it only works on *nix

[il-antlr-interest: 20749] [antlr-interest] EarlyExitException when token present

2008-11-30 Thread Mihai Danila
Hi, Not sure if this is dummy level, but I can't figure out why the presence of token Date messes up the parsing. When Date is present and not a fragment, I get EarlyExitException on inputs like "123" and "123,456." My question is primarily whether this is a bug or normal behavior. I'm sure there

[il-antlr-interest: 20748] Re: [antlr-interest] ANTLR installation/use on Unix

2008-11-30 Thread Jim Idle
On Sun, 2008-11-30 at 03:06 -0600, Gary R. Van Sickle wrote: > > From: Jim Idle > > > > On Fri, 2008-11-28 at 21:28 -0600, Gary R. Van Sickle wrote: > > > > > > Hi Terence et al, > > > > Am I just getting old, or shouldn't I be able to (in a > > More Ideal World(tm), > >

[il-antlr-interest: 20747] Re: [antlr-interest] sneak preview of ANTLR v3.2 (book release version)

2008-11-30 Thread Oliver Zeigermann
I tried this out and it actually works great :) I am wondering if "bottomup" is really needed, though. I only need "topdown" as the whole structure already is encoded in the tree. So there is no need to track context for me in that way. Do you have any use case for that? Or did I get that all w

[il-antlr-interest: 20746] Re: [antlr-interest] ANTLR installation/use on Unix

2008-11-30 Thread Jared Bunting
There appears to be an antlr3 package for debian/ubuntu. http://packages.debian.org/search?keywords=antlr3 http://packages.ubuntu.com/search?keywords=antlr3 -Jared On Sat, Nov 29, 2008 at 2:25 PM, James Abley <[EMAIL PROTECTED]> wrote: > There is a package for debian / Ubuntu but it's 2.x. Mayb

[il-antlr-interest: 20745] [antlr-interest] Google groups mirror page needs updating and spellchecking

2008-11-30 Thread Hendrik Maryns
Hi, I found the antlr-interest Google Groups page. It is full of errors and typos. Who can have a look at that, or can someone grant me the right to fix it up? See http://groups.google.com/group/il-antlr-interest/about Cheers, H. -- Hendrik Maryns http://tcl.sfs.uni-tuebingen.de/~hendrik/ ===

[il-antlr-interest: 20744] Re: [antlr-interest] Unsubscribing

2008-11-30 Thread Johannes Luber
Bryan Haber schrieb: > Hi. How do I unsubscribe to this mailing list? The website isn't > working. Thanks. Supposedly that is the only way to do so. Maybe it was a fluke from when the ANTLR machine crashed. Try again

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

2008-11-30 Thread Oliver Zeigermann
Great. Thanks! Can we expect that in 3.2? Oliver 2008/11/30 Terence Parr <[EMAIL PROTECTED]>: > I agree. '.' as root should be ok. I'll have to go back and make it context > sensitive. Right now, '.' can be a subtree as well. it would mess up > analysis. > Ter > On Nov 29, 2008, at 3:23 PM,

[il-antlr-interest: 20742] Re: [antlr-interest] ANTLR installation/use on Unix

2008-11-30 Thread Gary R. Van Sickle
> From: James Abley > > There is a package for debian / Ubuntu but it's 2.x. Maybe > the maintainers could be convinced to provide an antlr3 > package a la sqlite and sqlite3? Typically they do tend to > lag behind the current releases, so you're probably just best > off downloading and confi

[il-antlr-interest: 20741] Re: [antlr-interest] ANTLR installation/use on Unix

2008-11-30 Thread Gary R. Van Sickle
> From: Jim Idle > > On Fri, 2008-11-28 at 21:28 -0600, Gary R. Van Sickle wrote: > > > Hi Terence et al, > > Am I just getting old, or shouldn't I be able to (in a > More Ideal World(tm), > of course) do something like this on a Unix-like box?: > >