public override Token nextToken()
{
if (lookAhead(1) == '(')
{
consume();
return new Token((int)LogicTokenTypes.LPAREN, "(");
}
else if (lookAhead(1) == ')')
{
consume();
return new Token((int)LogicTokenTypes.RPAREN, ")");
}
else if (lookAhead(1) == ',')
{
consume();
return new Token((int)LogicTokenTypes.COMMA, ",");
}
else if (identifierDetected())
{
// System.Console.WriteLine("identifier detected");
return identifier();
}
else if (char.IsWhiteSpace(lookAhead(1)))
{
consume();
return nextToken();
}
else if ((int)lookAhead(1) == 65535)
{
return new Token((int)LogicTokenTypes.EOI, "EOI");
}
else
{
throw new ApplicationException("Lexing error on character "
+ lookAhead(1));
}
}