[il-antlr-interest: 26778] Re: [antlr-interest] The idea of semantic analyzer generator

2009-11-10 Thread Andreas Meyer
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

[il-antlr-interest: 26642] Re: [antlr-interest] Big grammar = static initializer/method size is exceeding the 65535 bytes limit

2009-11-04 Thread Andreas Meyer
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

[il-antlr-interest: 26323] Re: [antlr-interest] Semantic predicates

2009-10-16 Thread Andreas Meyer
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

[il-antlr-interest: 23969] Re: [antlr-interest] Retaining Comments after parsing the file

2009-06-02 Thread Andreas Meyer
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

[il-antlr-interest: 23972] Re: [antlr-interest] Comments get removed after instrumenting source

2009-06-02 Thread Andreas Meyer
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

[il-antlr-interest: 23572] Re: [antlr-interest] java.lang.StackOverflowError

2009-05-07 Thread Andreas Meyer
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

[il-antlr-interest: 23574] Re: [antlr-interest] java.lang.StackOverflowError

2009-05-07 Thread Andreas Meyer
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

[il-antlr-interest: 23376] Re: [antlr-interest] Followed by (PEG style predicates)

2009-04-26 Thread andreas . meyer
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

[il-antlr-interest: 23378] Re: [antlr-interest] Resolving ambiguity

2009-04-26 Thread andreas . meyer
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 =

[il-antlr-interest: 23335] Re: [antlr-interest] case-insensitive parsing

2009-04-23 Thread Andreas Meyer
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

[il-antlr-interest: 23341] Re: [antlr-interest] case-insensitive parsing

2009-04-23 Thread Andreas Meyer
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

[il-antlr-interest: 23301] Re: [antlr-interest] ANTLR running out of memory while parsing huge files

2009-04-21 Thread Andreas Meyer
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

[il-antlr-interest: 23310] Re: [antlr-interest] ANTLR running out of memory while parsing huge files

2009-04-21 Thread Andreas Meyer
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

[il-antlr-interest: 23285] Re: [antlr-interest] Retaining Comments after parsing the file

2009-04-20 Thread Andreas Meyer
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

[il-antlr-interest: 23255] [antlr-interest] ANTLRworks or eclipse plugin vs. composite grammars

2009-04-17 Thread Andreas Meyer
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

[il-antlr-interest: 23204] Re: [antlr-interest] Migrating from V2 to V3

2009-04-16 Thread Andreas Meyer
/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

[il-antlr-interest: 23214] Re: [antlr-interest] Avoiding the generation of final methods

2009-04-16 Thread Andreas Meyer
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

[il-antlr-interest: 22951] Re: [antlr-interest] Antlrworks freezes

2009-04-02 Thread Andreas Meyer
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

[il-antlr-interest: 22697] Re: [antlr-interest] How can I avoid mismatched input error?

2009-03-24 Thread Andreas Meyer
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

[il-antlr-interest: 22643] Re: [antlr-interest] A look-ahead/rewind problem

2009-03-23 Thread Andreas Meyer
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

[il-antlr-interest: 22648] Re: [antlr-interest] A look-ahead/rewind problem

2009-03-23 Thread Andreas Meyer
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

[il-antlr-interest: 22654] Re: [antlr-interest] A look-ahead/rewind problem

2009-03-23 Thread Andreas Meyer
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

[il-antlr-interest: 22634] Re: [antlr-interest] proposal: make .* and .+ always nongreedy

2009-03-22 Thread Andreas Meyer
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

[il-antlr-interest: 22532] [antlr-interest] Checking composite grammars with ANTLRworks

2009-03-18 Thread Andreas Meyer
, 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

[il-antlr-interest: 22533] Re: [antlr-interest] Checking composite grammars with ANTLRworks

2009-03-18 Thread Andreas Meyer
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

[il-antlr-interest: 22367] [antlr-interest] Early exit exception in positive closures

2009-03-10 Thread Andreas Meyer
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

[il-antlr-interest: 22374] Re: [antlr-interest] Early exit exception in positive closures

2009-03-10 Thread 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

[il-antlr-interest: 22349] [antlr-interest] Accessing the root grammar from an imported grammar

2009-03-09 Thread Andreas Meyer
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:

[il-antlr-interest: 22351] Re: [antlr-interest] lookahead DFA too big? (resolved, I think)

2009-03-09 Thread Andreas Meyer
, 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

[il-antlr-interest: 22280] [antlr-interest] Prediction DFA bug?

2009-03-06 Thread Andreas Meyer
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

[il-antlr-interest: 22284] Re: [antlr-interest] Bug? Invalid Java code generated

2009-03-06 Thread Andreas Meyer
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

[il-antlr-interest: 22288] Re: [antlr-interest] lookahead DFA too big?

2009-03-06 Thread Andreas Meyer
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

[il-antlr-interest: 22261] Re: [antlr-interest] lookahead DFA too big?

2009-03-05 Thread Andreas Meyer
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

[il-antlr-interest: 22266] Re: [antlr-interest] lookahead DFA too big?

2009-03-05 Thread Andreas Meyer
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

[il-antlr-interest: 22240] [antlr-interest] lookahead DFA too big?

2009-03-04 Thread Andreas Meyer
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

[il-antlr-interest: 22218] Re: [antlr-interest] Error I can't get my head around at all...

2009-03-03 Thread Andreas Meyer
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

[il-antlr-interest: 22136] Re: [antlr-interest] Backtracking vs Lookahead

2009-02-27 Thread Andreas Meyer
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

[il-antlr-interest: 22107] Re: [antlr-interest] request for comments on language implementation

2009-02-26 Thread Andreas Meyer
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

[il-antlr-interest: 21916] [antlr-interest] Huge amounts of follow sets

2009-02-13 Thread Andreas Meyer
, 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

[il-antlr-interest: 21806] Re: [antlr-interest] multiple tree walkers

2009-02-09 Thread Andreas Meyer
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

[il-antlr-interest: 21755] [antlr-interest] Composing tree grammars

2009-02-06 Thread Andreas Meyer
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

[il-antlr-interest: 21758] Re: [antlr-interest] Composing tree grammars

2009-02-06 Thread andreas . meyer
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

[il-antlr-interest: 21760] Re: [antlr-interest] Composing tree grammars

2009-02-06 Thread andreas . meyer
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

[il-antlr-interest: 21762] Re: [antlr-interest] Composing tree grammars

2009-02-06 Thread andreas . meyer
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: