Hello! My name is Sunao Furukawa.
I am Japanese.Sorry,I can speak English a little.
I use ANTLRWorks1.2.3.but I cannot debug tree grammar file T1.g.
1.I generated E3.tokens and E3Lexer.java and E3Parser.java from E3.g in
ANTLRWorks.
2.I generated and compiled T1.g(T1.java,T1.tokens),and E3.token
hello,
is it possible to access sub tokens of lexer from a rule ? (sorry for
stupid naming) at the bottom is part of my grammar. i want to re-write
primary rule something like:
primary :
a=ABILITY -> ABILITY[$a.scope, $a.id, ($a.INTEGER |
$a.FLOAT)? ]
| LPAREN! expression
Exceptions handling, Line and Char stream Position
Hi all,
I've written a tree parsing rule, and have few doubts concerning nice
exceptions handling.
I have such thing working:
def_tags
: (a=ID {db.tags.register($ID.text);})*
;
catch[DatabaseAbstractException e]
thanks. that's clearly simpler and better for this case :)
On Mon, Jul 20, 2009 at 12:06 AM, David-Sarah
Hopwood wrote:
> hakan eryargi wrote:
>> hello,
>>
>> below is the main part of my grammar. it's ok but it creates an AST
>> from expression
>>
>> a & b & c -> (& (& a b) c) : an AND node with
Sorry group, perhaps I should have made myself clear. This code is just
skeleton. I just wanted to be sure I was on the right track. I have to add
my actions later.
-Original Message-
From: Patrick Higgins [mailto:patrick1...@yahoo.com]
Sent: Sunday, July 19, 2009 13:45
To: Bryan S Fo
hakan eryargi wrote:
> hello,
>
> below is the main part of my grammar. it's ok but it creates an AST
> from expression
>
> a & b & c -> (& (& a b) c) : an AND node with children c and another
> AND node with children a and b
>
> but i want: (& a b c) : an AND node with tree children
>
> how c
I don't know what your grammar is supposed to be doing, but from the looks of
it, there's a lot of confusion and unfortunately I wouldn't say that you're
"almost done".
Are you using ANTLR because your course asks you to specifically use it and you
have some examples and explanations of how t
When opening a file with ANTLRWorks, it automatically adds one(or more) junk
character to the end of the file.
Attempting to compile that file with those junk characters causes an
"unexpected char: 0x0" error.
Is there any way to avoid having those characters added?
If I remove those characters, c
On Sun, 2009-07-19 at 12:10 -0700, Bryan S Follins wrote:
> I'm almost done with a lesson grammar but I ran into a problem I get an
> error referencing the TOKEN RULE, which is on Line 17 (TOKEN : ID) It also
> references Line 20, where there is a blank before SEPERATOR.
>
> The error reads
I'm almost done with a lesson grammar but I ran into a problem I get an
error referencing the TOKEN RULE, which is on Line 17 (TOKEN : ID) It also
references Line 20, where there is a blank before SEPERATOR.
The error reads: error (line)20.1: groupassign.g(file name) (line)17:8: The
follow
thank you both. it seems ok now :)
so that p+ means keep a list of primary (or whatever) and add primary
to that list at '= primary' points
On Sun, Jul 19, 2009 at 9:22 PM, John B. Brodie wrote:
> Greetings!
>
> On Sun, 2009-07-19 at 21:02 +0300, hakan eryargi wrote:
>> well, i know both trees e
Greetings!
On Sun, 2009-07-19 at 21:02 +0300, hakan eryargi wrote:
> well, i know both trees evaluate to same result, but i want it this
> way for human readability. this will be used for defining requirments
> and later will be presented in a gui. and i guess it's easier to debug
> this way..
>
Hi Michael,
It worked great, thanks for the answer.
Regards,
Hugo.
On Sat, Jul 18, 2009 at 2:12 AM, Michael Bedward
wrote:
> Hello Hugo,
>
> Try this:
>
> BufferedTreeNodeStream nodes = new BufferedTreeNodeStream(myTree);
> LangWalker evaluator = new LangWalker(nodes);
> for(int i = 0; i < 1000
well, i know both trees evaluate to same result, but i want it this
way for human readability. this will be used for defining requirments
and later will be presented in a gui. and i guess it's easier to debug
this way..
so you mean writing experssion as: (just postponing OR for now)
expression
Not sure WHY you would want that buy it is just:
p+=primary (AND p+=primary)* -> ^(AND $p+)
Jim
On Jul 19, 2009, at 7:04 AM, hakan eryargi
wrote:
> hello,
>
> below is the main part of my grammar. it's ok but it creates an AST
> from expression
>
> a & b & c -> (& (& a b) c) : an AND node
hello,
below is the main part of my grammar. it's ok but it creates an AST
from expression
a & b & c -> (& (& a b) c) : an AND node with children c and another
AND node with children a and b
but i want: (& a b c) : an AND node with tree children
how can i make that with a rewrite rule ?
i've
that is meant to work...i have some debugging to do it looks like in
the patternmatching with .* :(
T
On Jul 19, 2009, at 1:41 AM, J. Stephen Riley Silber wrote:
>
> > I tried using a rule like ^( BLOCK .* ASSIGN ASSIGN .* ), but that
> didn't seem to work.
>
> I've recently discovered that .*
2009/7/19 Gavin Lambert
> At 22:39 19/07/2009, LuÃs Reis wrote:
>
>> and that problem still persists... The diagram on the right of ANTLRWorks'
>> interpreter shows MismatchedTokenException(-1!=11)
>>
>
> -1 means EOF, which means that something is consuming to the end of the
> file.
>
> What ha
At 22:39 19/07/2009, Luís Reis wrote:
>and that problem still persists... The diagram
>on the right of ANTLRWorks' interpreter shows
>MismatchedTokenException(-1!=11)
-1 means EOF, which means that something is
consuming to the end of the file.
What happens when you run it through the
debugg
2009/7/19 Gavin Lambert
> At 07:51 19/07/2009, LuÃs Reis wrote:
>
>> STRINGCONST
>> : ('@"' ( options {greedy=false;} : . )* '"') //Accepts lots of stuff,
>> including newlines
>> | ('"' (
>>(
>> '\\' ('\\' | '"' | 'n' | 't' | OCTALCHAR)
>>) | (
>> ~('"'|'\\'|LINEBREAK)
>>
> I tried using a rule like ^( BLOCK .* ASSIGN ASSIGN .* ), but that didn't
> seem to work.
I've recently discovered that .* on the end doesn't seem to work too well. I
think I tried .+ or was it .* followed by UP...no, i think it was ~UP*. I need
to fix this.
Ter
I just tried all of those, t
21 matches
Mail list logo