Implemented lexer

This commit is contained in:
Clemens-Dautermann 2020-08-15 23:36:29 +02:00
parent cb809bfd29
commit ea26acce4a
34 changed files with 641 additions and 0 deletions

28
Compiler/Token.cs Normal file
View file

@ -0,0 +1,28 @@
using System;
namespace Compiler
{
public class Token
{
public TokenType TokenType { get; set; }
public String Value { get; set; }
public int Length { get; set; }
public Token(TokenType pTokenType)
{
this.TokenType = pTokenType;
}
public override string ToString()
{
if (Value == null)
{
return TokenType.ToString();
}
else
{
return TokenType.ToString() + ":" + Value.ToString();
}
}
}
}