[il-antlr-interest: 21461] [antlr-interest] ANTLRWorks output path errors

2009-01-20 Thread Gavin Lambert
I recently tried using ANTLRWorks 1.2.2 (previously I was using 1.1.7), but I'm getting errors whenever I tell it to generate the code (I'm using Windows): Check Grammar reported some errors: (5): directory not found: D:\Programming\antlr\tests\D:\Programming\antlr\AntlrWorks Consult the conso

[il-antlr-interest: 21460] Re: [antlr-interest] ANTLR Questions

2009-01-20 Thread Johannes Luber
Bruno Marc-Aurele schrieb: > Hello everyone, > > I am currently working on a project where I need to translate files (mainly > code) from one technology to another. I already have a LL(*) grammar for the > source language and I am considering rewriting this grammar using ANTLR to > benefit from C

[il-antlr-interest: 21459] Re: [antlr-interest] C target, C grammar + AST = missing *_SymbolsPop()

2009-01-20 Thread Gary R. Van Sickle
[] > > $ antlr C.g ## or however you invoke ANTLR, this is my > shell script > > that does "java org.antlr.Tool C.g" > > $ gcc -I. CParser.c CLexer.c main.c -lantlr3c > > > > I get this: > > > > "/cygdrive/c/DOCUME~1/GaryV/LOCALS~1/Temp/ccwDPkR8.o:CParser.c > :(.text+0xbc2c > > ): undefined

[il-antlr-interest: 21458] Re: [antlr-interest] C target, C grammar + AST = missing *_SymbolsPop()

2009-01-20 Thread Gary R. Van Sickle
> > Doesn't for me. Can you submit your grammar or is this completely > > unchanged from the example? > > > > The above was from marginally changed grammar, but I can > replicate it by simply adding > > " output = AST; > ASTLabelType = pANTLR3_BASE_TREE;" > > to the options of the b

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

2009-01-20 Thread Sam Harwell
I've mentioned this behavior several times before. Currently, despite the error, the Tool does behave in the way it states (it references the enclosing rule). I assure you there is no syntactic or semantic ambiguity in this use case under the documented rules of an ANTLR grammar's rewrite syntax.

[il-antlr-interest: 21456] [antlr-interest] ANTLR Questions

2009-01-20 Thread Bruno Marc-Aurele
Hello everyone, I am currently working on a project where I need to translate files (mainly code) from one technology to another. I already have a LL(*) grammar for the source language and I am considering rewriting this grammar using ANTLR to benefit from C# generation target. I have used JavaC

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

2009-01-20 Thread Terence Parr
On Jan 20, 2009, at 5:32 PM, Randall R Schulz wrote: > On Tuesday January 20 2009, you wrote: >> interesting...so this should be a warning then? I'm not sure which >> is correct. It is most likely an error; I wouldn't rely on which it >> chooses. > > But it explicitly said that it chose the en

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

2009-01-20 Thread Randall R Schulz
On Tuesday January 20 2009, you wrote: > interesting...so this should be a warning then? I'm not sure which > is correct. It is most likely an error; I wouldn't rely on which it > chooses. But it explicitly said that it chose the enclosing rule. If that's not what it's (reliably) going to do,

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

2009-01-20 Thread Terence Parr
interesting...so this should be a warning then? I'm not sure which is correct. It is most likely an error; I wouldn't rely on which it chooses. Ter On Oct 2, 2008, at 10:25 AM, Randall R Schulz wrote: > On Thursday 02 October 2008 10:06, Randall R Schulz wrote: >> On Thursday 02 October 200

[il-antlr-interest: 21452] Re: [antlr-interest] Error co mpiling generated C code (possibly 32/64 bit conflict?)

2009-01-20 Thread Andy Grove
Ah. That makes sense. Thank you for your help - we will fix up our tokens as you suggest and give this another go. Thanks, Andy. On Jan 20, 2009, at 3:08 PM, Jim Idle wrote: > Andy Grove wrote: >> >> Jim, >> >> Thanks for the prompt response. Yes, I did run "make install" and >> the antlr3

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

2009-01-20 Thread Sam Harwell
I already fixed some of these in the C# port. Some other ones are: BaseTree.sanityCheckParentAndChildIndexes: this could almost be a static utility method. It doesn't rely on any special features of BaseTree, but it's not part of the Tree interface. BaseTree.replaceChildren: assumes t is a BaseT

