[il-antlr-interest: 26811] Re: [antlr-interest] A second Ddefinitive ANTLR book?

2009-11-11 Thread Jim Idle
Well, did you try the front page of the ANTLR Web site: http://www.antlr.org/ Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Bill Cox > Sent: Wednesday, November 11, 2009 12:42 PM > To: antlr-inter...@antlr.org

[il-antlr-interest: 26806] Re: [antlr-interest] Compiling Java source files when using the antlr3-maven-plugin

2009-11-11 Thread Jim Idle
Did you add the package statement to the @arser and @lexer header sections? The output files will generated I the correct place, but you need to add the package yourself, just like in Java. Your best bet is to start here: http://www.antlr.org/wiki/display/ANTLR3/Building+ANTLR+Projects+wi

[il-antlr-interest: 26803] Re: [antlr-interest] Equivalent of TOKEN{x,y}

2009-11-11 Thread Jim Idle
Just add counters in the parser rules (scope probably), let there be any number of them, then issue errors if the counts are wrong. You really don't want to do things like this at the grammar level - the messages you will issue will be confusing to users "Error at 'y', expecting '}'" leaves you

[il-antlr-interest: 26799] Re: [antlr-interest] Any doc on syntax diagrams?

2009-11-11 Thread Jim Idle
The numbers are probably not useful to you to be honest, but you could start here: http://en.wikipedia.org/wiki/Nondeterministic_finite_state_machine if you are interested in what it all means. Generally you will be fine reading the syntax diagrams and looking at generated code if you are

[il-antlr-interest: 26768] Re: [antlr-interest] custom TokenLabelType and EOF/Error tokens

2009-11-10 Thread Jim Idle
Do you have: ASTLabelType=MyToken; ? I am thinking that you do have that and that is why you are getting the cast problems right? Jim From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Bob Frankel Sent: Tuesday, November 10, 2009 8:35 AM

[il-antlr-interest: 26767] Re: [antlr-interest] tree pattern matching and list rewriting

2009-11-10 Thread Jim Idle
Did you try using cardinality in your $e{n} references? Such as $e* $e+ etc? I have not tried that, but it is what my first attempt at typing in would have been ;-) Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf

[il-antlr-interest: 26766] Re: [antlr-interest] Global Dynamic Scope

2009-11-10 Thread Jim Idle
Do you have a small(ish) reproducible example? Jim From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Claude Moulin Sent: Tuesday, November 10, 2009 1:47 AM To: antlr-inter...@antlr.org Subject: [antlr-interest] Global Dynamic Scope Hello,

[il-antlr-interest: 26746] Re: [antlr-interest] help antlr.jar

2009-11-09 Thread Jim Idle
It's not an infinite loop, it is waiting for you to type something in and press CTRL-D or CTLR-Z. The input stream is System.in. Jim From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Fernando Freitas Sent: Monday, November 09, 2009 9:45 AM To: a

[il-antlr-interest: 26731] Re: [antlr-interest] Java Target Generation Problem

