public override void Parse(IList <char> input) { Term = new TermExpression(); Term.Parse(input); if (input.Count == 0) { return; } if (input[0] != '-' && input[0] != '+') { return; } if (input[0] == '-') { IsSubtraction = true; } input.RemoveAt(0); if (input.Count == 0) { throw new UnexpectedTokenException(); } Expression = new ExpressionsExpression(); Expression.Parse(input); }
public override void Parse(IList <char> input) { Power = new PowerExpression(); Power.Parse(input); if (input.Count == 0) { return; } if (input[0] != '*' && input[0] != '/') { return; } if (input[0] == '/') { IsDivision = true; } input.RemoveAt(0); //Term = new TermExpression(); //Term.Parse(input); if (input.Count == 0) { throw new UnexpectedTokenException(); } Term = new TermExpression(); Term.Parse(input); }