public ExprToken(ExprTokenType tokenType, byte value) { if (tokenType == ExprTokenType.VARIABLE) { throw new Exception("Token type cannot be VARIABLE with a byte value."); } TokenType = tokenType; Value = value; AssemblerVariable = null; }
public ExprToken(IAssemblerVariable assemblerVariable) { TokenType = ExprTokenType.VARIABLE; Value = 0; AssemblerVariable = assemblerVariable ?? throw new ArgumentNullException(nameof(assemblerVariable)); }
public void DefineVariable(string variableName, IAssemblerVariable compilerVariable) { _definedVariables.Remove(variableName); _definedVariables.Add(variableName, compilerVariable); }