示例#1
0
 public PsiAST Clone()
 {
     PsiAST c = new PsiAST(Parent, Value, Type);
     if(Children.Count != 0)
         foreach (PsiAST t in Children)
             c.Add(t.Clone());
     return c;
 }
示例#2
0
        public static PsiAST FromCommonTreeToPsiAST(CommonTree tree)
        {
            PsiAST root = null;
            if (tree != null)
            {
                // Itt megkell még határozni, hogy miylen típusú legyen. (Type.ASTLabel1)
                // Egy esetszétválasztás kell.
                // ...

                switch (tree.Type)
                {
                    case Psimulex:
                        break;
                    default:
                        break;
                }

                root = new PsiAST(null, tree.Text, NodeType.X);

                if (tree.Children != null)
                    foreach (CommonTree child in tree.Children)
                        root.Add(FromCommonTreeToPsiAST(child));
            }
            return root;
        }