on an already built
ANTLR tree, which could be useful to bridge this gap (in constrast to
the ANTLR tree parser, which works on a stream of tokens for the full
tree, actually). Let me know if you are interested.
Cheers,
Andreas Meyer
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Back in the days when we tried to migrate our ANTLR2 grammar to ANTLR3,
we also experienced this problem, due to lots of static initializer code
in the _parser_ class. Our solution was to apply some perl-skript magic,
but if Alex Marin now proposes a built-in solution, that is only good
for
Andreas Meyer schrieb:
Robert Wentworth schrieb:
There appears to be something fundamental that I am not getting
[...]
I think the generated code is wrong. [...]
btw, when changing the gated semantic predicates:
cat : {input.LT(1).getText().equals(cat)}?= WORD
Didn't the linked documentation help?
vasanthi a schrieb:
Hi,
Can you please let me know how to retain comments after instrumenting
the code in ANTRL V2.
Thanks
Vasanthi.
On Mon, Apr 20, 2009 at 6:21 PM, Andreas Meyer
andreas.me...@smartshift.de mailto:andreas.me...@smartshift.de
the setHiddenAfter / setHiddenBefore methods?
Please let me know
vasanthi.
On Thu, May 7, 2009 at 4:19 PM, Andreas Meyer
andreas.me...@smartshift.de mailto:andreas.me...@smartshift.de wrote:
If you just skip the comment token, it will be discarded. If you
want to
retain it, you have
I know this is not a very educating answer :-) But what about increasing
the stacksize of the JVM?
Andreas
wirv...@beats.hu schrieb:
Helo!
I want to create a Tree Grammar from my normal grammar (with the method
described in the ANTLR book), and after I corrected some obvious errors
You could try to increase the time-out, I think it was called
-Xconversiontimeout. In my grammar, I have to set it to 20 seconds until
it works without error. It does not generate huge code, it just takes
some time to find out to do nothing.
Andreas
wirv...@beats.hu schrieb:
thanks, now I
I'm not 100% sure why ANTLR did not generate code for the syntactic predicate,
but it seems that you wanted to do things in the lexer, that are now done in
the parser: probably you wanted all those pn_start, name_part etc rules to be
lexer rules. If so, you have to start them with a capital
Why do you want to distinguish these cases on a syntactic level? Couldn't you
just allow type varname = expression and then, in another stage, check that
the types match?
Best,
Andreas
The problem is somewhere in the 'str_method_var' and 'int_method_var'
rules. They both have a NAME =
Have you tried making the whole comment a lexer token? This way, the
keyword tokens would not interfere with plain text inside comments (If
that was your intention: lexer rule names have to start with an upper
case letter)
Andreas
Bob Sole schrieb:
I'm trying to write a parser for PL/SQL
to be able to parse all combinations
thereof :-)
I've looked at PLDoc, but it doesn't really address this issue.
Cheers
Bob.
On Thu, Apr 23, 2009 at 1:20 PM, Andreas Meyer
andreas.me...@smartshift.de mailto:andreas.me...@smartshift.de wrote:
Have you tried making the whole comment
I do not remember something built-in, so I guess the easiest solution
would be to create a lexer for the HEADER/DECL/BODY/line/END tokens, and
from within the lexer, instantiate/call a new lexer/parser.
Best,
Andreas Meyer
smartShift
smart e*lliance GmbH
Willy-Brandt Platz 6
68161 Mannheim
No, in any case, you should avoid parsing the whole file! That would
basically mean loading the whole file into main memory. Either use a
lexer, a custom tokenizer or whatever for seperating your entries in the
body section. Then, for each line, you invoke the parser, possibly by
reusing the
It seems you are using ANTLR2. There, hidden tokens were handled
differently from ANTLR3 (see http://www.antlr2.org/doc/streams.html)
Best,
Andreas Meyer
smartShift
smart e*lliance GmbH
Willy-Brandt Platz 6
68161 Mannheim
Germany
T +49 (621) 400 676-13
F +49 621 400 67606
Geschäftsführer
Hi!
Is there anybody on the list that has a composite grammar, and
successfully works with it using an Ecliplse plugin or ANTLRworks? With
successful, I mean:
* highlight ambiguities, that span multiple grammars in the import hierarchy
* navigate from one grammar to another, using something
/manipulate the AST.
Best,
Andreas Meyer
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~-~--~~~---~--~~
You received this message because you are subscribed
Patrick Schönbach schrieb:
Hi all,
usually, AntLR generates final methods for each rule. However,
sometimes, one would like to subclass the parser. Is there a way to
generate non-final methods?
Regards,
Patrick
Maybe there is a better method, but from what I have learned, there
Hi!
When opening my (big) grammar in AntlrWorks, I usually tell java to use
as much memory as possible, such as (from commandline)
$ java -Xmx1g -jar antlrworks.jar
Maybe the different lookfeel implementations have different memory
usage patterns, so one lookfeel runs out of memory earlier
Gabriel Petrovay schrieb:
Hi Tom,
So in your solution I would have to do something like this:
name1: Name1 | KEYWORD1 | KEYWORD2 | ... KEYWORDM;
name2: Name1 | KEYWORD1 | KEYWORD2 | ... KEYWORDM;
...
nameN: NameN | KEYWORD1 | KEYWORD2 | ... KEYWORDM;
This is what I meant when I said
Lukasz Guminski schrieb:
I would suggest you try without the syntactic predicate, turn your
semantic predicate into a gated semantic predicate {...}? = such that
it is forced to be evaluated:
block_open: {is_block_open()}?= BLOCK_BOUNDARY
I cannot use a function without
with_a_very_long_name
then LT(2) does not return the full name. Of course, I can set
options{
k = 100;
}
but that's not the solution.
Lucas
2009/3/23 Andreas Meyer andreas.me...@smartshift.de
mailto:andreas.me...@smartshift.de
Lukasz Guminski schrieb:
I would
start of block: number1
end of block: number1
Thanks,
Lucas
2009/3/23 Andreas Meyer andreas.me...@smartshift.de
mailto:andreas.me...@smartshift.de
If you are in a parser rule, input.LT(2) gives you the second-next
_token_, instead of a character (as inside a lexer rule). So
FYI, the gazelle parser project (prototype) also aims at something
similar, with slightly different syntax. Having non-greedy parsing in
ANTLR also at the grammar level would be really useful, especially for
languages without reserved identifiers. But I guess it's not an easy
hack that one
, as I need an option
-Xconversiontimeout in order to build anything.
Best Regards,
Andreas Meyer
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~-~--~~~---~--~~
You
Andreas
Andreas Meyer schrieb:
Hi!
I have a grammar that imports many subgrammars, which in turn import
other sub-grammars. Now, via command-line, ANTLR reports about
ambiguities (displayed as a list of NFA states). Now, in order to
visualize this ambiguity warning in ANTLR, I tried
like
do_not_check_for_early_exit? This would greatly simplify my grammar,
as rules like these occur very often. Sure, this also would work:
(identifier|keyword) ({false}? (identifier|keyword))* rule_with_keywords?
but of course it's more redundant.
Greetings,
Andreas Meyer
is not possible,
unfortunately ... is there some way you could send me a patched version
of ANTLR that produces a logfile, which I can send to you?
Greetings,
Andreas Meyer
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email
Hi!
Is there a proper way to access the instance of a root grammar class,
from a grammar that is imported? With some function like
getRootGrammar() ? I have some members defined in my root grammar, and
would like to access these from some of the imported grammars.
Andreas
List:
, at 11:38 AM, Andreas Meyer wrote:
Terence Parr schrieb:
Hi Andreas, I'm neck deep in another problem at the moment. Can you
try increasing the timeout?
-Xconversiontimeout t set NFA conversion timeout for each decision
try 10 or something liek that.
Yes, I already did
it with all corner cases,
takes a lot of effort.
Best Regards,
Andreas Meyer
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
il-antlr-interest group.
To post to this group, send email to il-antlr-interest@googlegroups.com
Sam Barnett-Cormack schrieb:
Hi all
The attached grammar (which you're probably all tired of) generates
Java code with an error in. I've checked, and the error isn't in a
copy action or predicate - it's in the expansion of $text in a parser
predicate. I don't know if I've used $text
Paul Bouché schrieb:
Hi,
hi I also had this problem when trying to introduce a backward
compatible change into our Lexer. The problem with code too large...
It aggravated the heck out of me. Whenever I found a solution that did
not break the Java code size limit I got something which had
Thomas Brandon schrieb:
On Thu, Mar 5, 2009 at 9:50 PM, Andreas Meyer
andreas.me...@smartshift.de wrote:
Maybe it's possible to partition the set of keywords, but that would be
some effort: figuring out for 800 keywords, where they appear, what is
the context they are used in etc. Note
Jim Idle schrieb:
Andreas Meyer wrote:
Maybe it's possible to partition the set of keywords, but that would
be some effort: figuring out for 800 keywords, where they appear,
what is the context they are used in etc. Note that the problem only
appeared after switching to ANTLR 3.1, ANTLR
be so big? I hope there is someone on the
list who has seen a similar problem. Unfortunately, I cannot post a nice
and small grammar here: my smallest error-producing grammar is about
5000 lines long.
Thanks a lot for any help!
Andreas Meyer
(smartshift.de)
List: http://www.antlr.org/mailman
Just a guess: did you use ANTLRworks? If not, it is indeed quite hard to
see the cause.
Andreas
Sam Barnett-Cormack schrieb:
Hi all,
I've wracked my brains on this one, and really can't see what's going on.
I've got one error in my grammar, and I just can't see how it's come
about. I've
ANTLR with such a
mechanism? If you could provide me with some pointers/hints, I would be
happy to implement this myself.
Best Regards,
Andreas Meyer
Andreas Meyer schrieb:
Dear ANTLR users! (developers?)
I have a very basic problem: supposed I have two rules, one which
basically includes
Andy Tripp schrieb:
Hi Andreas,
Andreas Meyer wrote:
Hi!
Your mail was addressed to Michael, but I hope it's ok to answer
nonetheless:
I would consider hand-written code to walk an AST harmful. Maybe
there are cases where it is useful, but walking a dynamically typed
tree like
, other than
(probably) making the grammar less ambiguous? Thanks for any hints!
Best Regards,
Andreas Meyer
(smartshift.de)
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
need to uncomment some lines within the ANTLR sources.
Cheers,
Andreas Meyer
-Ursprüngliche Nachricht-
Von: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] Im Auftrag von Oliver Zeigermann
Gesendet: Montag, 9. Februar 2009 09:51
An: Michael Bedward
Cc: antlr
copied the walker, spelled import . and removed all but one rule from the
copy.
Did I use composite tree grammars in a wrong way? If so, how can I define
multiple tree grammars for only small parts of the grammar?
Andreas Meyer
Developer
_
smartShift
smartShift GmbH
Willy-Brandt-Platz 6
68161
On Feb 6, 2009, at 11:01 AM, Andreas Meyer wrote:
Hi!
I am using ANTLR 3.1 and I want to compose tree grammars in a way,
that I have one “base” grammar that contains all rules, in order to
define a traversal, but without actions/rewrites. Then, a second
grammar imports the “base
Hi. Can you try putting
tokenVocab=SimpleC;
in the root grammar too?
T
I tried both SimpleC and SimpleCWalker vocabs (specified both in
SimpleCWalker.g and ...Walker2.g), but anyway:
warning(160): SimpleCWalker.g:4:5: tokenVocab option ignored in imported
grammar SimpleCWalker
Andreas
Ok, that solves it :-) Just tested. Good to know that it works. Thanks a lot
for the realtime answer!
Andreas
oh. right.
ok, it's a token type problem. it *must* import the vocab.
crap. adding to bug list. no easy fix unless you comment out some
code. remove this test:
..
List:
44 matches
Mail list logo