public Node ExpSimple() { Node nodo = null; switch (CurrentToken) { case TokenCategory.FLOTANTE: nodo = new Flotante() { GetToken = Expect(TokenCategory.FLOTANTE) }; break; case TokenCategory.DUP: nodo = new Dup() { GetToken = Expect(TokenCategory.DUP) }; nodo.Add(ExpSimple()); break; case TokenCategory.BRACKET_OPEN: nodo = ExpSum(); break; default: Console.WriteLine("Switch"); throw new SyntaxError(); } return(nodo); }
public Node Simple() { if (CurrentToken == Token.FLOAT) { var floa = new Float(); floa.lexeme = lex.curlex; //floa.lexeme = CurrentToken.lexeme; Console.WriteLine(floa.lexeme); //Console.WriteLine(floa.lexeme); //floa.AnchorToken = //Console.WriteLine("aqui4"); Expect(Token.FLOAT); //var exp1 = MaxList(); ////console.writeLine(CurrentToken); return(floa); } if (CurrentToken == Token.DUP) { var dup = new Dup(); //dup.AnchorToken = //Console.WriteLine("aqui5"); Expect(Token.DUP); var exp1 = Simple(); dup.Add(exp1); return(dup); } else if (CurrentToken == Token.OPEN) { Expect(Token.OPEN); var dup = MaxList(); //dup.AnchorToken = //Console.WriteLine("aqui6"); //xpect(Token.DUP); Expect(Token.CLOSE); return(dup); } //console.writeLine("aqui"); throw new SyntaxError(); return(null); }