[il-antlr-interest: 21450] Re: [antlr-interest] Import problems with Antlr 3.1.1 - Whitespace

2009-01-20 Thread Terence Parr
Hi Joe...seems to work okay for me... thanks for the detailed and simple bug report.Are you still having a problem? ~/tmp/antlrworks $ cat test.g grammar test; import testlexer; version_info : VERSION VERSION_IDENTIFIER SEMICOLON ; ~/tmp/antlrworks $ cat testlexer.g lexer grammar testlexer; VER

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

2009-01-20 Thread Terence Parr
Cool. done. fixed in my development branch. I changed one of the method also. Ter On Oct 2, 2008, at 6:26 AM, Tim Halloran wrote: > 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 > wrote

[il-antlr-interest: 21448] Re: [antlr-interest] Where is mismatchRecover() in the Java target?

2009-01-20 Thread Terence Parr
Updated the doc: http://www.antlr.org/wiki/display/ANTLR3/Error+reporting+and+recovery Ter On Jan 20, 2009, at 1:59 PM, Terence Parr wrote: > Ooops...things got changed. I updated comments and removed the unused > mismatch method. please override recoverFromMismatchedToken() as I do > here in t

[il-antlr-interest: 21447] Re: [antlr-interest] Error co mpiling generated C code (possibly 32/64 bit conflict?)

2009-01-20 Thread Jim Idle
Andy Grove wrote: > Jim, > > Thanks for the prompt response. Yes, I did run "make install" and the > antlr3 header files are in /usr/local/include. I get different errors > if I remove those headers so the header files are being discovered. > > I am using this syntax to call the compiler: > > g+

[il-antlr-interest: 21446] Re: [antlr-interest] Error co mpiling generated C code (possibly 32/64 bit conflict?)

2009-01-20 Thread Jim Idle
Andy Grove wrote: Jim, Thanks for the prompt response. Yes, I did run "make install" and the antlr3 header files are in /usr/local/include. I get different errors if I remove those headers so the header files are being discovered. I am using this syntax to call the compiler: g++ -I$ANT

[il-antlr-interest: 21445] Re: [antlr-interest] Where is mismatchRecover() in the Java target?

