[il-antlr-interest: 25079] Re: [antlr-interest] LLVM example: wiki or book?

2009-08-06 Thread Terence Parr
I'll try to explain quickly but completely. also I'll explain the LLVM output; i.e., what the mapping is and how LLVM works. Ter On Aug 6, 2009, at 12:15 PM, Martijn Reuvers wrote: > Hey Ter, > > Looks fine to me. =) > Maybe you can explain a bit about why using backtrack here and there, > why

[il-antlr-interest: 25077] Re: [antlr-interest] LLVM example: wiki or book?

2009-08-06 Thread C. Mundi
Llvm is so big it needs several books of its own. I think your audience is best served by your focus on antlr with maybe just an outline of an example offered on the wiki. On 8/5/09, Terence Parr wrote: > Hi Guys, > > Ok, I'm rapidly running into my deadline for the book. by the end of > the

[il-antlr-interest: 25076] [antlr-interest] VS 2008 build setup - Antlr is called unnecessarily when grammar.g hasn't changed

2009-08-06 Thread Andrew Chalmers
I followed the instructions here (http://www.antlr.org/wiki/display/ANTLR3/Integration+with+Development+Environments). My grammar.g has two child (dependent) items, blahLexer.cs and blahParser.cs. When I build my solution, Antlr is called, and correctly rebuilds the lexer and parser, which

[il-antlr-interest: 25074] [antlr-interest] Check for null ?

2009-08-06 Thread Vincent Dupuis
Hello, I would like to know if I need to "check for null" for every optional sub rule return value. Like in the following example: event @init { StringTemplate ddd = new StringTemplate(); StringTemplate iii = new StringTemplate(); String ggg = new String(); } : 'on' n=IDENT (

[il-antlr-interest: 25072] Re: [antlr-interest] revised subject: tree matcher problem with validating semantic predicate

2009-08-06 Thread Terence Parr
When a semantic predicate fails to validate when matching in filter mode, it assumes that the rule is not viable, rewind, and tries the next alternative. Ter On Aug 6, 2009, at 3:08 AM, Tom Smith wrote: > Five more minutes' thought, and I'm no longer sure. =;^) > > There are other kinds of s

[il-antlr-interest: 25071] Re: [antlr-interest] LLVM example: wiki or book?

2009-08-06 Thread Martijn Reuvers
Hey Ter, Looks fine to me. =) Maybe you can explain a bit about why using backtrack here and there, why it would be needed - maybe something about predicates (and the limitations of them, e.g. things not always getting called). Martijn On Thu, Aug 6, 2009 at 1:34 AM, Terence Parr wrote: > Postin

[il-antlr-interest: 25070] Re: [antlr-interest] Whitespace: More than meets the eye?

2009-08-06 Thread Graham Wideman
Hi Sam: >I'd lex $id and id entirely separately, as they are syntactically >distinct entities. $blah is always a variable, a "true" variable, Tempting, but not necessarily the immediate winner because PHP also allows things like: $myvar = 'othervar'; $$myvar = 'xxx'; ... which means

[il-antlr-interest: 25069] Re: [antlr-interest] revised subject: tree matcher problem with validating semantic predicate

2009-08-06 Thread Tom Smith
Five more minutes' thought, and I'm no longer sure. =;^) There are other kinds of semantic predicates that can be used for disabling alternatives. Is it really by design that a validating semantic predicate does not validate when filter=true? On Thu, Aug 6, 2009 at 5:59 AM, Tom Smith wrote: > O

[il-antlr-interest: 25068] Re: [antlr-interest] revised subject: tree matcher problem with validating semantic predicate

2009-08-06 Thread Gavin Lambert
At 09:34 6/08/2009, Tom Smith wrote: >I have narrowed down my problem. The validating semantic >predicate properly throws a FailedPredicateException in >a regular tree grammar, but does not when filter=true. [...] >Am I wrong to expect this? I've never really played with filter=true in tree

[il-antlr-interest: 25067] Re: [antlr-interest] Whitespace: More than meets the eye?

2009-08-06 Thread Sam Barnett-Cormack
Graham Wideman wrote: > Hi Sam, > > Thanks for your comments. More below on your questions: > >> I'm curious as to why you want to sometimes consider whitespace, though. >> Is this a self-designed language, or a specification you're working from >> that makes whitespace 'sometimes' significant

[il-antlr-interest: 25066] Re: [antlr-interest] Whitespace: More than meets the eye?

2009-08-06 Thread Graham Wideman
Hi Sam, Thanks for your comments. More below on your questions: >I'm curious as to why you want to sometimes consider whitespace, though. >Is this a self-designed language, or a specification you're working from >that makes whitespace 'sometimes' significant? > >You example was a function call

[il-antlr-interest: 25065] Re: [antlr-interest] LLVM example: wiki or book?

2009-08-06 Thread Hugo Picado
Hi, I think it is a good "wrapping up" example. It seems to cover the most important things. Regards, Hugo. On Thu, Aug 6, 2009 at 12:34 AM, Terence Parr wrote: > Posting the grammar(s) for you to take a look at. do think this covers it? > It seems like it covers a good deal. I will post the f