Hi there! I'm working on a tool that translates from my DSL to source code (e.g. Java). Being an AntLR rookie I was surprised of my good progress, but finally I ran into a problem that needs some experts' opinion :) My language allows to define random distributions for certain values: My parser generates an AST that looks like this: ^(UNIFORM ^(VALUES atom*)). Using output=template and the programming language specific templates I have the following problem: In my tree grammar I have the following rule: ^(UNIFORM ^(VALUES (val+=atom)*)) -> uniform(values={$val}) This matches perfectly and supplies the uniform-template with the according values. As the contained atoms need further parsing and rewriting I thought of inserting a nice ".st" into the rewrite rule: -> uniform(values={$val.st}) I used this before for single values with great results. However in this case I need to further evaluate further rules for each element of the list and then hand it over to the template. An example for these further computations would be the transformation of the separator in floats.
It would be great if somebody had an idea to help me :) Regards, Florian List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/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 il-antlr-interest@googlegroups.com To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---