コード例 #1
0
        public static T Clone <T>(T node) where T : INode
        {
            var cloner = new AstCloner();
            var clone  = cloner.Visit(node);

            cloner.UpdateReferences(clone);
            return((T)clone);
        }
コード例 #2
0
ファイル: NativeMethods.cs プロジェクト: Beier/Omnium
 public static NativeMethodInvocationExpression AppendToArray(IParseTree context, IExpression array, IExpression value)
 {
     return(new NativeMethodInvocationExpression(
                context,
                nativeMethodName: "Append To Array",
                returnType: AstCloner.Clone((GenericType)array.Type),
                readsState: false,
                changesState: false,
                modifiesControlFlow: false,
                children: new INode[] { array, value }.Where(x => x != null)));
 }
コード例 #3
0
ファイル: NativeMethods.cs プロジェクト: Beier/Omnium
 public static NativeMethodInvocationExpression EmptyArray(IParseTree context, Root root, ITypeNode type)
 {
     return(new NativeMethodInvocationExpression(
                context,
                nativeMethodName: "Empty Array",
                returnType: new GenericType(context, new [] { new ReferenceType(context, root.ListDeclaration), AstCloner.Clone(type) }),
                readsState: false,
                changesState: false,
                modifiesControlFlow: false,
                children: new INode[0]));
 }