private static RuleExpression AddWithAnd(BaseLexerRule lhs, BaseExpression rhs) { return AddWithAnd(new SymbolExpression(new LexerRuleModel(lhs)), rhs); }
public Expr(BaseExpression baseExpression) : base(baseExpression) { }
private static RuleExpression AddWithOr(BaseExpression lhs, BaseTerminal rhs) { return AddWithOr( lhs, new SymbolExpression( new LexerRuleModel( new TerminalLexerRule(rhs, rhs.ToString())))); }
private static RuleExpression AddWithOr(BaseExpression lhs, BaseExpression rhs) { var lhsExpression = (lhs as RuleExpression) ?? new RuleExpression(lhs); var rhsExpression = (rhs as RuleExpression) ?? new RuleExpression(rhs); foreach (var symbolList in rhsExpression.Alterations) lhsExpression.Alterations.Add(symbolList); return lhsExpression; }
private static RuleExpression AddWithOr(BaseExpression lhs, BaseLexerRule rhs) { return AddWithOr(lhs, new SymbolExpression(new LexerRuleModel(rhs))); }
private static RuleExpression AddWithAnd(BaseExpression lhs, BaseExpression rhs) { var expression = lhs as RuleExpression ?? new RuleExpression(lhs); expression.Alterations[expression.Alterations.Count - 1].Add(rhs); return expression; }
private static RuleExpression AddWithAnd(BaseTerminal lhs, BaseExpression rhs) { return AddWithAnd( new SymbolExpression( new LexerRuleModel( new TerminalLexerRule(lhs, lhs.ToString()))), rhs); }
private void AddWithAnd(BaseExpression baseExpression) { if (Alterations.Count == 0) Alterations.Add(new List<BaseExpression>()); Alterations[Alterations.Count - 1].Add(baseExpression); }
public RuleExpression(BaseExpression baseExpression) : this() { AddWithAnd(baseExpression); }