internal static MatchExpression ChainedMatchExpression(string varName, IMatcher condition, object value, LogicOperator logicOp, MatchExpression parent) { MatchExpression matchExpression = new MatchExpression(varName, condition, value); matchExpression.logicOp = logicOp; matchExpression.parent = parent; return(matchExpression); }
public MatchExpression Rewind() { MatchExpression matchExpression = this; while (matchExpression.parent != null) { matchExpression = matchExpression.parent; } return(matchExpression); }
public override string ToString() { MatchExpression matchExpression = Rewind(); StringBuilder stringBuilder = new StringBuilder(matchExpression.AsString()); while (matchExpression.HasNext()) { matchExpression = matchExpression.next; stringBuilder.Append(matchExpression.AsString()); } return(stringBuilder.ToString()); }
public ISFSArray ToSFSArray() { MatchExpression matchExpression = Rewind(); ISFSArray iSFSArray = new SFSArray(); iSFSArray.AddSFSArray(matchExpression.ExpressionAsSFSArray()); while (matchExpression.HasNext()) { matchExpression = matchExpression.Next(); iSFSArray.AddSFSArray(matchExpression.ExpressionAsSFSArray()); } return(iSFSArray); }
public MatchExpression Or(string varName, IMatcher condition, object varValue) { next = ChainedMatchExpression(varName, condition, varValue, LogicOperator.OR, this); return(next); }