コード例 #1
0
ファイル: Filter.cs プロジェクト: vosen/UAM.TextProcessing
        private static void changeCommonLeafNodeType(FilterTree tree, int newType, int newOp, int newConst, string newValue)
        {
            if (tree.Type == newType || !tree.IsLeaf)
            {
                return;
            }
            FilterTree op = (FilterTree)tree.Children[0];

            op.Type = newOp;
            if (!(op is SQLTree))
            {
                tree.SetChild(0, new SQLTree(op));
            }
            // do conversions
            FilterTree constant = (FilterTree)tree.Children[0].GetChild(1);

            constant.Type = newConst;
            constant.Text = newValue;
            if (!(constant is SQLTree))
            {
                tree.Children[0].SetChild(1, new SQLTree(constant));
            }
            tree.Type = newType;
            ((FilterTree)tree.Children[0].GetChild(0)).MarkAsDirty();
        }
コード例 #2
0
ファイル: Filter.cs プロジェクト: vosen/UAM.TextProcessing
        public static void ToStringExpr(FilterTree tree)
        {
            if (tree.Type == SQLFilterLexer.STRING_EXPR || !tree.IsLeaf)
            {
                return;
            }

            FilterTree op = (FilterTree)tree.Children[0];

            op.Type = StringPatternLexer.IS;
            if (!(op is StringTree))
            {
                tree.SetChild(0, new StringTree(op));
            }
            // do conversions
            FilterTree constant = (FilterTree)tree.Children[0].GetChild(1);

            constant.Type = StringPatternLexer.TEXT;
            constant.Text = "";
            if (!(constant is StringTree))
            {
                tree.Children[0].SetChild(1, new StringTree(constant));
            }
            tree.Type = SQLFilterLexer.STRING_EXPR;
            ((FilterTree)tree.Children[0].GetChild(0)).MarkAsDirty();
        }
コード例 #3
0
ファイル: Filter.cs プロジェクト: vosen/UAM.TextProcessing
 private static void changeCommonLeafNodeType(FilterTree tree, int newType, int newOp, int newConst, string newValue)
 {
     if (tree.Type == newType || !tree.IsLeaf)
         return;            
     FilterTree op = (FilterTree)tree.Children[0];
     op.Type = newOp;
     if (!(op is SQLTree))            
         tree.SetChild(0, new SQLTree(op));            
     // do conversions
     FilterTree constant = (FilterTree)tree.Children[0].GetChild(1);
     constant.Type = newConst;
     constant.Text = newValue;            
     if (!(constant is SQLTree))
         tree.Children[0].SetChild(1, new SQLTree(constant));
     tree.Type = newType;
     ((FilterTree)tree.Children[0].GetChild(0)).MarkAsDirty();
 }
コード例 #4
0
ファイル: Filter.cs プロジェクト: vosen/UAM.TextProcessing
 public static void ToStringExpr(FilterTree tree)
 {
     if (tree.Type == SQLFilterLexer.STRING_EXPR || !tree.IsLeaf)
         return;
     
     FilterTree op = (FilterTree)tree.Children[0];
     op.Type = StringPatternLexer.IS;
     if (!(op is StringTree))
         tree.SetChild(0, new StringTree(op));
     // do conversions
     FilterTree constant = (FilterTree)tree.Children[0].GetChild(1);
     constant.Type = StringPatternLexer.TEXT;
     constant.Text = "";
     if (!(constant is StringTree))
         tree.Children[0].SetChild(1, new StringTree(constant));
     tree.Type = SQLFilterLexer.STRING_EXPR;
     ((FilterTree)tree.Children[0].GetChild(0)).MarkAsDirty();
 }