[il-antlr-interest: 34961] Re: [antlr-interest] Failure to ignore newline

2011-11-17 Thread Norman Dunbar
Morning David, On 18/11/11 06:55, David Riddle wrote: grammar Test; prog: ID+; ID: 'a'..'z'+; WS: '\n'+ {$channel=HIDDEN;}; I just pasted your grammer into ANTLRWorks and it seemed happy. In the interpreter I entered the following: a b With a real newline between them, it gave the corre

[il-antlr-interest: 34960] [antlr-interest] Failure to ignore newline

2011-11-17 Thread David Riddle
Hi - This should be a very simple thing - I'm attempting to have my grammar hide newline, carriage returns, etc. However, every concievable form of a grammar that attempts to skip over these things or send them to the hidden channel seems to fail for me. Here's a very basic example: grammar Test;

[il-antlr-interest: 34959] Re: [antlr-interest] [C] my v3 Parser no reuse() slower 20% than v2. With reuse() 2GB leaks, oops.

2011-11-17 Thread Ruslan Zasukhin
On 11/18/11 1:24 AM, "Jim Idle" wrote: Hi Jim, > You should not be seeing more than a few newPool calls, however, if you > are building a tree then this may be affecting it. You mean A) my own tree in the parser ? no, I do not build. Work ANTLR itself to build AST B) tree parser?

[il-antlr-interest: 34958] Re: [antlr-interest] [C] my v3 Parser no reuse() slower 20% than v2. With reuse() 2GB leaks, oops.

2011-11-17 Thread Jim Idle
You should not be seeing more than a few newPool calls, however, if you are building a tree then this may be affecting it. The reuse stuff was not built for trees, so you may have to debug this because I won't have time to look at new use cases for some time. I will take out the myriad duplication

[il-antlr-interest: 34957] Re: [antlr-interest] reuse() methos in 3.4 C runtime

2011-11-17 Thread Jim Idle
yes > -Original Message- > From: Ruslan Zasukhin [mailto:ruslan_zasuk...@valentina-db.com] > Sent: Thursday, November 17, 2011 12:21 PM > To: Jim Idle; antlr-interest@antlr.org > Subject: Re: [antlr-interest] reuse() methos in 3.4 C runtime > > On 6/24/11 7:49 PM, "Jim Idle" wrote: > > Hi

[il-antlr-interest: 34956] Re: [antlr-interest] reuse() methos in 3.4 C runtime

2011-11-17 Thread Ruslan Zasukhin
Hi Jim, Below are copy-pastes of my class-wrapper around ANTLR3 Lexer/Parser/TreeParser. So you can see if I made some stupid mistake... >> On 6/24/11 7:49 PM, "Jim Idle" wrote: >> >> Because the documentation is not yet up to date, here is an example of >> reusing the allocated memory in input

[il-antlr-interest: 34954] Re: [antlr-interest] [C] my v3 Parser no reuse() slower 20% than v2. With reuse() 2GB leaks, oops.

2011-11-17 Thread Ruslan Zasukhin
Hi Jim, Thank you for your feedback, and I have update now... 1) I was able remove all .text usage in both Parser and TreeParser. GOOD. 2) BAD ... This have save 500MB, but I still have 1.5GB of allocations in my bench ... And now I see (using Apple Instruments) that all this is eaten by

[il-antlr-interest: 34953] Re: [antlr-interest] reuse() methos in 3.4 C runtime

2011-11-17 Thread Ruslan Zasukhin
On 6/24/11 7:49 PM, "Jim Idle" wrote: Hi Jim, I will send few letters now, but I will start with simple question to this your letter. Am I right, that we also in this loop should kill and create again TreeParser? Yes? > Because the documentation is not yet up to date, here is an example of

[il-antlr-interest: 34950] Re: [antlr-interest] confused about rendering all String Templates...

2011-11-17 Thread Voelkel, Andy
It's very confusing trying to read the detailed documentation on the StringTemplate site until you get the basic idea, but keep at it. A key thing for me was realizing that the objects embedded as "parameters" in a string template can be just about anything that can be rendered to a string, or

[il-antlr-interest: 34949] Re: [antlr-interest] confused about rendering all String Templates...

2011-11-17 Thread Morgan Jones
Andy, that does help... thanks for replying. as I read about StringTemplates today I gathered they were capable of much more than I had initially realized... I'll go back and try to track down some examples of the nested String Templates you spoke of. Maybe I'll luck out and someone will point me

