> -----Ursprüngliche Nachricht-----
> Von: "jack zhang" <[EMAIL PROTECTED]>
> Gesendet: 18.09.08 23:58:03
> An: [EMAIL PROTECTED]
> Betreff: Re: [antlr-interest] White space needed in the parsing.
>
>
> Thx. In this case, what does => and -> means?
> I guess -> means it will will be matched in the TreeWalker's rule : (
> Something like:)
>
-> means give the following tree as result of the (parser) rule. So it will be
matched in the TreeWalker's rule for a simple lexer-parser-treewalker grammar,
right.
=> is a syntactic predicate and means: match the following only if you see this
in advance, i.e. (abc) => def means match def only if you see abc. This is
useful to resolve ambiguities in a grammar at the cost of slowing down the
parsing (read the Definitive ANTLR Handbook on this, it's very well explained
there).
>
> expr returns [String s]
> : ^(STRING[$text]) {s=$test;}
>
> Is that correct ?
> Then what does
> (WORD+)=>WORD+
>
> means?
So this means, if the parser sees some words it should match the words. It is
absolutly unnecessary for this grammar, imho, since there are no ambiguities.
>
> Thx !
> --- On *Thu, 9/18/08, $B8~2m(B *<[EMAIL PROTECTED]> wrote:
> From: $B8~2m(B <[EMAIL PROTECTED]>
> Subject: Re: [antlr-interest] White space needed in the parsing.
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Date: Thursday, September 18, 2008, 2:42 PM
>
> Hi,
> If you have AST, you would wanna this in parser:
> string : ( (WORD+)=>WORD+ | SingleQSTRING |
> DoubleQSTRING)->^(STRING[$text]);
>
> hope this make happy.
>
_________________________________________________________________________
In 5 Schritten zur eigenen Homepage. Jetzt Domain sichern und gestalten!
Nur 3,99 EUR/Monat! http://www.maildomain.web.de/?mc=021114
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---