protected override void Analys(LexemList lexems) { if (lexems.Count > 2 && lexems[0] is LexemVariable && lexems[1] is LexemOperator && (lexems[1] as LexemOperator).Text == "=") { _variable = lexems[0] as LexemVariable; if (String.IsNullOrEmpty(_variable.Name)) throw new FormatException("Assignable Variable Name is empty"); this.AnalysExpression(lexems.Range(2, lexems.Count - 2)); } else this.AnalysExpression(lexems); }
public LexemVariable Add(string name, LexemValue value) { var variable = new LexemVariable(name, value); _variables.Add(variable); return variable; }