[il-antlr-interest: 33479] Re: [antlr-interest] Have I found an Antlr CSharp3 lexer bug if...

2011-08-04 Thread chris king
Sam, while trying build my pre-processor with a mixed parser/lexer I ran across what I think might be a bug. I reduced the repro below. I expected the program below to accept "/**/ " but instead fails because the lexer prediction enters PP_SKIPPED_CHARACTERS. That rule has a gated semantic predicat

[il-antlr-interest: 33480] Re: [antlr-interest] Exception when generating tree grammar

2011-08-04 Thread Stephen Tuttlebee
Hi Luigi, At first I was thinking, why the heck are you getting an error about a missing StringTemplate file when you have an AST as your output (output=AST). Then I looked more closely at the name of the .st file -- rewriteWildcardLabelRefRoot.st. I think ANTLR sometimes throws these slightly

[il-antlr-interest: 33481] Re: [antlr-interest] Are the Eclipse ANTLR plugins stable?

2011-08-04 Thread Stephen Tuttlebee
By 'stable', do you mean, 'it's not updated very often', or 'there are not many bugs'? I'm guessing you meant the former. Also, what exactly do you mean by an 'ANTLR appliance'? I've used ANTLR IDE, and found it to be very good. I much prefer it to ANTLRWorks. (Although I do still use ANTLRWork'

[il-antlr-interest: 33482] Re: [antlr-interest] Exception when generating tree grammar

2011-08-04 Thread Luigi Iannone
Hi, unfortunately the removal of the whitespace does not solve it. I get the same error. Cheers, Luigi On 4 Aug 2011, at 14:02, Stephen Tuttlebee wrote: > Hi Luigi, > > At first I was thinking, why the heck are you getting an error about a > missing StringTemplate file when you have an AST a

[il-antlr-interest: 33483] Re: [antlr-interest] Have I found an Antlr CSharp3 lexer bug if...

2011-08-04 Thread Sam Harwell
Hi Chris, I'm using the released version 3.4.0 of the ANTLR CSharp3 target. I copy/pasted the grammar below (aside from renaming it to Preprocessor) and it passed the following unit test. [TestMethod] public void TestEmptyComment() { string inputText = "/**/"; var input = new AN

[il-antlr-interest: 33484] Re: [antlr-interest] Exception when generating tree grammar

2011-08-04 Thread Stephen Tuttlebee
Well, to refresh my memory on this term rewriting stuff you're doing, I looked at Terence Parr's Language Implementation Patterns book which has a section about this (if you have the book, it's p138 in the pdf edition). I think then it might be your tree construction rewrite rules that are synt

[il-antlr-interest: 33485] Re: [antlr-interest] Exception when generating tree grammar

2011-08-04 Thread Luigi Iannone
It works, Thanks, Luigi On 4 Aug 2011, at 15:41, Stephen Tuttlebee wrote: > Well, to refresh my memory on this term rewriting stuff you're doing, I > looked at Terence Parr's Language Implementation Patterns book which has > a section about this (if you have the book, it's p138 in the pdf edit

[il-antlr-interest: 33490] Re: [antlr-interest] Have I found an Antlr CSharp3 lexer bug if...

2011-08-04 Thread Chris King
I should have called out the space after the comment. That's what caused the problem. "/**/ ". So the input string has 5 characters. Thanks, Chris On Aug 4, 2011, at 7:04 AM, "Sam Harwell" wrote: > Hi Chris, > > > > I’m using the released version 3.4.0 of the ANTLR CSharp3 target. I > co

[il-antlr-interest: 33491] Re: [antlr-interest] Are the Eclipse ANTLR plugins stable?

2011-08-04 Thread The Researcher
Stephen, Thanks for the response. An appliance is a application that can run as a virtual machine. I am making one for people just learning ANTLR but that have trouble installing the various components, or possibly in classroom use. Think VMware or Virtual Box. Since posing the question I checke

[il-antlr-interest: 33492] [antlr-interest] Line oriented parsing with Unix files on Windows machine

2011-08-04 Thread Stevenson, Todd (GE Healthcare)
I have a line-oriented grammar that uses the following rule to define an end of line: EOL : ('\r' | '\n')+; My grammar parses input files fine when they are in windows format (lines end with '\r\n'), however the parser doesn't work when the input files are in unix format (lines end with '\n

[il-antlr-interest: 33493] [antlr-interest] Looking for an example of tree walking using push/pop

2011-08-04 Thread Janet.Hurwitz
Hello- I'm working on a grammar that has nested subtrees. I am successfully parsing the input to create the AST, but am having trouble navigating the tree to build the structure my Java program needs. The output is a HashMap. When it's not a leaf node, the Object in the map will be a HashMap.

[il-antlr-interest: 33494] Re: [antlr-interest] Looking for an example of tree walking using push/pop

2011-08-04 Thread Jeff Hair
This has an example of how to go down the AST and then back up. http://www.antlr.org/wiki/display/ANTLR3/Tree+pattern+matching This is a concrete example of the method on the wiki. I used it in my experiment about learning how to make an interpreter. EveCore calls the downup method. The .g file i

[il-antlr-interest: 33495] Re: [antlr-interest] Line oriented parsing with Unix files on Windows machine

2011-08-04 Thread Bart Kiers
Hi Todd, Well, `EOL : ('\r' | '\n')+;` matches a single `\n`. So my guess is that some other rule in your grammar matches a `\n` as well. Can you post a complete (small) grammar that shows the problem you're having? Regards, Bart. On Thu, Aug 4, 2011 at 8:37 PM, Stevenson, Todd (GE Healthcare

[il-antlr-interest: 33497] Re: [antlr-interest] To Sam Harwell

2011-08-04 Thread Sam Harwell
Hi Chris, In build 3.4.1.9004 that I released today, I switched all the projects to using $(ProjectDir) with relative paths. http://www.antlr.org/wiki/display/ANTLR3/Antlr3CSharpReleases Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.o

[il-antlr-interest: 33498] Re: [antlr-interest] To Sam Harwell

2011-08-04 Thread chris king
Awesome! I'll give it try. Did you see my follow up email that the parse string is 5 characters (there is a trailing space)? "/**/ " And again, love the tool chain. I only really started to get traction on my project after I installed it. It's working great. Thanks, Chris On Thu, Aug 4, 2011 at

[il-antlr-interest: 33499] [antlr-interest] Another (hopefully easy) newby question

2011-08-04 Thread Scott Smith
I have created a parser/lexer. When I run it as a standard parser (no ASTs), it runs fine. I've verified with the debugger, that it generates a reasonable tree. But, I want to run it to generate ASTs. So, I modified the code to do that (using ^ to promote operators and ! to eliminate some th

[il-antlr-interest: 33500] Re: [antlr-interest] Another (hopefully easy) newby question

2011-08-04 Thread John B. Brodie
On Fri, 2011-08-05 at 01:15 +, Scott Smith wrote: > I have created a parser/lexer. When I run it as a standard parser (no ASTs), > it runs fine. I've verified with the debugger, that it generates a > reasonable tree. > > But, I want to run it to generate ASTs. So, I modified the code to do