public Case CaseSing(ParseTreeNode actual, int can_tabs) { /* CASE.Rule = LOGIC_EXPRESION + DOS_PUNTOS + INSTRUCTIONS;*/ var condicion = expressionAST.getExpresion(actual.ChildNodes[0], can_tabs); var lista_instrucciones = instructionAST.ISTRUCCIONES(actual.ChildNodes[2], can_tabs + 2); var row = actual.ChildNodes[1].Token.Location.Line; var col = actual.ChildNodes[1].Token.Location.Column; return(new Case(condicion, new Sentence(lista_instrucciones), row, col, can_tabs + 1)); }
public Repeat 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 ExpresionAST()).getExpresion(actual.ChildNodes[3], cant_tabs); var row = actual.ChildNodes[0].Token.Location.Line; var col = actual.ChildNodes[0].Token.Location.Column; InstructionAST instructionAST = new InstructionAST(); //OBTENGO LA LISTA DE INSTRUCCIONES LinkedList <Instruction> lista_instrucciones = instructionAST.ISTRUCCIONES(instrucciones, cant_tabs + 1); //RETORNO EL NUEVO REPEAT-UTIL return(new Repeat(condicion, new Sentence(lista_instrucciones), row, col, cant_tabs)); }