2009-01-20 Thread Terence Parr
Ooops...things got changed. I updated comments and removed the unused mismatch method. please override recoverFromMismatchedToken() as I do here in the tree parser: protected Object recoverFromMismatchedToken(IntStream input, int ttype,

[il-antlr-interest: 21444] Re: [antlr-interest] Error compiling generated C code (possibly 32/64 bit conflict?)

2009-01-20 Thread Andy Grove
Jim, Thanks for the prompt response. Yes, I did run "make install" and the antlr3 header files are in /usr/local/include. I get different errors if I remove those headers so the header files are being discovered. I am using this syntax to call the compiler: g++ -I$ANTLR_INCLUDE_PATH -O0 -g3 -Wal

[il-antlr-interest: 21443] Re: [antlr-interest] partial re-write rules

2009-01-20 Thread Jim Idle
Gavin Lambert wrote: > At 09:16 21/01/2009, Robert Soule wrote: > >blockOrLiteral : > > ('{') => curly ';'? stmt* // This is the trouble > > |// some other choices; > > > >Here, if the ';' exists, I want to create one node, but if not, > I > >want to create a different

[il-antlr-interest: 21442] Re: [antlr-interest] Proposal to make writing language targets a biteasier

2009-01-20 Thread Terence Parr
On Jan 19, 2009, at 7:21 PM, Sidharth Kuruvila wrote: > > It should be enough to add your Target's java directory to the > classpath. So you don't need to physically put the code into the > antlr source. Yep, to add a new target, all you have to do is define the directory of templates an

[il-antlr-interest: 21441] Re: [antlr-interest] Error compiling generated C code (possibly 32/64 bit conflict?)

2009-01-20 Thread Jim Idle
Andy Grove wrote: > Hi, > > I installed the ANTLR C runtime (version 3.1.1) and compiled it from > source successfully on Fedora 10 x86_64 (using the --enable-64bit > configuration option). > > I also generated C code successfully from my grammar. > > However, when I attempt to compile the gen

[il-antlr-interest: 21440] Re: [antlr-interest] adding "version" option to ANTLR grammars

2009-01-20 Thread Terence Parr
Reasonable thoughts. I'm adding a note. Ter On Jan 20, 2009, at 5:12 AM, Johannes Luber wrote: > >>> From: Johannes Luber >>> Another improvement would be to allow a comma-separated list. >>> With it one can record all versions of ANTLR, with which the >>> grammar works without any modifications

[il-antlr-interest: 21439] [antlr-interest] www.antlr.org (ANTLR website) down?

2009-01-20 Thread Doucette, Charles
C:\Documents and Settings\cdoucette>nslookup www.antlr.org Server: vmtbosmail01.vmtboston.vaultus.com Address: 10.52.0.31 Non-authoritative answer: Name:www.antlr.org Address: 138.202.170.10 C:\Documents and Settings\cdoucette>telnet www.antlr.org 80 Connecting To www.antlr.org...Could n

[il-antlr-interest: 21438] [antlr-interest] Error compiling generated C code (possibly 32/64 bit conflict?)

2009-01-20 Thread Andy Grove
Hi, I installed the ANTLR C runtime (version 3.1.1) and compiled it from source successfully on Fedora 10 x86_64 (using the --enable-64bit configuration option). I also generated C code successfully from my grammar. However, when I attempt to compile the generated code I get a lot of type

[il-antlr-interest: 21437] Re: [antlr-interest] partial re-write rules

2009-01-20 Thread Gavin Lambert
At 09:16 21/01/2009, Robert Soule wrote: >blockOrLiteral : > ('{') => curly ';'? stmt* // This is the trouble > |// some other choices; > >Here, if the ';' exists, I want to create one node, but if not, I >want to create a different node. I can write this as: > > (

[il-antlr-interest: 21436] [antlr-interest] partial re-write rules

2009-01-20 Thread Robert Soule
Hi, I am trying to use re-write rules to build an AST. In one part of my grammar, I would like to produce a different AST node depending on if there is a ';' literal or not. curly : '{' blockOrLiteral '}' -> ^(CURLY blockOrLiteral); blockOrLiteral : ('{') => curly ';'? stmt* //

[il-antlr-interest: 21435] Re: [antlr-interest] [C target] [3.1.1] Memory consumption goes through the roof with rewrite rules

2009-01-20 Thread Gavin Lambert
At 05:03 21/01/2009, Sam Harwell wrote: >I've seen some cases where the lexer will emit a 0-length token and >not proceed. This creates empty tokens until the system runs out of >memory. I'm not familiar with the C target's internals, so maybe >someone else can direct you to the correct fu

[il-antlr-interest: 21434] Re: [antlr-interest] [C targe t] [3.1.1] Memory consumption goes through the roof with rewri te rules

2009-01-20 Thread Jim Idle
Sven Van Echelpoel wrote: Yes, this is fixed (or should be) in the current source code snapshot. Perhaps it isn't and that is why the other poster was creating so many tree nodes. That's why I wanted to seen an example. Changing dupTree isn't the answer it is higher of the chain where dupTree

[il-antlr-interest: 21433] Re: [antlr-interest] C target, C grammar + AST = missing *_SymbolsPop()

2009-01-20 Thread Jim Idle
Gary R. Van Sickle wrote: > Hi guys, > > I'm trying to make the C grammar in examples-v3 generate an AST, but for > some reason it appears to not be generating ScopePop()'s for the dynamic > scopes; for every dynamic scope, I get an error like the following: > > "ss9_combined_lexer_parserParser.cp

[il-antlr-interest: 21432] Re: [antlr-interest] [C targe t] [3.1.1] Memory consumption goes throughthe roof with rewrit e rules

2009-01-20 Thread Sam Harwell
I've seen some cases where the lexer will emit a 0-length token and not proceed. This creates empty tokens until the system runs out of memory. I'm not familiar with the C target's internals, so maybe someone else can direct you to the correct function to watch for this behavior? Now I wish I sav

[il-antlr-interest: 21431] [antlr-interest] Where is mismatchRecover() in the Java target?

2009-01-20 Thread Dennis Benzinger
Hi! The API documentation for BaseRecognizer says that in order to turn off single token insertion or deletion recovery I need to override mismatchRecover() . But didn't find any

[il-antlr-interest: 21430] [antlr-interest] [C target] [ 3.1.1] Memory consumption goes through the roof with rewrite r ules

2009-01-20 Thread Sven Van Echelpoel
Hi, after passing a piece of non-trivial source code through the parser of the language we created, memory consumption went through the roof (it immediately consumed the full 3GB of memory on my 64 bit Ubuntu box) and this for a source file of a measly 14K characters. Using a debugger and a profi

[il-antlr-interest: 21429] Re: [antlr-interest] adding "version" option to ANTLR grammars

2009-01-20 Thread Johannes Luber
> > From: Johannes Luber > > Another improvement would be to allow a comma-separated list. > > With it one can record all versions of ANTLR, with which the > > grammar works without any modifications. > > The trouble with that is that it forces the user to predict the future. > Maybe it will

[il-antlr-interest: 21428] Re: [antlr-interest] adding "version" option to ANTLR grammars

2009-01-20 Thread Gary R. Van Sickle
> From: Johannes Luber > > > At 22:27 20/01/2009, Johannes Luber wrote: > > >> > options { > > >> > language = ...; > > >> > version = "3.1.1"; > > >> > } > > > > > >I just thought about an improvement: ANTLR should warn > the user, if > > >the version isn't identical to the

[il-antlr-interest: 21427] Re: [antlr-interest] adding "version" option to ANTLR grammars

2009-01-20 Thread Johannes Luber
> At 22:27 20/01/2009, Johannes Luber wrote: > >> > options { > >> > language = ...; > >> > version = "3.1.1"; > >> > } > > > >I just thought about an improvement: ANTLR should warn the user, > if > >the version isn't identical to the one of the tool. That way > people >

[il-antlr-interest: 21426] [antlr-interest] C target, C grammar + AST = missing *_SymbolsPop()

2009-01-20 Thread Gary R. Van Sickle
Hi guys, I'm trying to make the C grammar in examples-v3 generate an AST, but for some reason it appears to not be generating ScopePop()'s for the dynamic scopes; for every dynamic scope, I get an error like the following: "ss9_combined_lexer_parserParser.cpp: In function `ss9_combined_lexer_par

[il-antlr-interest: 21425] Re: [antlr-interest] grammar highlighting in Netbeans

2009-01-20 Thread Egor Ushakov
According to: http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=1 They released version 0.2 with: - Code completion - Hyperlink - Mark Occurrences - Navigator for tokens - Improved accuracy I have just tried it and despite some bugs it is wonderful! "Must have" if

[il-antlr-interest: 21424] Re: [antlr-interest] adding "version" option to ANTLR grammars

2009-01-20 Thread Gavin Lambert
At 22:27 20/01/2009, Johannes Luber wrote: >> > options { >> > language = ...; >> > version = "3.1.1"; >> > } > >I just thought about an improvement: ANTLR should warn the user, if >the version isn't identical to the one of the tool. That way people >not only see a potential issue, b

[il-antlr-interest: 21423] Re: [antlr-interest] Handling 'finally' in language target that doesn't have 'finally'

2009-01-20 Thread Gavin Lambert
At 09:27 20/01/2009, Sam Harwell wrote: >For the sake of creating an ANTLR target (I think that's >the real goal?), you have a few options. If you simply >want to disallow finally code in the grammar when the >C++ target is used, make the template for finally code >spit out the following if t

[il-antlr-interest: 21422] Re: [antlr-interest] adding "version" option to ANTLR grammars

2009-01-20 Thread Johannes Luber
> > That is an interesting idea. I am cc'ing the interest list. sorry for > > the long delay. > > > > I take it that you are suggesting the following > > > > grammar T; > > options { > > language = ...; > > version = "3.1.1"; > > } > > I do. > > Johannes I just thought about an imp

[il-antlr-interest: 21421] Re: [antlr-interest] adding "version" option to ANTLR grammars

2009-01-20 Thread Johannes Luber
> That is an interesting idea. I am cc'ing the interest list. sorry for > the long delay. > > I take it that you are suggesting the following > > grammar T; > options { > language = ...; > version = "3.1.1"; > } I do. Johannes > > Ter > On Nov 29, 2008, at 1:42 PM, Johannes Lub