2009-11-08 Thread Jim Idle
Actually it is because it thinks it is a documentation comment like Javadoc and you can only have one. The new parsres we are working on will give better error messages about such things. If you used: /* * Then you won't get the issue - the lexer looks for /** at the comm

[il-antlr-interest: 26707] Re: [antlr-interest] Strange bug in ANTLR version higher than 3.1.2

2009-11-05 Thread Jim Idle
> -Original Message- > From: franklinc...@cmu.edu [mailto:franklinc...@cmu.edu] > > So first, here is your grammar rewritten without anything but > standard rewrite rules (lexer skipped and compressed for space). You > can see that this is somewhat, err... 'simpler' ;-) > Unfortunately

[il-antlr-interest: 26703] Re: [antlr-interest] Strange bug in ANTLR version higher than 3.1.2

2009-11-05 Thread Jim Idle
Franklin, So I spent some time debugging your parser and basically the problem is to do with the way you are building the tree (well actually the problem might be the syntax of the language you are parsing, but you probably don't control that ;-). The new tree stream is making some assumption

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

2009-11-04 Thread Jim Idle
gt; -----Original Message- > From: Loring Craymer [mailto:lgcray...@yahoo.com] > Sent: Wednesday, November 04, 2009 11:13 AM > To: Jim Idle; Antlr interest > Subject: Re: [antlr-interest] Big grammar => static initializer/method > size is exceeding the 65535 bytes limit > &g

[il-antlr-interest: 26654] Re: [antlr-interest] BNF to ANTLR

2009-11-04 Thread Jim Idle
11:05 AM > To: Jim Idle; antlr-inter...@antlr.org > Subject: Re: [antlr-interest] BNF to ANTLR > > Actually, this is easier to do automatically. Any BNF dialect takes > about 2 pages for parser + lexer description of the BNF in ANTLR; it is > very easy to write a translator

[il-antlr-interest: 26652] Re: [antlr-interest] Define "function" as numerical and alphanumerical expression

2009-11-04 Thread Jim Idle
It looks like you are trying to produce a grammar from some kind of normative spec and have made the classic mistake of trying to include context in the expression of the grammar. The problem is that such specs are not written for writing parsers with but more of an explanation of how things go

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

2009-11-04 Thread Jim Idle
em, 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 ANTLR. > > Andreas > > Jim Idle schrieb: > > I think that t

[il-antlr-interest: 26649] Re: [antlr-interest] BNF to ANTLR

2009-11-04 Thread Jim Idle
Much better to do it by hand. ANTLRs EBNF notation is close, but remember that ANTLR is LL() and not LALR, which most bnf definitions from normative specs are aimed at. Use ANTLRWorks and build slowly and you should pick it up quite quickly if you understand BNF well. Jim > -Original Mess

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

2009-11-04 Thread Jim Idle
> but if Alex Marin now proposes a built-in solution, that is only good > for ANTLR. > > Andreas > > Jim Idle schrieb: > > I think that the issue is more likely something to do with your lexer > specification. You should not need to worry about having lots of > keywor

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

2009-11-04 Thread Jim Idle
ller than m [3] To generate switches rather than tables. But really, rejigging your parser will be a much better thing to do overall. Jim > -Original Message- > From: Alex Marin [mailto:alex.ma...@amiq.ro] > Sent: Wednesday, November 04, 2009 5:27 AM > To: Jim Idle &

[il-antlr-interest: 26646] Re: [antlr-interest] Bug report: Unexplainable "no viable alternative"

2009-11-04 Thread Jim Idle
lto:alex.ma...@amiq.ro] > Sent: Wednesday, November 04, 2009 5:07 AM > To: Jim Idle; Gerald Rosenberg > Cc: Antlr interest; Etools; Adrian Simionescu > Subject: RE: [antlr-interest] Bug report: Unexplainable "no viable > alternative" > Importance: Low > > Hello Jim, G

[il-antlr-interest: 26634] Re: [antlr-interest] Difference between v and v.st

2009-11-03 Thread Jim Idle
e just said p > +=policyType and then, in the call policyType={$p} ? Are they equiv.? > > > > 2009/11/4 Jim Idle > Because u+= means you are passing in a collection, not a > StringTemplate reference. > > Jim > > > On Nov 3, 2009, at 20:10, Nauman wrote: > >

[il-antlr-interest: 26632] Re: [antlr-interest] Difference between v and v.st

2009-11-03 Thread Jim Idle
Because u+= means you are passing in a collection, not a StringTemplate reference. Jim On Nov 3, 2009, at 20:10, Nauman wrote: > Dear all, > > I am having trouble understanding the difference between two methods > for setting template attributes. Consider the following: > > policy: ^(POLICY

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

2009-11-03 Thread Jim Idle
I think that the issue is more likely something to do with your lexer specification. You should not need to worry about having lots of keywords, so one of the other rules must be causing the huge expansion. For instance I have problems with the complete lexer for TSQL, which has more keywords t

[il-antlr-interest: 26625] Re: [antlr-interest] Bug report: Unexplainable "no viable alternative"

2009-11-03 Thread Jim Idle
It isn’t a bug; this happens because your grammar is ambiguous without all those myriad syntactic predicates. Take those all out and left factor your rules so that there are no ambiguities. Also, remove that k=1 option and let ANTLR work it out, then use ANTLRWorks syntax diagrams to work out wh

[il-antlr-interest: 26630] Re: [antlr-interest] C Target: Reverse look up of tokens for error reporting

2009-11-03 Thread Jim Idle
You have to supply a function that takes the token as defined by the expecting element, perform a switch() on it and supply the text you really want. It is pretty easy but there is no automated way to do it and if we had the alias stuff that was in v2 it really doesn't save you any typing. Bett

[il-antlr-interest: 26608] Re: [antlr-interest] Cannot launch the debugger Time-out waiting to connect to the remote parser

2009-11-02 Thread Jim Idle
This quite often happens because of a bad lexer that has an empty rule: R : ; This will currently generate code that just hangs trying to match nothing forever. Then it will time out on the connection (which happens in the parser not the lexer) and forever after, you will not be able to c

[il-antlr-interest: 26599] Re: [antlr-interest] CSharp Targets

2009-11-02 Thread Jim Idle
CSharp2 target works just fine, so perhaps you have not downloaded the .Net/C# runtime for CSharp2 and added the .dlls as references to your project? JIm > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Andrew More >

[il-antlr-interest: 26598] Re: [antlr-interest] Cannot display rule "X" because start state is not found

2009-11-02 Thread Jim Idle
> rules, I get "Cannot display rule "X" because start state is not found" > > comment > : !(DIGIT | LETTER | SPACE)* > ; Remove the ! from this rule. Looks like you are trying to type a v2 grammar into AntlrWorks, which is for v3 grammars, which is probably what you should be using

[il-antlr-interest: 26588] Re: [antlr-interest] [C target] constructex bug

2009-10-31 Thread Jim Idle
That isn't generally true, so I would need an example to investigate this :-) Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Þðóøêèí Ìèõàèë > Sent: Saturday, October 31, 2009 4:12 PM > To: antlr-inter...@antlr.o

[il-antlr-interest: 26582] Re: [antlr-interest] Please help with a grammar issue

2009-10-30 Thread Jim Idle
You don’t want to try and express this in the grammar at all, nor have predicates etc as you will not get good error messages or recovery. All you need do in fact is code the grammar to accept any number of each option, keep track of how many you find and issue good semantic errors such as

[il-antlr-interest: 26572] Re: [antlr-interest] Getting started with ANTLR 3, IDEs and Maven

2009-10-30 Thread Jim Idle
how to remedy > this? > > Thanks! > > -Original Message- > > > Message: 1 > Date: Wed, 28 Oct 2009 15:14:47 -0700 > From: "Jim Idle" > Subject: [antlr-interest] Getting started with ANTLR 3, IDEs and Maven > To: "antlr-inter...@antlr.org&qu

[il-antlr-interest: 26571] Re: [antlr-interest] Getting started with ANTLR 3, IDEs and Maven

2009-10-30 Thread Jim Idle
desired archetype does not exist (org.antlr:antlr3-maven- > archetype:1.0) > > Since I'm a Maven neophyte, can you offer a suggestion on how to remedy > this? > > Thanks! > > -Original Message- > > > Message: 1 > Date: Wed, 28 Oct 2009 15:14:4

[il-antlr-interest: 26568] Re: [antlr-interest] How to create many AST trees from one rule

2009-10-30 Thread Jim Idle
Fold it up into the top rule like this: decl : t=type i+=ID ( COMMA i+=ID )* SEMI -> ^(DECL $i $t)+ ; However, do you have some particular reason to make the tree look like that? It is just as

[il-antlr-interest: 26554] [antlr-interest] Getting started with ANTLR 3, IDEs and Maven

2009-10-28 Thread Jim Idle
Hi, Prompted by a request earlier this week for a sample of how to use Antlr grammars within IDEs and builds, I thought I would create a Maven Archetype that can create a sample Antlr project seemingly out of thin air. If you are willing to use Maven, or already do so, then this saves you a

[il-antlr-interest: 26553] Re: [antlr-interest] Sources for 3.2 under Maven repo

2009-10-28 Thread Jim Idle
Sources are now deployed - will take up to 4 hours for Maven central to pick these up though. Jim From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Fady Moussallam Sent: Wednesday, October 28, 2009 5:44 AM To: antlr-inter...@antlr.org Subject

[il-antlr-interest: 26550] Re: [antlr-interest] Sources for 3.2 under Maven repo

2009-10-28 Thread Jim Idle
Should have been there so I will check why they are not - I probably missed a step in the release... Jim From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Fady Moussallam Sent: Wednesday, October 28, 2009 5:44 AM To: antlr-inter...@antlr.org Sub

[il-antlr-interest: 26541] Re: [antlr-interest] [C Target] Bug in AST walking , implementing control flow

2009-10-27 Thread Jim Idle
From: Mohamed Yousef [mailto:harrr...@gmail.com] Sent: Tuesday, October 27, 2009 7:19 AM To: Jim Idle Subject: Re: [antlr-interest] [C Target] Bug in AST walking , implementing control flow 2009/10/27 Jim Idle It probably is a bug I am afraid. 3.2.1 will be a 'catch up'

[il-antlr-interest: 26539] Re: [antlr-interest] Can somebody give me the very simplest example of grammar to AST to StringTemplate output

2009-10-27 Thread Jim Idle
No problem - I find it difficult to get too worked up about it. Now, that example would be great if people would take the time to search past posts before they posed a question here ;-) Jim From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Nave

[il-antlr-interest: 26537] Re: [antlr-interest] dumbie question: Are there any examples ofbuilding antlr programs using different IDEs?

2009-10-27 Thread Jim Idle
The easiest way with Netbeans is to use a Maven build, which Netbeans has very good built in support for. That way you just configure where the .g files are and leave the rest to Maven, which will work both from the command line and from the IDE (not just Netbeans IDE either). It takes a bit o

[il-antlr-interest: 26536] Re: [antlr-interest] [C Target] Bug in AST walking , implementing control flow

2009-10-27 Thread Jim Idle
It probably is a bug I am afraid. 3.2.1 will be a 'catch up' release to ensure that everything works in C. You can make calls to LT() directly and so on though. For index and related properties you should use the method calls rather than the fields directly, but if you know you will never ov

[il-antlr-interest: 26532] Re: [antlr-interest] How to access member of CommonTree subclass

2009-10-26 Thread Jim Idle
On Behalf Of Kaleb Pederson > Sent: Monday, October 26, 2009 4:35 PM > To: antlr-inter...@antlr.org > Subject: Re: [antlr-interest] How to access member of CommonTree > subclass > > On Monday 26 October 2009 04:18:21 pm Jim Idle wrote: > ... > > > I'm working with

[il-antlr-interest: 26527] Re: [antlr-interest] How to access member of CommonTree subclass

2009-10-26 Thread Jim Idle
> -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Kaleb Pederson > Sent: Monday, October 26, 2009 3:55 PM > To: antlr-inter...@antlr.org > Subject: [antlr-interest] How to access member of CommonTree subclass > > I'm

[il-antlr-interest: 26524] Re: [antlr-interest] Setup question

2009-10-26 Thread Jim Idle
Have you tried looking on the Downloads page for ANTLR and downloading the .Net runtime? Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Bill Steer > Sent: Monday, October 26, 2009 2:44 PM > To: antlr-inter...@a

[il-antlr-interest: 26522] Re: [antlr-interest] Can somebody give me the very simplest example of grammar to AST to StringTemplate output

2009-10-26 Thread Jim Idle
Here are some snippets from a tree parser using option output=template: Straight creation from a rewrite and list: statements : s+=statement_comment* -> statements(stats={$s}) ; Just passing a result up the rule chain (don't have rules return an empty $st): rule

[il-antlr-interest: 26507] Re: [antlr-interest] What causes org.antlr.runtime.EarlyExitException ?

2009-10-25 Thread Jim Idle
Easiest way to see this is to look at the generated code - it will make more sense to you. But it means you have something like ( X Y Z)+ and have failed to match any sequence of it. Look at where the exception is thrown and it will show you where in your grammar this is happening. You can then

[il-antlr-interest: 26506] Re: [antlr-interest] [C target] can't debug parser

2009-10-25 Thread Jim Idle
It is possibly out of sync with the debugging protocol. The 3.2.1 release is intended to be a 'target sync up' release to catch up with everything that was put in 3.2 for the release. I will make sure that debugging in C is working in that release. However, I have always found it at least as us

[il-antlr-interest: 26460] Re: [antlr-interest] c target - bug

2009-10-23 Thread Jim Idle
Is this ANTLR 3.2? Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Þðóøêèí Ìèõàèë > Sent: Friday, October 23, 2009 3:21 AM > To: antlr-inter...@antlr.org > Subject: [antlr-interest] c target - bug > > > line 20

[il-antlr-interest: 26421] Re: [antlr-interest] Using multiple grammars with a single parser

2009-10-21 Thread Jim Idle
This has been covered in previous discussions (use the search), but basically you create tokens that look for dates using code that is sensitive to the locale, which leaves you with a single lexer with a code based match rather than pattern based match. DATE : '#' // Assuming that you delim

[il-antlr-interest: 26420] Re: [antlr-interest] Status of the CSharp3 target and my C# portsof ANTLR and StringTemplate

2009-10-21 Thread Jim Idle
list. Jim From: Sam Harwell [mailto:sharw...@pixelminegames.com] Sent: Tuesday, October 20, 2009 10:26 PM To: Jim Idle; antlr-inter...@antlr.org; stringtemplate-inter...@antlr.org Subject: RE: [antlr-interest] Status of the CSharp3 target and my C# portsof ANTLR and StringTemplate The

[il-antlr-interest: 26419] Re: [antlr-interest] Bytes Limit

2009-10-21 Thread Jim Idle
This is also quite often caused by a poorly specified grammar (especially lexers) causing lots lookahead and states etc. A good way to determine this is to find the DFA in question in the generated source code and see what decisions/rules it is handling. This should help you pin down where thing

[il-antlr-interest: 26403] Re: [antlr-interest] [Antlr + ST] Huge output string - OutOfMemoryError

2009-10-19 Thread Jim Idle
Then you either need to avoid the toString() and use a writer, or see if there is something wrong with your template that is causing infinite recursion etc. Jim From: Hieu Phung [mailto:phungngoch...@gmail.com] Sent: Tuesday, October 20, 2009 11:10 AM To: Jim Idle Cc: antlr-inter

[il-antlr-interest: 26401] Re: [antlr-interest] [c target] memory leaks during error recovery

2009-10-19 Thread Jim Idle
See pervious answer to this question... Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of yurush...@rambler.ru > Sent: Monday, October 19, 2009 2:37 AM > To: antlr-inter...@antlr.org > Subject: [antlr-interest] [c

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

2009-10-19 Thread Jim Idle
antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of David-Sarah Hopwood > Sent: Tuesday, October 20, 2009 6:40 AM > To: antlr-inter...@antlr.org > Subject: Re: [antlr-interest] Semantic predicates > > Jim Idle wrote: > > I don’t think that

[il-antlr-interest: 26399] Re: [antlr-interest] Status of the CSharp3 target and my C# portsof ANTLR and StringTemplate

2009-10-19 Thread Jim Idle
OK - well we can add that easily enough J Why don't we try it? Jim From: Sam Harwell [mailto:sharw...@pixelminegames.com] Sent: Tuesday, October 20, 2009 7:46 AM To: Jim Idle; antlr-inter...@antlr.org; stringtemplate-inter...@antlr.org Subject: RE: [antlr-interest] Status of the CS

[il-antlr-interest: 26398] Re: [antlr-interest] @after doesn't work for C target

2009-10-19 Thread Jim Idle
@after only works with ANTLR 3.2. You can also use exception() with the C target on 3.2 Jim From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Ronghui Yu Sent: Monday, October 19, 2009 3:03 PM To: antlr-inter...@antlr.org Subject: [antlr-interest

[il-antlr-interest: 26382] Re: [antlr-interest] [c target] memory leaks during error recovery

2009-10-19 Thread Jim Idle
It is because you are trying to do things while you parse - another reason to build a tree and THEN operate on the tree. Catch does not need a type in the C target, you can just use: r: Ddd ; catch() { } (assuming 3.2 of ANTLR). The other thing you might do is break up your rule list so

[il-antlr-interest: 26381] Re: [antlr-interest] Combining multiple tokens

2009-10-19 Thread Jim Idle
All you need do is accumulate the text in a stringbuffer: ( s=TOK { sbuf.append($s.text); }) + Then use the string you have accumulated to set the text of an imaginary or even the last TOK (which will be in s). ->IMAGINARY[sbuf.toString()] Should work fine. Jim From: antlr-

[il-antlr-interest: 26380] Re: [antlr-interest] Status of the CSharp3 target and my C# ports of ANTLR and StringTemplate

2009-10-19 Thread Jim Idle
Top posting for Sam's benefit ;-) Not being able to use the Csharp3 target from the standard version of the tool is going to be a turn off for many I think L What is it that your port of the tool has that the standard version does not. I know you have posted some of that, but perhaps we can

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

2009-10-19 Thread Jim Idle
I don’t think that there any bugs here. The gated predicates work fine for me (not that that means there are therefore no bugs ;-), but that it is more likely there is a misuse going on somewhere in the grammar). If you think that there is a bug then you should pin it down to a small piece o

[il-antlr-interest: 26378] Re: [antlr-interest] Which version do I need for a CSharp target and VS 2008

2009-10-19 Thread Jim Idle
u...@gmx.de] > Sent: Monday, October 19, 2009 12:08 AM > To: Jim Idle; antlr-inter...@antlr.org > Subject: Re: [antlr-interest] Which version do I need for a CSharp > target and VS 2008 > > > Johannes, > > > > Is there some trick to getting the CSharp2 runtime

[il-antlr-interest: 26364] Re: [antlr-interest] Which version do I need for a CSharp target and VS 2008

2009-10-17 Thread Jim Idle
11:19 PM > To: Jim Idle; antlr-inter...@antlr.org > Subject: Re: [antlr-interest] Which version do I need for a CSharp > target and VS 2008 > > > Not sure if the Csharp3 target is ready for production yet - I wanted > to > > ask this myself as I would like to switch

[il-antlr-interest: 26363] Re: [antlr-interest] How to make a syntactic predicate exit a rule completely

2009-10-17 Thread Jim Idle
I really think you are beginning to make this way more complicated than it really is. You need to step away from your current pursuit of predicates and so on and go back to fundamentals. You are trying to get the parser to do way more than parser should do. I know it is tempting because it seems

[il-antlr-interest: 26349] Re: [antlr-interest] ANTLR C: Question regarding the portability of generated lexer C code

2009-10-17 Thread Jim Idle
Normally I am in US Pacific, but this week and next I am in the India timezone. Jim From: Lego Haryanto [mailto:legoharya...@gmail.com] Sent: Saturday, October 17, 2009 1:49 PM To: Jim Idle Cc: David-Sarah Hopwood; antlr-inter...@antlr.org Subject: Re: [antlr-interest] ANTLR C: Question

[il-antlr-interest: 26348] Re: [antlr-interest] ANTLR C: Question regarding the portability of generated lexer C code

2009-10-17 Thread Jim Idle
: Lego Haryanto [mailto:legoharya...@gmail.com] Sent: Thursday, October 15, 2009 8:27 PM To: Jim Idle Cc: antlr-inter...@antlr.org Subject: Re: [antlr-interest] ANTLR C: Question regarding the portability of generated lexer C code Jim, thanks for your response ... I know that in the EBCDIC system

[il-antlr-interest: 26346] Re: [antlr-interest] ANTLR C: Question regarding the portability of generated lexer C code

2009-10-17 Thread Jim Idle
009 11:57 AM > To: antlr-inter...@antlr.org > Subject: Re: [antlr-interest] ANTLR C: Question regarding the > portability of generated lexer C code > > Jim Idle wrote: > [...] > > Change the ranges to: > > > > ID: ‘a’..’k’ | ‘l’..’t’ … > > I doubt that

[il-antlr-interest: 26345] Re: [antlr-interest] ANTLR C: Question regarding the portability of generated lexer C code

2009-10-17 Thread Jim Idle
as a gated predicate for your ID rule. Similar care with all your lexer rule specifications will result in EBCDIC compatible, portable C code being generated. Jim From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Jim Idle Sent: Sunday

[il-antlr-interest: 26341] Re: [antlr-interest] Bug or misunderstanding?: missing attribute access on rule scope

2009-10-16 Thread Jim Idle
You need to rewrite the unary operators with imaginary tokens in your parser, which then means your tree parser need not care: unary: PLUS unary -> ^(UPLUS unary) | primary ; Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@

[il-antlr-interest: 26340] Re: [antlr-interest] Which version do I need for a CSharp target and VS 2008

2009-10-16 Thread Jim Idle
Not sure if the Csharp3 target is ready for production yet - I wanted to ask this myself as I would like to switch to it if it is ;-) But I use Csharp2 as the target, and the runtime is on the download pages. Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:ant

[il-antlr-interest: 26339] Re: [antlr-interest] [Antlr + ST] Huge output string - OutOfMemoryError

2009-10-16 Thread Jim Idle
Run Java with - Xmx1500M Or some other option that increases available memory size. However this could point to something that can be better organized in terms of recursion or whatever. You may also consider running Java with a better garbage collector such as: -Xincgc JIm

[il-antlr-interest: 26337] Re: [antlr-interest] String template return val propagation

2009-10-16 Thread Jim Idle
> -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Bill Andersen > Sent: Friday, October 16, 2009 1:22 AM > To: antlr-inter...@antlr.org > Subject: [antlr-interest] String template return val propagation > > Thanks in

[il-antlr-interest: 26338] Re: [antlr-interest] SEEMS NOBODY HERE LIKE TO HELP OTHERS

2009-10-16 Thread Jim Idle
Perhaps you guys are not asking the right questions. There is a tendency for some people to jump straight in to huge grammars without the appropriate practicing on smaller examples (which are provided). I try to answer everyone if I can but I am travelling at the moment and don't have lots of sp

[il-antlr-interest: 26336] Re: [antlr-interest] ANTLR C: Question regarding the portability of generated lexer C code

2009-10-16 Thread Jim Idle
Well, you could pay me to make an EBCDIC version ;) However, there is in practice no problem with mixing this – I have done it before on zOS. I think that you need to look at this in the opposite light in that it isn’t that ANTLR code isn’t portable, but your lexer specification (and the fact

[il-antlr-interest: 26335] Re: [antlr-interest] ANTLR C: Question regarding the portability of generated lexer C code

2009-10-16 Thread Jim Idle
directly I am afraid. So, compile the code with ASCII assumptions and feed the EBCDIC as 8 bit Unicode and you will be fine. Jim From: Lego Haryanto [mailto:legoharya...@gmail.com] Sent: Thursday, October 15, 2009 8:27 PM To: Jim Idle Cc: antlr-inter...@antlr.org Subject: Re: [antlr

[il-antlr-interest: 26332] Re: [antlr-interest] accepting nested code blocks

2009-10-16 Thread Jim Idle
Yes you can do it - you probably need to keep state flags and either trigger lexer rules based upon them or perhaps better would be to trigger an external lexer. The main problem is error recovery - what does your lexer do if the Javascript does not have perfectly matched '{' '}' and so the lex

[il-antlr-interest: 26285] Re: [antlr-interest] caseSensitive = false in C taget ??

2009-10-15 Thread Jim Idle
There is. Please read the documentation otherwise there is little point in me writing it ;-) Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Indhu Bharathi > Sent: Tuesday, October 13, 2009 4:28 PM > To: Þðóøêèí

[il-antlr-interest: 26284] Re: [antlr-interest] caseSensitive = false in C taget ??

2009-10-15 Thread Jim Idle
There is no such option in ANTLR 3. If you want to use ANTLR 3 target, then read the documentation and also the article on case insensitive parsing (which is in the Wiki), which tells you how to do this. You may wish to read up on ANTLR 3 before starting though. Jim > -Original Message---

[il-antlr-interest: 26283] Re: [antlr-interest] ANTLR C: Question regarding the portability of generated lexer C code

2009-10-15 Thread Jim Idle
ANTLR works internally with 32 bit Unicode (UTF32), not EBCDIC, even if it is in 8 bit mode. So you need to convert the EBCDIC to Unicode 8 bits and use the ‘ASCII’ input stream. A simple way to do this would be to write your own EBCDIC input stream that just converted to Unicode code points (es

[il-antlr-interest: 26282] Re: [antlr-interest] [LEXER] Unwanted behaviour ?

2009-10-15 Thread Jim Idle
LO LE and PURETEXT are ambiguous - you should eb getting warnings about that (which yuou should not ignore). Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Martin Potier > Sent: Monday, October 12, 2009 5:59 P

[il-antlr-interest: 26281] Re: [antlr-interest] [SOLVED] ANTLR3 C runtime in HP-UX

2009-10-15 Thread Jim Idle
What version of HPUX is this? I have it fixed for the versions I have come across I think. HPUX is such a bag of nails; it is always the odd man out. Jim From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Hugo Picado Sent: Monday, October 12, 200

[il-antlr-interest: 26176] Re: [antlr-interest] Python 3 grammar for C target

2009-10-09 Thread Jim Idle
Cool contribution - perhaps the first for the C target :-) Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Terence Parr > Sent: Saturday, October 10, 2009 3:23 AM > To: Ales Teska > Cc: antlr-inter...@antlr.org >

[il-antlr-interest: 26175] Re: [antlr-interest] Whitespace question

2009-10-09 Thread Jim Idle
27;s okay to let a few illegal > >constructs through and catch them further down the line. I was > >just hoping that I would be able to easily write a tighter > >grammar. > > As Jim Idle is fond of pointing out, it's often better to make the > grammar fairly t

[il-antlr-interest: 26155] Re: [antlr-interest] Bug in ANTLR C runtime - Incorrect getCharPositionInLine on first line

2009-10-08 Thread Jim Idle
Yes - you have to special case it. However, you only ever come across this while developing really ;-) Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Ales Teska > Sent: Thursday, October 08, 2009 5:33 PM > To:

[il-antlr-interest: 26154] Re: [antlr-interest] MSBUILD/Vs2008

2009-10-08 Thread Jim Idle
Sent: Thursday, October 08, 2009 5:21 PM > To: Gavin Lambert; Jim Idle; antlr-inter...@antlr.org > Subject: RE: [antlr-interest] MSBUILD/Vs2008 > > I thought about that, but then you run into a problem if you want the > generated source files visible in your project. As soon as you a

[il-antlr-interest: 26136] Re: [antlr-interest] C++ grammar for ANTLR v3 ?

2009-10-07 Thread Jim Idle
I think that the OP meant is there a set of grammars that parse C++, but are written for ANTLR v3 rather than v2? As far as I know, the answer is no. C++ is not the easiest thing to parse and it cannot be done purely with grammar. Jim > -Original Message- > From: antlr-interest-boun...

[il-antlr-interest: 26135] Re: [antlr-interest] MSBUILD/Vs2008

2009-10-07 Thread Jim Idle
True True ANTLRTreePrinter.g3 ANTLRTreePrinter.g3 Sam From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Jim Idle Sent: Wednesday, October 07, 2009 1:15 PM To: antlr-inter...@antlr.org Subject: [antlr-interest]

[il-antlr-interest: 26132] [antlr-interest] MSBUILD/Vs2008

2009-10-07 Thread Jim Idle
Has anyone worked out the exact configuration for MSBUILD instructions for adding in to csproj files in VS2008 with the C# target? The Wiki version may have worked fine for VS2005 but in VS2008 it does not encapsulate dependencies properly and the .cs files get compiled before the .g files, whic

[il-antlr-interest: 26130] Re: [antlr-interest] [c target] tracing

2009-10-07 Thread Jim Idle
Debug should work OK from a parser but tree parser debugging probably isn't too hot. Up to press nobody has really needed to use it. The trace option isn't really implemented but the conditionals are still in the template so that I can come back to it some day. In general I find it more useful

[il-antlr-interest: 26128] Re: [antlr-interest] Help writing a particular semantic predicate

2009-10-07 Thread Jim Idle
Actually, your approach is wrong here. What you want to aim at in the parser is to accept all the syntax that can possibly be good but if it is not, can be rejected using semantic checks later. This is because a good semantic error such as "not able to use 'v2' when you utilize 'b'" is much more

[il-antlr-interest: 26107] Re: [antlr-interest] Using tree parsers in the C Target

2009-10-06 Thread Jim Idle
Download the examples tar and look at the tree parsers in the C examples :-) Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Heiko Folkerts > Sent: Tuesday, October 06, 2009 5:15 AM > To: antlr-inter...@antlr.org

[il-antlr-interest: 26094] Re: [antlr-interest] How to do "not" in a syntactic predicate?

2009-10-05 Thread Jim Idle
Use a semantic predicate rather than syntactic. You possibly need a bated predicate here too: { input.LA(1) == A && input.LA(2) != B}?=> However, if you need that kind of syntactic predicate, then I suggest you may be approaching your problem incorrectly. Jim From: antlr-interest-

[il-antlr-interest: 26077] Re: [antlr-interest] [SPAM] Re:Re: help on rewritting the tree

2009-10-04 Thread Jim Idle
as a root node for each element of a compound and you probably only need the imaginary as a root for the whole reference. Jim From: antlr_bill [mailto:antlr_b...@yeah.net] Sent: Sunday, October 04, 2009 10:07 AM To: Jim Idle Cc: antlr-inter...@antlr.org Subject: [SPAM] Re:Re: [antlr

[il-antlr-interest: 26075] Re: [antlr-interest] help on rewritting the tree

2009-10-04 Thread Jim Idle
a: b -> ^(V b) ; b : part (DOT^ part )* ; part: ID( ABC )? ; Jim From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of antlr_bill Sent: Sunday, October 04, 2009 8:56 AM To: antlr-inter...@antlr.org Subject: [antlr-interest] help on rewrittin

[il-antlr-interest: 26064] Re: [antlr-interest] Using ANTLR on Vista

2009-10-03 Thread Jim Idle
It's just Java, so: Java -jar \path\to\downloaded\jar\antlr-3.2.jar mygrammar.g please read the instructions on the Wiki. Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Charles Jenkins > Sent: Saturday, Octobe

[il-antlr-interest: 26047] Re: [antlr-interest] Disambiguating Decimal and Integer '.'

2009-10-01 Thread Jim Idle
Wiki - front page - lexing for dot, range, . http://www.antlr.org/wiki/display/ANTLR3/Lexer+grammar+for+floating+point%2C+dot%2C+range%2C+time+specs This grammar also caters for 999.toString() type things as it comes from JavaFX. Jim > -Original Message- > From: antlr-interest-boun

[il-antlr-interest: 26037] Re: [antlr-interest] Modifying and printing AST under C target

2009-10-01 Thread Jim Idle
You don't need to do that. There is a user field in the COMMON_TREE node that you can use to store a pointer to your own data - this is much simpler. If you use a custom node, it must really embed COMMON_TREE, which embeds BASE_TREE. Each of these has super pointers to the larger structure but

[il-antlr-interest: 26036] Re: [antlr-interest] Left factor? Syntactic predicates? Or another solution?

2009-10-01 Thread Jim Idle
You would have to use ((object object)=>object)? Which is expensive and is using a hammer to crack a nut ;-) Jim From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Naveen Chawla Sent: Thursday, October 01, 2009 5:24 AM To: Gavin Lambert Cc: antlr

[il-antlr-interest: 26035] Re: [antlr-interest] Left factor? Syntactic predicates? Or another solution?

2009-10-01 Thread Jim Idle
You are trying to be too literal and imply context in the rules. Complement has an optional indirectObject, which is a nounPhrase, followed by an object, which is also a nounPhrase, don't use two rule to ask for the same token sequence and then make one of them an optional lead in. Use object ob

[il-antlr-interest: 26023] Re: [antlr-interest] [c target] how to change "#include " in generated .h parser file?

2009-09-30 Thread Jim Idle
On 09/30/2009 06:03 AM, Юрушкин Михаил wrote: > How to change "#include " in generated .h parser file? > can i change this path in grammar options? > > You don't - just use teh correct -I option on the compile line. Jim List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: htt

[il-antlr-interest: 26022] Re: [antlr-interest] Maven vs AntlrWorks Generated Sources

2009-09-30 Thread Jim Idle
On 09/30/2009 02:47 AM, Luca Li Greci wrote: > > You said that when the grammar is under src/main/antlr3* *the maven > plugin automatically picks up all grammar defined under any > subdirectories (such as org/mycompany/myproduct) so that the maven > parameters include, lib, and the @parser::head

[il-antlr-interest: 26021] Re: [antlr-interest] Maven vs AntlrWorks Generated Sources

2009-09-30 Thread Jim Idle
On 09/30/2009 02:46 AM, Luca Li Greci wrote: > > > 2009/9/29 Jim Idle <mailto:j...@temporal-wave.com>> > > On 09/29/2009 12:35 PM, Luca Li Greci wrote: >> >> >> ... > > > Hi - you should avoid setting up your own structure under sou

[il-antlr-interest: 26003] Re: [antlr-interest] Maven vs AntlrWorks Generated Sources

2009-09-29 Thread Jim Idle
On 09/29/2009 12:35 PM, Luca Li Greci wrote: > > > org.antlr > antlr3-maven-plugin > 3.1.3-1 > > > parser > generate-sources > > antlr > > > src/main/resources/antlr3 > src/main/resources/antlr3*/org/mycompany/myproduct* > target/generated-sources/antlr3 > > ***/myGrammar*.g* > > > > >

  1   2   3   4   5   6   7   8   9   >