[antlr-interest] StringTemplate: Infinite Recursion in anonymousconditional template.

Swapnil Kashikar swapnil.kashikar at gmail.com
Thu Apr 27 19:07:20 PDT 2006


Thanks Terence,
I had to try out a few rearrangements of the conditional and anonymous  templates but finally I could make it work without infinite recursion.

I have been able to learn, start using and be productive with stringtemplate in a matter of weeks. Its a superb little tool.

I look forward to using antlr v3 with integrated ST and antlrworks.

Regards,
Swapnil

    > Hi,
    >
    > I am parsing PL/SQL code using antlr and transforming it using   
    > StringTemplate 2.3b6 .
    > Could someone please help me with fixing the error below (Obtained  
    > with the setLintMode output from stringtemplate):
    > ------------
    > exception: java.lang.IllegalStateException: infinite recursion to  
    > <anonymous([s])@9> referenced in <plsql_block([type_declaration,  
    > functions, procedures, code, exception_handlers, into_clause, pb]) 
    > @104>; stack trace:
    > <anonymous([s])@9>, references=[s, s, LPAREN]>
    > <plsql_block([type_declaration, functions, procedures, code,  
    > exception_handlers, into_clause, pb])@104>, attributes= 
    > [code=<statement()@105>, pb], references=[LPAREN, type_declaration,  
    > functions, procedures, code]>
    > <else_subtemplate([])@138>, references=[s, LPAREN]>
    > <anonymous([s])@9> (start of recursive cycle)
    > ...
    > ------------
    
    This means that somehow an inner block contains itself.  Mostly  
    likely a cycle in your data structure injected into the tempaltes.   
    Can u print them not using ST correctly (using a recursive routine)?
    
    Ter
    



More information about the antlr-interest mailing list