private void HandleExtractBlock(char c) { switch (c) { case '\n': throw new ParseException("')' is expected here", this.globalIndex); case '(': this.stack += c; this.bracketCount++; break; case ')': if (this.bracketCount == 0) { RawExpression rawExpression = new RawExpression(this.globalIndex - this.stack.Length, this.stack); this.expressions.Add(new Expression(rawExpression)); this.state = ParseStates.Start; } else { this.bracketCount--; this.stack += c; } break; default: this.stack += c; break; } }
public void Parse(RawExpression rawExpression) { RawExpressionParser parser = new RawExpressionParser(rawExpression); IEnumerable <RawMultiplier> rawMultipliers = parser.Iterator(); foreach (RawMultiplier rawMultiplier in rawMultipliers) { Multiplier multiplier = new Multiplier(rawMultiplier); Expression expression = multiplier.ConvertToExpression(); this.Join(expression); } }
public RawExpressionParser(RawExpression rawExpression) { this.rawExpression = rawExpression; this.reset(); }
public Expression(RawExpression rawExpresion) { this.rawExpression = rawExpresion; this.Parse(rawExpression); }