Hi, everyone.
I am doing a job about modifying AST of a SQL like language generated by
ANTLR3.2 parser. However, when I use deleteChild function of Tree class, I
can’t delete the first and last child of the tree, while the others can be
deleted successfully. I was confused by this problem, Could s
On Sun, 2010-08-08 at 20:50 -0400, Kevin J. Cummings wrote:
> On 08/08/2010 08:35 PM, Ken Klose wrote:
> > Thanks for replying.
> >
> > 2. is not a valid PRICE. PRICE should have at least 1 digit following the
> > '.'. In the context of the string that I am trying to match "2." doesn't
> > have
On 08/08/2010 08:35 PM, Ken Klose wrote:
> Thanks for replying.
>
> 2. is not a valid PRICE. PRICE should have at least 1 digit following the
> '.'. In the context of the string that I am trying to match "2." doesn't
> have any particular significance, it is neither an INTEGER nor a PRICE. It
>
Thanks for replying.
2. is not a valid PRICE. PRICE should have at least 1 digit following the
'.'. In the context of the string that I am trying to match "2." doesn't
have any particular significance, it is neither an INTEGER nor a PRICE. It
is simply an INTEGER following by an SYMBOL token.
-- Original Message (Sunday, August 08, 2010 6:42:55 PM) From: Ken
Klose --
Subject: [antlr-interest] How does INTEGER+ '.' INTEGER+ match "2."?
> INTEGER: DIGIT+;
> PRICE: INTEGER '.' INTEGER;
Integer and price are ambiguous and, if "2." is a valid price, need to
make the decimal field
I'm an ANTLR noob constructing a grammar to parse a data file that is a mix
of structured data and unstructured text. At various points in this data
file there are entire lines of free form text that I need to associate with
the previously matched data record. I am having difficulty.
I've distill
Greetings!
passing the FROM tree down the rule set doesn't seem too bad to me.
DISCLAIMER: i can barely spell C# and certainly know nothing whatsoever
about LINQ --- so i probably have mis-understood something crucial.
On Sun, 2010-08-08 at 19:10 +0100, Luis Pureza wrote:
> Hi,
>
> I'm writing
First of all, you should absolutely not be using exception handling for flow
control. If you are, there's a critical design error involved and you should
fix it before worrying about other things. Second, the way Java handles
exceptions is different from the way the CLR handles them. The CLR builds
Hi,
I'm writing a grammar to parse a language similar to C#'s LINQ*. For example:
from obj in list
where obj.attribute > 200
select obj.attribute * 100
Notice that, unlike regular SQL, the FROM clause appears before the
SELECT and WHERE clauses.
To parse this I've written the following rules:
On Sun, 2010-08-08 at 17:02 +0100, Alex Storkey wrote:
> Thanks!
>
> Now I'm getting the error:
> [fatal] rule expression has non-LL(*) decision due to recursive rule
> invocations reachable from alts 1,2. Resolve by left-factoring or using
> syntactic predicates or using backtrack=true option.
>
Most of the uses of Antlr I have seen show temporary use of ASTs. I
mean temporary here in that usually the AST is built, used and discarded
in a single step.
I have a particular usage where I am generating SQL statements and
really I could pre-build large chunks of the resulting SQL AST up-front
Thanks!
Now I'm getting the error:
[fatal] rule expression has non-LL(*) decision due to recursive rule
invocations reachable from alts 1,2. Resolve by left-factoring or using
syntactic predicates or using backtrack=true option.
Which I guess kinda makes sense, but how do I go about sorting it? J
Greetings!
the ^ meta-operator in the suffix position is a tree construction
operation and is NOT valid for tree recognition. you should be getting a
warning similar to:
warning(149): treeTest.g:0:0: rewrite syntax or operator with no output
option; setting output=AST
or if you have already set
I'm having a problem that hopefully someone on this list can shed some light on.
I've implemented a tree-based interpreter in C# on .Net for a DSL using ANTLR.
I've used Terrence Parr's "Language Implementation Patterns" book for guidance.
In his chapter on tree-based interpreters, he used a t
Okay, sorry to keep posting but I've managed to get the antlrworks debugger
working on my tree grammar and I have discovered the problem.
It seems like instead of the rule *expression* consuming the MINUS symbol,
the minus symbol is ignore by the expression rule and consumed by the
*term*rule, spe
Thank you all for your replies. It worked. :-)
On Fri, Aug 6, 2010 at 8:33 PM, Junkman wrote:
> Jim Idle wrote:
>> You can just do this:
>>
>>
>> ddd: a=TOKEN^ B C D { $a.type = INDEX; } ;
>>
>> Jim
>>
>
> Typical C programmer mentality. :-)
>
> Best,
>
> J
>
> List: http://www.antlr.org/mailman
16 matches
Mail list logo