public While_Trad WHILE(ParseTreeNode actual, int cant_tabs) { //WHILE.Rule = RESERV_WHILE + LOGIC_EXPRESION + RESERV_DO + INSTRUCTIONS_BODY; var condition = (new ExpressionTraduccion()).getExpresion(actual.ChildNodes[1]); InstructionTraduccion instructionAST = new InstructionTraduccion(); LinkedList <Instruction_Trad> lista_instrucciones = instructionAST.INSTRUCTIONS_BODY(actual.ChildNodes[3], cant_tabs + 1); return(new While_Trad(condition, new Sentence_Trad(lista_instrucciones), cant_tabs)); }
public Repeat_Trad REPEAT_UNTIL(ParseTreeNode actual, int cant_tabs) { //REPEAT_UNTIL.Rule = RESERV_REPEAT + INSTRUCTIONS + RESERV_UNTIL + LOGIC_EXPRESION + PUNTO_COMA; //SE OBTIENEN LOS VALORES var instrucciones = actual.ChildNodes[1]; var condicion = (new ExpressionTraduccion()).getExpresion(actual.ChildNodes[3]); InstructionTraduccion instructionAST = new InstructionTraduccion(); //OBTENGO LA LISTA DE INSTRUCCIONES LinkedList <Instruction_Trad> lista_instrucciones = instructionAST.ISTRUCCIONES(instrucciones, cant_tabs + 1); //RETORNO EL NUEVO REPEAT-UTIL return(new Repeat_Trad(condicion, new Sentence_Trad(lista_instrucciones), cant_tabs)); }