コード例 #1
0
 public ResultTree(string operatorContext)
 {
     operatorContext = operatorContext.ToLower();
     _treeType       =
         _relationalOperatorNames.Contains(operatorContext) ?
         ResultTreeType.RelationalOperator : ResultTreeType.LogicalOperator;
     _typedValue = new TypedValue(-4, operatorContext);
 }
コード例 #2
0
        public ResultTree(ResultBuffer rb)
        {
            ResultTree rt = this;

            foreach (TypedValue tv in rb)
            {
                ResultTree trt;
                switch (GetNodeType(tv, out trt))
                {
                case ResultNodeType.LogicalOperator:
                case ResultNodeType.RelationalOperatorBegin:
                case ResultNodeType.ListBegin:
                    rt = rt.Add(trt);
                    break;

                case ResultNodeType.DottedPairEnd:
                    rt._treeType = ResultTreeType.DottedPair;
                    rt           = rt._owner;
                    break;

                case ResultNodeType.RelationalOperatorEnd:
                case ResultNodeType.ListEnd:
                    rt = rt._owner;
                    break;

                default:
                    rt.Add(trt);
                    if (rt._treeType == ResultTreeType.RelationalOperator)
                    {
                        rt = rt._owner;
                    }
                    break;
                }
            }
            if (_lst.Count == 1)
            {
                rt = _lst[0];
                _lst.Remove(rt);
                _lst.AddRange(rt);
                _treeType   = rt._treeType;
                _typedValue = rt._typedValue;
            }
        }
コード例 #3
0
 public ResultTree()
 {
     _treeType = ResultTreeType.Node;
 }
コード例 #4
0
 public ResultTree(ResultTreeType type)
 {
     _treeType = type;
 }