public override void Parse(IList <char> input) { Factor = new FactorExpression(); Factor.Parse(input); if (input.Count == 0) { return; } if (input[0] != '^') { return; } input.RemoveAt(0); if (input.Count == 0) { throw new UnexpectedTokenException(); } Power = new PowerExpression(); Power.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); }