own notation. So, you would need to explicitly build an AST,
suitable for jastadd: you cannot reuse ANTLRs tree building facility.
Maybe bridging that gap could be an interesting topic? FYI : currently
I'm writing a tree parser generator that operates on an already built
ANTLR tree, which could be
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 AN
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:
>
Robert Wentworth schrieb:
> There appears to be something fundamental that I am not "getting"
> about the way semantic predicates work. In the grammar below, the
> input "cat" is recognized using the rule "cat" but in not recognized
> by either the rule "expr" or the rule "pexpr". Could some
nthi a schrieb:
> where should I use the setHiddenAfter / setHiddenBefore methods?
> Please let me know
>
> vasanthi.
>
> On Thu, May 7, 2009 at 4:19 PM, Andreas Meyer
> mailto:andreas.me...@smartshift.de>> wrote:
>
> If you just skip the comment token, it wil
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
> mailto:
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 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
>
If you just skip the comment token, it will be discarded. If you want to
retain it, you have to use the "setHiddenAfter" / "setHiddenBefore"
methods mentioned in the antlr wiki. Once the comments are stored there,
you have to take care that you print them while traversing the tree for
output.
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 = e
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 let
s do it C-style :-)
>
> procedure thingy(a_string in varchar2, an_int in out number);
>
> Horrible, I know. But I need 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,
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 p
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 e
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
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 li
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,
r, which is
new in ANTLR3 and is used from within the tool-generated code to
build/traverse/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
--~--~-~--
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 look&feel implementations have different memory
usage patterns, so one look&feel runs out of memory earlier
David Jameson schrieb:
> I have the following grammar fragment
>
> refTag :
> LSQUARE a=expression (COMMA b=expression)? RSQUARE
> {
> //stuff
>
> } -> ^(REFTAG $a $b)
>
> ;
>
>
> However, if I fee
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
a value : n
> isBlockOpen() has been invoked with a value : n
> *start of block: number1*
> isBlockOpen() has been invoked with a value : n
> isBlockOpen() has been invoked with a value : n
> isBlockOpen() has been invoked with a value : n
> *start of block: number1*
>
>
Hi!
Has anybody ever tried to implement the ANTLR3 Tree interface, such that
it emulates the ANTLR2 access methods for AST efficiently and with all
the corner cases? If that's possible, at all ...
Best,
Andreas Meyer
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubs
;
> BLOCK 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 <mailto:andreas.me...@smartshift.de>>
>
>
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 func
eady resolved by your syntactic predicate. Actually, I am not sure
about the structure you gave, namely, a syntactic predicate inside a
syntactic predicate, maybe it also means "match the empty string after
seeing BLOCK_BOUNDARY, I dont know.
I would suggest you try without the syntactic predica
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 wou
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 w
t possible, 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-ema
It seems that ANTLR's error messages could be improved in this case
DataPath is a lexer rule, because of ANTLR's naming conventions:
everything starting with a capital letter is a lexer rule. And as such,
it only can refer to other lexer rules (or fragments). But, keypath
(because of its
;
I really appreciate that offer and would be happy if I could help
improve ANTLR, but sending the grammar itself 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: h
ke sense to add an option to ANTLR 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'
ve, one per included lexer.
> Ter
>
> On Mar 6, 2009, 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?
>>>
>&
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: http://www.
e which parts I need to take care of.
Thanks a lot!
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 becau
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 whic
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
exity ... it seems that LL(*)
is built on a simple idea, but to implement 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-in
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
>> appea
Thomas Brandon schrieb:
> On Thu, Mar 5, 2009 at 9:50 PM, 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 us
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 2.7 was fine with it and the
generated parser
in many different ways. However, I dont
quite see why the DFAs should 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
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.
Have you tried using the port 49153 from within ANTLRWorks? That worked
for me. (I have ANTLR 3.1.2 but only the previous-recent version of
ANTLRworks, if that makes a difference).
Andreas
Filipe David Manana schrieb:
> Hello,
>
> Suddenly, I am no longer able to use the debugger. ANTLRWorks r
rmal
way to do it. If not, how hard would it be to extend 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
.
Now, I thought "ok, use backtracking". Enabling it globally seems to
work. But, if I try to enable it only locally, it does not seem to have
any effect. Actually, I tried to enable it for any rule in my grammar -
without any effect! (I include the grammar in question as a
Andy Tripp schrieb:
> Do you have a link for JJtraveller? Google can't find it.
It's a bit hidden, and from what I understood, they are already working
on something new. But you can find it inside the downloadable
meta-environment package (www.meta-environment.org). A paper can be
found here:
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 c
(http://wiki.di.uminho.pt/twiki/bin/view/Personal/Joost/MatchO) that
seems to do just that, but I still have to experiment with it. With some
modifications, it might even work for antlr3.
Best,
Andreas Meyer
Andy Tripp schrieb:
> Hi Michael,
> Jiffle looks very cool!
>
> A quick &q
be not the best possible solution.
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 received this message because you are su
alternatives, 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-
previous mails), so you
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: Micha
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:
> ..
Lis
>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
Andre
>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.
the antlr 3.1 distribution and basically
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
_
smart
57 matches
Mail list logo