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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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'
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
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
17 matches
Mail list logo