public Sentencia StatementP2(Variable Id) { if (currentToken.Tipo == TipoToken.TK_ASSIGN || currentToken.Tipo == TipoToken.TK_MASIGUAL || currentToken.Tipo == TipoToken.TK_MENOSIGUAL || currentToken.Tipo == TipoToken.TK_PORIGUAL || currentToken.Tipo == TipoToken.TK_ENTREIGUAL) { var Tip = currentToken.Tipo; currentToken = lex.NextToken(); if (currentToken.Tipo == TipoToken.TK_READ) { S_Read sRead = new S_Read(); sRead.var = Id; #region Read currentToken = lex.NextToken(); if (currentToken.Tipo == TipoToken.TK_OPENPAR) { currentToken = lex.NextToken(); if (currentToken.Tipo == TipoToken.TK_CLOSEPAR) { currentToken = lex.NextToken(); if (currentToken.Tipo == TipoToken.TK_FINSENTENCIA) { currentToken = lex.NextToken(); return sRead; } else { throw new Exception("Error Sintactico - Se esperaba simbolo ;"); } } else { throw new Exception("Error Sintactico - Se esperaba simbolo )"); } } else { throw new Exception("Error Sintactico - Se esperaba simbolo ("); } #endregion } else { Expresiones E = Expr(); S_Asignacion sAsignacion = new S_Asignacion(); sAsignacion.id = Id; if (Tip == TipoToken.TK_ASSIGN) sAsignacion.Op = new Igual(); else if (Tip == TipoToken.TK_MASIGUAL) sAsignacion.Op = new MasIgual(); else if (Tip == TipoToken.TK_MENOSIGUAL) sAsignacion.Op = new MenosIgual(); else if (Tip == TipoToken.TK_PORIGUAL) sAsignacion.Op = new PorIgual(); else if (Tip == TipoToken.TK_ENTREIGUAL) sAsignacion.Op = new EntreIgual(); sAsignacion.Valor = E; return sAsignacion; } } else if (currentToken.Tipo == TipoToken.TK_OPENCOR) { currentToken = lex.NextToken(); S_Asignacion sAsignacion = new S_Asignacion(); sAsignacion.id = Id; sAsignacion.id.acces = Expr(); if (currentToken.Tipo == TipoToken.TK_CLOSECOR) { currentToken = lex.NextToken(); Sentencia S = new Sentencia(); S = StatementP2(sAsignacion.id); sAsignacion.Valor = ((S_Asignacion) S).Valor; /*if (currentToken.Tipo == TipoToken.TK_FINSENTENCIA) { currentToken = lex.NextToken(); return sAsignacion; }*/ return sAsignacion; /*else { throw new Exception("Error Sintactico - Se esperaba simbolo ;"); }*/ } else { throw new Exception("Error Sintactico - Se esperaba simbolo ]"); } } else if (currentToken.Tipo == TipoToken.TK_MASMAS || currentToken.Tipo == TipoToken.TK_MENOSMENOS) { S_Asignacion sAsignacion = new S_Asignacion(); sAsignacion.id = Id; if (currentToken.Tipo == TipoToken.TK_MASMAS) sAsignacion.Op = new MasMas(); else if (currentToken.Tipo == TipoToken.TK_MENOSMENOS) sAsignacion.Op = new MenosMenos(); Expresiones Ex = Expr(); sAsignacion.Valor = Ex; return sAsignacion; } else { return null; } }
Sentencia Statement() { try { switch (currentToken.Tipo) { case TipoToken.TK_IF: currentToken = lex.NextToken(); return parseIf(); case TipoToken.TK_FOR: currentToken = lex.NextToken(); return parseFor(); case TipoToken.TK_WHILE: currentToken = lex.NextToken(); return parseWhile(); case TipoToken.TK_CASE: currentToken = lex.NextToken(); return parseSwitch(); case TipoToken.TK_REPEAT: currentToken = lex.NextToken(); return parseDo(); #region variable case TipoToken.TK_VAR: { currentToken = lex.NextToken(); Declaracion ret = VariableDeclarationList(); if (currentToken.Tipo != TipoToken.TK_END) throw new Exception("Se esperaba end."); else { currentToken = lex.NextToken(); return ret; } } #endregion case TipoToken.TK_ID: return parseAssignOrCall(); #region read/print case TipoToken.TK_PRINT: { currentToken = lex.NextToken(); S_Print ret = new S_Print(); ret.Expr = Expr(); return ret; } case TipoToken.TK_READ: { currentToken = lex.NextToken(); if (currentToken.Tipo != TipoToken.TK_ID) throw new Exception("Se esperaba identificador."); else { S_Read ret = new S_Read(); ret.var = new Variable(currentToken.Lexema, AccessList(currentToken.Lexema)); return ret; } } #endregion #region Procedure case TipoToken.TK_VOID: { currentToken = lex.NextToken(); if (currentToken.Tipo != TipoToken.TK_ID) throw new Exception("Se esperaba ID"); else { S_Functions ret = new S_Functions(); ret.Retorno = new Voids(); ret.Var = currentToken.Lexema; currentToken = lex.NextToken(); if (currentToken.Tipo != TipoToken.TK_OPENPAR) throw new Exception("Se esperaba \"(\""); else { currentToken = lex.NextToken(); ret.Campo = VariableDeclarationList(); if (currentToken.Tipo != TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba\")\""); else { currentToken = lex.NextToken(); ret.S = CodeBlock(); return ret; } } } } #endregion #region Function case TipoToken.TK_FUNCTION: { currentToken = lex.NextToken(); if (currentToken.Tipo != TipoToken.TK_ID) throw new Exception("Se esperaba ID"); else { S_Functions ret = new S_Functions(); ret.Var = currentToken.Lexema; currentToken = lex.NextToken(); if (currentToken.Tipo != TipoToken.TK_OPENPAR) throw new Exception("Se esperaba \"(\""); else { currentToken = lex.NextToken(); ret.Campo = VariableDeclarationList(); if (currentToken.Tipo != TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba\")\""); else { currentToken = lex.NextToken(); if (currentToken.Tipo != TipoToken.TK_DOSPUNTOS) throw new Exception("Se esperaba\":\""); else { currentToken = lex.NextToken(); ret.Retorno = ParseType(); ret.S = CodeBlock(); return ret; } } } } } #endregion #region type case TipoToken.TK_TYPE: { currentToken = lex.NextToken(); TypeDef ret = TypeDeclarationList(); if (currentToken.Tipo != TipoToken.TK_END) throw new Exception("Se esperaba end."); else { currentToken = lex.NextToken(); return ret; } } #endregion #region break/continue/return case TipoToken.TK_BREAK: currentToken = lex.NextToken(); return new S_Break(); case TipoToken.TK_CONTINUE: currentToken = lex.NextToken(); return new S_Continue(); case TipoToken.TK_RETURN: { currentToken = lex.NextToken(); S_Return ret = new S_Return(); ret.Expr = Expr(); return ret; } #endregion default: throw new Exception("Sentencia no reconocida."); } } catch (Exception ex) { throw ex; } }
public Sentencia Statement() { if (this.currentToken.Tipo == Lexico.TipoToken.TK_PRINT) { this.currentToken = lex.NextToken(); if (currentToken.Tipo != Lexico.TipoToken.TK_OPENPAR) throw new Exception("Se esperaba un ("); S_Print sprint = new S_Print(); sprint.Expr = Expression(); if (currentToken.Tipo != Lexico.TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba un )"); this.currentToken = lex.NextToken(); if (currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba un ;"); this.currentToken = lex.NextToken(); return sprint; } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_READ) { this.currentToken = lex.NextToken(); if (currentToken.Tipo != Lexico.TipoToken.TK_OPENPAR) throw new Exception("Se esperaba un ("); this.currentToken = lex.NextToken(); if (currentToken.Tipo != Lexico.TipoToken.TK_ID) throw new Exception("Se esperaba un ID"); S_Read sread = new S_Read(); sread.var.id = currentToken.Lexema; this.currentToken = lex.NextToken(); if (currentToken.Tipo != Lexico.TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba un )"); this.currentToken = lex.NextToken(); if (currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba un ;"); this.currentToken = lex.NextToken(); return sread; } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_IF) { S_If sif = new S_If(); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_OPENPAR) throw new Exception("Se esperaba un ("); this.currentToken = lex.NextToken(); sif.Condicion = Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba un )"); this.currentToken = lex.NextToken(); sif.Cierto = CompoundStatement(); sif.Falso = Else(); return sif; } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_WHILE) { S_While swhile = new S_While(); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_OPENPAR) throw new Exception("Se esperaba un ("); this.currentToken = lex.NextToken(); swhile.Condicion = Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba un )"); this.currentToken = lex.NextToken(); swhile.S = CompoundStatement(); return swhile; } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_DO) { S_Do sdo = new S_Do(); this.currentToken = lex.NextToken(); sdo.S = CompoundStatement(); if (this.currentToken.Tipo == Lexico.TipoToken.TK_WHILE) { this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_OPENPAR) throw new Exception("Se esperaba un ("); this.currentToken = lex.NextToken(); sdo.Condicion = Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba un )"); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba un ;"); this.currentToken = lex.NextToken(); return sdo; } else throw new Exception("Se esperaba la palabra reservada WHILE"); } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_FOR) { S_For sfor = new S_For(); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_OPENPAR) throw new Exception("Se esperaba un ("); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_ID) throw new Exception("Se esperaba un ID"); sfor.Var.id = this.currentToken.Lexema; this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_ASSIGN) throw new Exception("Se esperaba el simbolo ="); this.currentToken = lex.NextToken(); sfor.Inicio = Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba un ;"); this.currentToken = lex.NextToken(); sfor.Condicion = Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba un ;"); this.currentToken = lex.NextToken(); sfor.Iteracion = Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba un )"); this.currentToken = lex.NextToken(); sfor.S = CompoundStatement(); return sfor; } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_RETURN) { S_Return sreturn = new S_Return(); this.currentToken = lex.NextToken(); sreturn.Expr=Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba un ;"); this.currentToken = lex.NextToken(); return sreturn; } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_BREAK) { S_Break sbreak = new S_Break(); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba un ;"); this.currentToken = lex.NextToken(); return sbreak; } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_SWITCH) { S_Switch sSwitch = new S_Switch(); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_OPENPAR) throw new Exception("Se esperaba un ("); this.currentToken = lex.NextToken(); sSwitch.Var= Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba una )"); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_OPENLLAVE) throw new Exception("Se esperaba una {"); this.currentToken = lex.NextToken(); sSwitch.Casos= Cases(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_DEFAULT) throw new Exception("Se esperaba la palabra reservada DEFAULT"); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_DOSPUNTOS) throw new Exception("Se esperaba el simbolo :"); this.currentToken = lex.NextToken(); sSwitch.sdefault=StatementList(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_CLOSELLAVE) throw new Exception("Se esperaba una }"); this.currentToken = lex.NextToken(); return sSwitch; } else if (currentToken.Tipo == Lexico.TipoToken.TK_ID) { Sentencia S = new Sentencia(); Variable Id = new Variable(); Id.id= currentToken.Lexema; currentToken = lex.NextToken(); S=StatementP(Id); if (currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba el simbolo ;"); currentToken = lex.NextToken(); return S; } else if (currentToken.Tipo == Lexico.TipoToken.TK_PUBLIC || currentToken.Tipo == Lexico.TipoToken.TK_PRIVATE) { currentToken = lex.NextToken(); Sentencia s = new Sentencia(); s=Declaration(); return s; } else if (currentToken.Tipo == Lexico.TipoToken.TK_INT || currentToken.Tipo == Lexico.TipoToken.TK_FLOAT || currentToken.Tipo == Lexico.TipoToken.TK_CHAR || currentToken.Tipo == Lexico.TipoToken.TK_TRUE || currentToken.Tipo == Lexico.TipoToken.TK_FALSE) { Sentencia s = new Sentencia(); s = Declaration(); return s; } return null; }
Sentencia CompoundStatement() { try { switch (currentToken.Tipo) { case TipoToken.TK_IF: currentToken = lex.NextToken(); return parseIf(); case TipoToken.TK_FOR: currentToken = lex.NextToken(); return parseFor(); case TipoToken.TK_WHILE: currentToken = lex.NextToken(); return parseWhile(); case TipoToken.TK_CASE: currentToken = lex.NextToken(); return parseSwitch(); case TipoToken.TK_REPEAT: currentToken = lex.NextToken(); return parseDo(); case TipoToken.TK_ID: return parseAssignOrCall(); #region read/print/break/continue/return case TipoToken.TK_PRINT: { currentToken = lex.NextToken(); S_Print ret = new S_Print(); ret.Expr = Expr(); return ret; } case TipoToken.TK_READ: { currentToken = lex.NextToken(); if (currentToken.Tipo != TipoToken.TK_ID) throw new Exception("Se esperaba identificador."); else { S_Read ret = new S_Read(); ret.var = new Variable(currentToken.Lexema, AccessList(currentToken.Lexema)); return ret; } } case TipoToken.TK_BREAK: currentToken = lex.NextToken(); return new S_Break(); case TipoToken.TK_CONTINUE: currentToken = lex.NextToken(); return new S_Continue(); case TipoToken.TK_RETURN: { currentToken = lex.NextToken(); S_Return ret = new S_Return(); ret.Expr = Expr(); return ret; } #endregion default: throw new Exception("Sentencia no reconocida."); } } catch (Exception ex) { throw ex; } }
public Sentencia Statement() { try { //Para Declaraciones if (currentToken.Tipo == Lexico.TipoToken.TK_INT || currentToken.Tipo == Lexico.TipoToken.TK_FLOAT || currentToken.Tipo == Lexico.TipoToken.TK_STRUCT || currentToken.Tipo == Lexico.TipoToken.TK_CHAR || currentToken.Tipo == Lexico.TipoToken.TK_VOID || currentToken.Tipo == Lexico.TipoToken.TK_STRING || currentToken.Tipo == Lexico.TipoToken.TK_BOOL) { return DeclaracionesC(); } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_PRINT) { #region this.currentToken = lex.NextToken(); if (currentToken.Tipo != Lexico.TipoToken.TK_OPENPAR) throw new Exception("Se esperaba un ("); this.currentToken = lex.NextToken(); S_Print sprint = new S_Print(); sprint.Expr = Expression(); //this.currentToken = lex.NextToken(); if (currentToken.Tipo != Lexico.TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba un )"); this.currentToken = lex.NextToken(); if (currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba un ;"); this.currentToken = lex.NextToken(); return sprint; #endregion } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_READ) { #region this.currentToken = lex.NextToken(); if (currentToken.Tipo != Lexico.TipoToken.TK_OPENPAR) throw new Exception("Se esperaba un ("); this.currentToken = lex.NextToken(); if (currentToken.Tipo != Lexico.TipoToken.TK_ID) throw new Exception("Se esperaba un ID"); S_Read sread = new S_Read(); sread.var.id = currentToken.Lexema; this.currentToken = lex.NextToken(); if (currentToken.Tipo != Lexico.TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba un )"); this.currentToken = lex.NextToken(); if (currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba un ;"); this.currentToken = lex.NextToken(); return sread; #endregion } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_IF) { #region S_If sif = new S_If(); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_OPENPAR) throw new Exception("Se esperaba un ("); this.currentToken = lex.NextToken(); sif.Condicion = Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba un )"); this.currentToken = lex.NextToken(); sif.Cierto = CompoundStatement(); sif.Falso = Else(); return sif; #endregion } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_WHILE) { #region S_While swhile = new S_While(); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_OPENPAR) throw new Exception("Se esperaba un ("); this.currentToken = lex.NextToken(); swhile.Condicion = Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba un )"); this.currentToken = lex.NextToken(); swhile.S = CompoundStatement(); return swhile; #endregion } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_DO) { #region S_Do sdo = new S_Do(); this.currentToken = lex.NextToken(); sdo.S = CompoundStatement(); if (this.currentToken.Tipo == Lexico.TipoToken.TK_WHILE) { this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_OPENPAR) throw new Exception("Se esperaba un ("); this.currentToken = lex.NextToken(); sdo.Condicion = Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba un )"); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba un ;"); this.currentToken = lex.NextToken(); return sdo; } else throw new Exception("Se esperaba la palabra reservada WHILE"); #endregion } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_FOR) { #region S_For sfor = new S_For(); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_OPENPAR) throw new Exception("Se esperaba un ("); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_ID) throw new Exception("Se esperaba un ID"); sfor.Var.id = this.currentToken.Lexema; this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_ASSIGN) throw new Exception("Se esperaba el simbolo ="); this.currentToken = lex.NextToken(); sfor.Inicio = Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba un ;"); this.currentToken = lex.NextToken(); sfor.Condicion = Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba un ;"); this.currentToken = lex.NextToken(); sfor.Iteracion = Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba un )"); this.currentToken = lex.NextToken(); sfor.Tip = new Entero(); sfor.S = CompoundStatement(); sfor.Tip = new Entero(); return sfor; #endregion } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_RETURN) { #region S_Return sreturn = new S_Return(); this.currentToken = lex.NextToken(); sreturn.Expr = Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba un ;"); this.currentToken = lex.NextToken(); return sreturn; #endregion } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_BREAK) { #region S_Break sbreak = new S_Break(); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba un ;"); this.currentToken = lex.NextToken(); return sbreak; #endregion } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_SWITCH) { #region S_Switch sSwitch = new S_Switch(); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_OPENPAR) throw new Exception("Se esperaba un ("); this.currentToken = lex.NextToken(); sSwitch.Var = Expression(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_CLOSEPAR) throw new Exception("Se esperaba una )"); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_OPENLLAVE) throw new Exception("Se esperaba una {"); this.currentToken = lex.NextToken(); sSwitch.Casos = Cases(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_DEFAULT) throw new Exception("Se esperaba la palabra reservada DEFAULT"); this.currentToken = lex.NextToken(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_DOSPUNTOS) throw new Exception("Se esperaba el simbolo :"); this.currentToken = lex.NextToken(); sSwitch.sdefault = StatementList(); if (this.currentToken.Tipo != Lexico.TipoToken.TK_CLOSELLAVE) throw new Exception("Se esperaba una }"); this.currentToken = lex.NextToken(); return sSwitch; #endregion } else if (this.currentToken.Tipo == Lexico.TipoToken.TK_ID) { #region Sentencia s = SentenciaAssign_LlamaFun(); if (currentToken.Tipo != Lexico.TipoToken.TK_FINSENTENCIA) throw new Exception("Se esperaba un token ;"); this.currentToken = lex.NextToken(); return s; #endregion } return null; } catch (Exception ex) { throw ex; } }