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
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;
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?
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
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
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
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
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
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
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
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
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
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-
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
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
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
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).
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
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
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
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
21 matches
Mail list logo