[antlr-interest] hyperslabs
Monty Zukowski
monty at codetransform.com
Tue Nov 29 08:18:48 PST 2005
Henry Butowsky wrote:
> Hi Guys,
> Im using a vary basic C grammer for a scientific application
> I want to be able to use "hyper-slabs" on the left and right hand side
> of an assignment statement
>
> var1(expr,expr,expr)
>
> The relevent grammar is:
>
> assign_statement:
> hyper_slb ASSIGN^ expr SEMI!
> ;
>
>
> hyper_slb: VAR_ID (arg_list)?
> ;
>
> arg_list
> : LPAREN! expr ( COMMA! expr )* RPAREN!
> { #arg_list = #( [ARG_LIST, "arg_list"], #arg_list ); }
> ;
>
>
> so for say temperaure(2,3,10*2)=100;
> I want to get the tree to be something like
>
> ( = temperature ( arg_list (20),(3), (*(10,2) ) ) 100)
>
> At the momnet Im only getting only the first argument in the tree.
> Any Ideas ?
Yeah, what's your tree grammar?
Also, it would be good to print out the the tree you actually are
producing using toStringList (or is it toStringTree)?
Monty
More information about the antlr-interest
mailing list