And of course the instant I hit send, I figure it out. Never fail. At
least it'll be documented here.
1) Select 'Highlight Decision DFA' from the Grammar menu.
2) Click on one of the highlighted characters.
3) Wait one second for a warning icon to pop up.
4) Click on warning icon to get 'Show De
Hi,
I have started using antlr to catch up my lack of knowledge in
parsers. This is a great product, thanks a lot !
I am trying to create my own DSL, and started very simply with parsing
the following
name: foo;
But got a problem while using antlworks. I get space-related problem:
name:foo; -
WS: (' ' | '\n' | '\r' )+ {$channel=HIDDEN};
This should give you compile error. There must be a ';' immediately
after 'HIDDEN'. ( {$channel=HIDDEN;} )
Are you using tab instead of space in input?
David Cournapeau wrote:
> Hi,
>
> I have started using antlr to catch up my lack of knowledge in
At 19:10 9/04/2009, Indhu Bharathi wrote:
>WS: (' ' | '\n' | '\r' )+ {$channel=HIDDEN};
>
>This should give you compile error. There must be a ';'
>immediately after 'HIDDEN'. ( {$channel=HIDDEN;} )
Python doesn't require semicolon statement terminators, does
it? If not, then what the OP ha
I've made a few posts about this in the past, and it looks like another
one is on the way. I designed a new, much easier, robust, and general
way to make a syntax highlighter from a grammar, and it even allows
clean "stacking" of lexers. As a quick example, my primary grammar
recognizes a block com
On Thu, Apr 9, 2009 at 5:20 PM, Gavin Lambert wrote:
> At 19:10 9/04/2009, Indhu Bharathi wrote:
>>WS: (' ' | '\n' | '\r' )+ {$channel=HIDDEN};
>>
>>This should give you compile error. There must be a ';'
>>immediately after 'HIDDEN'. ( {$channel=HIDDEN;} )
>
> Python doesn't require semicolon sta
Sexy model crushes breasts after starring Young Schoolgirls first Teen
Foto webcamgirl Shooting! private view of me in the form of pictures
and videos !!
access to 1000’s of LIVE SEXY uncensored adult viewing of Home Based
Webcams! http://www.budurl.com/rpyf
If you are at least 18 yrs. old, enter
Thanks a lot for all this Info!
Everything worked.
Regards,
Toby
On Apr 9, 2009, at 6:23 AM, Indhu Bharathi wrote:
> Use '@members' to store 'global' variables.
>
> like
> @members{
> int cnt;
> }
>
> and increase 'cnt' in 'species' production, like
>
> species
> : ret=atom NUMBER?
>
At 20:56 9/04/2009, David Cournapeau wrote:
>> Python doesn't require semicolon statement terminators, does
it?
>
>no, it does not (but adding the semicolon made it work). I did
not
>know the above was supposed to be python code.
In general, anything within {} is target language code
(stat
Aaron Leiby wrote:
Everyone's favorite error!
I'm playing with a subset of the javascript language, but am having
difficulties building a grammar in ANTLR for it. I've pared down one
of my
core problems to the following subset:
expression
: Name (invo
Hi there,
I am still playing with my interpreter for arithmetic expressions.
Now I would like to work with mixed expressions containing integer and
floating point numbers.
When doing so I would like to have the integers automatically
"uppercasted" when
they occur in an expression together wit
ANTLR folks,
I've been using a grammar for years to evaluate infix mathematical
expressions with function calls and things like that. It has performed
beautifully. I recently noticed that some (meaningless) junk at the end
of the expression was sometimes ignored.
For example, this expression shou
Christopher Schultz wrote:
> ANTLR folks,
>
>
> It seems like the most logical fix is to create a new top-level
> production that just says:
>
> return=expr (EOF!)
>
> ...and remove the EOF entirely from my 'expr' production.
>
Yes - that is the correct way to handle that.
Jim
List: http://w
Jim,
On 4/9/2009 11:43 AM, Jim Idle wrote:
> Christopher Schultz wrote:
>> ANTLR folks,
>>
>>
>> It seems like the most logical fix is to create a new top-level
>> production that just says:
>>
>> return=expr (EOF!)
>>
>> ...and remove the EOF entirely from my 'expr' production.
>>
> Yes - tha
I'm looking at the ECMAScript 3 grammar referenced in the grammars
download section on ANTLR.org but located at http://research.xebic.com/es3/.
I don't know how to get the else part of an if/else out of the tree
walker. In the grammar that constructs the tree, the ifStatement rule
looks like thi
Let's hear the details, Sam! :)
Ter
On Apr 9, 2009, at 1:38 AM, Sam Harwell wrote:
> I’ve made a few posts about this in the past, and it looks like
> another one is on the way. I designed a new, much easier, robust,
> and general way to make a syntax highlighter from a grammar, and it
> ev
I'm trying to iterate over a ListDictionary (C# StringTemplate) in a
template and have each list item invoke another template:
DataDefAssign(cols) :=
<<
, type=) }>
>>
The above template does not generate anything. If I inline an
anonymous template instead of trying to invoke the PropDef template
I have two ways of entering an expression to evaluate:
1) =-5+4
2) -5+4
I have written the usual expression evaluator that evaluates the expression
as per 1) above to -1. The problem lies with the second form of input. Since
the parser recognises the "=" OR the "-" as the start of an expression, i
What I've done to fix this is the following in the parser:
// $ ^( IF expression $if_block ^( ELSE $else_block )? )
;
And the following in the tree walker:
ifStatement
: ^( IF expression statement ^( ELSE statement? ) )
;
On Apr 9, 10:13 am, shambo...@gmail.com wrote
Curious. Why not change formula production to
formula
: EQ expression
| expression
;
If for some reason you want to enforce that the input has to start with PLUS
or MINUS then maybe you can rewrite formula production as
formula
: EQ expression
| (PLUS | MINUS)=> expression
;
Thi
Indhu
This is based on how users enter formulas in Excel. It allows you to prefix
a formula with "=", "-" or "+" to indicate it is a formula being entered, so
I have to accomodate it.
I have a rough solution which is to Pre-parse the text and then change the
text to "=-5+4" and then pass the new
Well, in that case the second solution that uses syntactic predicate
should work.
Des Hartman wrote:
> Indhu
>
> This is based on how users enter formulas in Excel. It allows you to
> prefix a formula with "=", "-" or "+" to indicate it is a formula
> being entered, so I have to accomodate it.
Not sure how that would help. If I select the second option because the
recognised Token is "-", how would I pass the whole expression to
"expression"?
Thanks
Des
2009/4/10 Indhu Bharathi
> Well, in that case the second solution that uses syntactic predicate
> should work.
>
>
> Des Hartman
Because the syntactic predicate will look ahead without consuming the
token. PLUS or MINUS will still be unconsumed and can later be consumed
by expression.
Des Hartman wrote:
> Not sure how that would help. If I select the second option because
> the recognised Token is "-", how would I pass t
ah, ok, I understand. I'll have a look at it then. Thanks for the help
Thanks
Des
2009/4/10 Indhu Bharathi
> Because the syntactic predicate will look ahead without consuming the
> token. PLUS or MINUS will still be unconsumed and can later be consumed by
> expression.
>
>
> Des Hartman wro
Hi Behdad,
I'm sorry - I didn't read your question properly. Here is an example
that might be more relevant...
grammar Test;
x returns [List values]
@init {
$values = new ArrayList();
}
: e=y {$values.add($e.value)} (',' e=y {$values.add($e.value)} )*
;
y returns [int va
26 matches
Mail list logo