예제 #1
0
        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);
        }
예제 #2
0
        public MatchExpression Rewind()
        {
            MatchExpression matchExpression = this;

            while (matchExpression.parent != null)
            {
                matchExpression = matchExpression.parent;
            }
            return(matchExpression);
        }
예제 #3
0
        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());
        }
예제 #4
0
        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);
        }
예제 #5
0
 public MatchExpression Or(string varName, IMatcher condition, object varValue)
 {
     next = ChainedMatchExpression(varName, condition, varValue, LogicOperator.OR, this);
     return(next);
 }