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

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

[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 AN

[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: >

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

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

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

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

[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 > mailto:

[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: 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: 23563] Re: [antlr-interest] Comments get removed after instrumenting source

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

[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 = e

[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 let

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

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

[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 p

[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 e

[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: 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 li

[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,

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

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

[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 look&feel implementations have different memory usage patterns, so one look&feel runs out of memory earlier

[il-antlr-interest: 22789] Re: [antlr-interest] Problem with rewrite rules with optional non-terminals

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

[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

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

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

[il-antlr-interest: 22650] [antlr-interest] ANTLR2 compatibility Tree implementation

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

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

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

[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 func

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

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

[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 wou

[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 w

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

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

[il-antlr-interest: 22401] Re: [antlr-interest] Simple g rammar will not compile. I can't figure it out.

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

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

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

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

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

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

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

[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: http://www.

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

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

[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 whic

[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: 22280] [antlr-interest] Prediction DFA bug?

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

[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 >> appea

[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 > 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

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

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

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

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

[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.

[il-antlr-interest: 22163] Re: [antlr-interest] ANTLRWorks debugger

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

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

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

[il-antlr-interest: 22117] [antlr-interest] Backtracking vs Lookahead

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

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

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

[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 c

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

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

[il-antlr-interest: 21973] [antlr-interest] Gated semantic predicates without lookahead?

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

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

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

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

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

[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: > .. Lis

[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 Andre

[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.

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

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