On Wed, May 19, 2010 at 2:10 AM, Ernesto Castillo
hcast...@rocketmail.comwrote:
hello everybody my name is Ernesto and i am calling for help on antlr
programming, i am a newby in this and i am in my second semester master ,
after 12 years ago that finish my degree in computer science but
Dear All,
I am a Java developer using ANTLR 1.3.1
I am working is some dynamic environment, so my grammar is changing over
time due to the continuous change in vocabulary..
So I was thinking of generating my *.g grammar file automatically not to
write it by myself..
But now I face the problem
Sorry, I meant ANTLRWorks 1.3.1..
On Wed, May 19, 2010 at 11:37 AM, Sameh W. Zaky sameh...@gmail.com wrote:
Dear All,
I am a Java developer using ANTLR 1.3.1
I am working is some dynamic environment, so my grammar is changing over
time due to the continuous change in vocabulary..
So I was
Hello list,
Did someone solve this? I have a similar problem with a grammar I took
from this list (Eval.g and Simple.g). It concerns the .
ifElse
scope {
bool expResult;
} :
^(
IFTHEN b = expression { $ifElse::expResult = b; }
(
{$ifElse::expResult == true}?=
Why?
:s/skip\(\)/SKIP()/g
However it is a macro defined in the generated code, all you need do is:
#define skip() SKIP()
In an @section that follows the macro definition of SKIP
Jim
-Original Message-
From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-
Well, what language are you talking about? What are you trying to achieve? Why
do you think you need a custom lexer?
http://perl.plover.com/Questions.html
Jim
-Original Message-
From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-
boun...@antlr.org] On Behalf Of
Hi, a back-breaker question,
Is it possible under these circumstances to have the input file read in
blocks (say, 8kb) instead of reading the whole file into memory?
I'll be writing actions for every rule (not using Antlr's AST). Once the
actions are processed the input history is not
I'm 1 day into Antlr and hope for an answer to this:
With an identifier rule (for example this one):
SIMPLE_IDENTIFIER : ( 'a'..'z'|'A'..'Z'|'_' ) (
'a'..'z'|'A'..'Z'|'_'|'0'..'9'|'$')* ;
Is it possible, when the lexer recognizes the input stream to be a
SIMPLE_IDENTIFIER, to add some
Help!!!
I am getting a null pointer to setTokenBoundaries in the following line of
generated code.
ADAPTOR-setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
The grammar works under Java. In moving it back to 'C', I changed the language
option to 'C', added option
On May 18, 2010, at 2:58 PM, Scott Stanchfield wrote:
There are several advantages to enums:
* there is a discrete set of values that can be used (no accidental
42's passed in when 42 isn't a token type)
* the enum value can carry extra information
* the enum values can override methods
You can still define the match in the superclass -- just use an
interface like Edgar mentioned and I demonstrated in the
clarification note I sent.
I think the big value here would be that it forces every place that
uses the token types to use the enum names (as there are no integer
values). I
On May 19, 2010, at 11:39 AM, Scott Stanchfield wrote:
You can still define the match in the superclass -- just use an
interface like Edgar mentioned and I demonstrated in the
clarification note I sent.
oh right.
I think the big value here would be that it forces every place that
uses the
Hi, a recruiter in NYC has 2 positions to fill for a client. full-time and
paying anywhere from $100k to $120k. Contact info:
Hamilton Daza
Intrigue Systems, Inc.
7211 Austin Street #259
Forest Hills, NY 11375
800.809.0318 Main
917.699.3376 Mobile
718.841.7091 Fax
hdaza at intriguesys.com
Ter
Hmmm... that's evil, ya know that ;) Good to catch that now, though...
Probably LITERAL_1, LITERAL_2, etc. To make it easier for
debugging/printing/reporting you could add a pattern property (hmmm...
the more I think about it the more I like it... if there's a
description it could be printed w/
I also have doubts about the performance characteristics and the possibility of
starting to rely on the target language to fill in gaps such as token numbering
- we could get to the point where code generators cannot be built for more
primitive languages because the schema is relying the
Interesting point re common code generation approaches, but as far as
performance goes, it's equivalent - all == tests are done using
pointers, which are the same size as ints. If switch is used the
ordinal values of the enums are used, and the java compiler may be
able to better optimize which
On Wed, May 19, 2010 at 2:13 PM, Scott Stanchfield sc...@javadude.com wrote:
Interesting point re common code generation approaches, but as far as
performance goes, it's equivalent - all == tests are done using
pointers, which are the same size as ints. If switch is used the
ordinal values of
Don't pre-optimize for things like this. Profile, then optimize. This
won't even show up as an issue.
I think whoever wrote that page was daydreaming about any minor way
performance might be increased - note that they don't talk at all on
that page about the big performance issues (I/O,
Jim,
Here is what I have set in options:
options {
backtrack = true;
memoize = true;
language= C;
output = AST;
ASTLabelType= pANTLR3_BASE_TREE;
}
The null is inside 'ctx' inside
Greetings,
I'm a Antlr noob, and have a question regarding accessing attributes.
Where, outside of action, can you reference attributes? One place seems
to be as parameter to rule invocation like this:
decl: type declarator[ $type.text ] ';' ;
This is from The Definitive Antlr Reference,
Pardon me for butting in.
And I have never used the C code generator, but.
On Wed, 2010-05-19 at 14:06 -0700, Alan Condit wrote:
which I assume, based on the comment, is generated from this rule:
line : line_number? segment+ K_NEWLINE
- ^(STMT segment+)
|
On Jan 16 2009, 4:51 pm, Jim Idle j...@temporal-wave.com wrote:
When you change your template or codegen target java file, you just type:
mvn
And it rebuilds just what has changed in a second or two (depends on your
machine speed of course).
On my slow machine, this takes 33 seconds after
On page 164 of The Definitive Antlr Reference under the heading Omitting
Input Elements Terrance shows using an empty rewrite rule to allow omitting
unneeded symbols from the output AST tree.
This does not say that it could not be causing a problem with the generated 'C'
code.
Jim, is there a
I think you will have to put those three productions in separate rules, but I
will look into it more.
Jim
-Original Message-
From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-
boun...@antlr.org] On Behalf Of Alan Condit
Sent: Wednesday, May 19, 2010 2:06 PM
To:
Why would you try to use a return value that you have not set? If it is set to
NULL then you will core dump unless you check for NULL so it would not help
you. The values are not initialized because I don't know what they are, they
might be object references or something that cannot be set to
I suspect that your benchmark runs afoul of clock granularity issues for the
JIT. If you run it a few times you will likely get different results. Also you
say 10% better for enums but look at your results again.
Take the client JIT, your first run gives:
Enum Time: 25707993
Int Time :
Possibly, though I suspect your easy work around is to make each alt a subrule.
I will look tomorrow.
Jim
-Original Message-
From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-
boun...@antlr.org] On Behalf Of Alan Condit
Sent: Wednesday, May 19, 2010 5:01 PM
To:
I just ran that code with it looping through doEnums/doInts 1000
times. The difference was ~5% for -client and -Xbatch, and ~10% for
-server. (I tried -Xint and it took waay too long). All had enums
as higher, which sounds reasonable (as there's static field lookups
being done)
My main point
28 matches
Mail list logo