[il-antlr-interest: 34948] Re: [antlr-interest] confused about rendering all String Templates...

2011-11-17 Thread Voelkel, Andy
Hi Morgan, Well, I'm a newbie too, but I can tell you how I understand and use StringTemplates. For me, the end result of walking a tree that produces StringTemplates is a StringTemplate which contains elements which are themselves StringTemplates (or lists of String Templates), which contains

[il-antlr-interest: 34947] [antlr-interest] confused about rendering all String Templates...

2011-11-17 Thread Morgan Jones
I've gotten a lexer, parser (that outputs AST) and a tree parser work. Currently the tree parser contain little code snippets that include System.out.println to print my translated file. Not very pretty, but it works. My next step was to switch to StringTemplates, because I thought it would help

[il-antlr-interest: 34945] Re: [antlr-interest] valid grammar does not compile

2011-11-17 Thread Jim Idle
The range 'a'..'z' does not mean the letters a to z but the token numbers assigned by ANTLR - you need to read the 5 minute getting started articles in the WIKI or use the search on the support page. Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-

[il-antlr-interest: 34943] Re: [antlr-interest] C# problem with the gettext()

2011-11-17 Thread Sam Harwell
The C# code uses C# conventions in many (hopefully most) places. input.LT(1).Text Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of karen Sent: Thursday, November 17, 2011 6:25 AM To: antlr-interest@antlr.org Subject: [an

[il-antlr-interest: 34942] Re: [antlr-interest] This should be easy - but I can't figure it out

2011-11-17 Thread Stefan Mätje
Am 17.11.2011 02:39:05 schrieb(en) John B. Brodie: > On 11/16/2011 12:02 AM, Voelkel, Andy wrote: > > : : : > > array > > : ( l='[' (f+=FLOAT)+ ']' -> ^(ARRAY_FLOAT ["FLT ARY",$l] $f+) ) > > | ( l='[' (s+=STRING)+ ']' -> ^(ARRAY_STRING["STR ARY",$l] $s+) ) > > ; > > > > [Andy - This c

[il-antlr-interest: 34941] [antlr-interest] Copyright question concerning the code accompanying the "Language Implementation Patterns" book

2011-11-17 Thread (d)
Hi, I'm trying to build a language to language translator using ANTLR. I'm also using the "Language Implementation Patterns" book to find my way through this task. For building my symbol tables I would like to use some parts of the source code that accompanies this book. Could anybody clarify

[il-antlr-interest: 34940] [antlr-interest] C# problem with the gettext()

2011-11-17 Thread karen
Hi, I am new at ANTLR and I am having a problem trying to use the C# code generated with the Kuka KRL Grammar... I am using antlrworks version 1.4.3 , Visual Studio 2010. While compiling the C# code, Visual Studio claims that it doesn't recognize the getText() that appears like this: input.LT(1).

[il-antlr-interest: 34939] Re: [antlr-interest] valid grammar does not compile

2011-11-17 Thread Bart Kiers
On Thu, Nov 17, 2011 at 10:14 AM, D. Frej wrote: > and still: the compilation error stays even if I do not quote the > question mark > Ah, hold on, you're using the `..` (range) operator inside a parser rule (horef). Either create a lexer rule matching '?' 'a'..'z': Horef :'?' 'a'..'z

[il-antlr-interest: 34938] Re: [antlr-interest] valid grammar does not compile

2011-11-17 Thread D. Frej
and still: the compilation error stays even if I do not quote the question mark > > Original-Nachricht > Datum: Thu, 17 Nov 2011 09:34:45 +0100 > Von: Bart Kiers > An: "D. Frej" > CC: antlr-interest@antlr.org > Betreff: Re: [antlr-interest] valid grammar does n

[il-antlr-interest: 34937] Re: [antlr-interest] valid grammar does not compile

2011-11-17 Thread Bart Kiers
On Thu, Nov 17, 2011 at 9:14 AM, D. Frej wrote: > Hi, > > I build the following grammar with antlrworks: > > grammar questionmark; > > horef > :'\?' ('a'..'z') > ; > > antlrworks tells me "check grammar succeeded". However, debugging does not > works because the generated code does no

[il-antlr-interest: 34936] [antlr-interest] valid grammar does not compile

2011-11-17 Thread D. Frej
Hi, I build the following grammar with antlrworks: grammar questionmark; horef     :    '\?' ('a'..'z')     ; antlrworks tells me "check grammar succeeded". However, debugging does not works because the generated code does not compile !? My question: how does the rule have to look like so tha