Hi there; I'm trying to get a scope of variables correspondant to method declaration. but i'm geting this exception:
Exception in thread "main" java.util.EmptyStackException at java.util.Stack.peek(Unknown Source) at BTLParser.decl_var(BTLParser.java:462) at BTLParser.inst_decl(BTLParser.java:727) If i put only one ID it does work; Here is a part of my gramar: decl_var : TAG_START_OPEN 'var' {System.out.println("ambito " + $decl_funcion::ambito);} ':' tipo ids+=ID (',' ids+=ID)* ('=' value)? TAG_EMPTY_CLOSE { System.out.println("Definir un hash map para var con scope"); System.out.println("ref "+$ids.toString() + " in "); } ; decl_funcion scope { String ambito; } : TAG_START_OPEN 'function' tipo_return '::' FN_ID {$decl_funcion::ambito = $FN_ID.text;} ':' lista_params TAG_CLOSE lista_instrucciones TAG_END_OPEN 'function' TAG_CLOSE ; Many thx in advance, -- Marouane 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 -~----------~----~----~----~------~----~------~--~---