Hi Actually, I tried using Hash Map long back. But, it did not work out. And, the main thing is that I just need to store the name of the variables. I do not need the values as I am not executing any actions in the grammar. I am just using it as a language converter. Could anyone please suggest me how to do that looking at my grammar files which are attached. m.g is the main grammar file from which I am creating a tree grammar g.g and from the tree grammar, I am creating a template t.g. And, also I need to generate some temporary variables automatically based on number of input variables. Would it be possible to generate variables automatically and store each variable as a template or using hash map.
Thanks. Swathy On Fri, Mar 5, 2010 at 11:44 AM, Gokulakannan Somasundaram <[email protected]> wrote: > Keep track of things using a hashmap. > insert into the hashmap at expr and retrieve them at stat and pass it to the > template. > > Gokul. > > > On Fri, Mar 5, 2010 at 12:06 AM, swathy murthy <[email protected]> wrote: >> >> Hi >> >> I have attached my grammar file and the template file. Now, I need to >> pass the value of the LITERAL in the rule expr to outer_template() in >> rule stat. >> I am directly using outer_template(var={$LITERAL.text}) but this is >> not working. It gives the error that it cannot find the symbol >> LITERAL.text as it is not present in the rule stat. So, how should I >> pass the argument to the template. >> Help would be appreciated. >> >> Thanks a lot. >> Swathy >> >> >> List: http://www.antlr.org/mailman/listinfo/antlr-interest >> Unsubscribe: >> http://www.antlr.org/mailman/options/antlr-interest/your-email-address >> > >
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
sal_prog_template.stg
Description: Binary data
t.g
Description: Binary data
g.g
Description: Binary data
m.g
Description: Binary data
-- 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.
