示例#1
0
 //^ ensures this.containingTypeDeclaration == containingTypeDeclaration;
 /// <summary>
 /// A copy constructor that allocates an instance that is the same as the given template, except for its containing type.
 /// </summary>
 /// <param name="containingTypeDeclaration">The containing type of the copied member. This should be different from the containing type of the template member.</param>
 /// <param name="template">The type member to copy.</param>
 //^ [NotDelayed]
 private FunctionDefinition(TypeDeclaration containingTypeDeclaration, FunctionDefinition template)
     : base(containingTypeDeclaration, template)
 {
     this.specifiers = template.specifiers;
       this.callingConvention = template.CallingConvention;
       this.parameters = template.parameters;
       this.isSpec = template.isSpec;
       //^ base;
 }
示例#2
0
 /// <summary>
 /// Allocates a global method definition to correspond to a given global method declaration.
 /// </summary>
 /// <param name="functionDefinition">The global method declaration that corresponds to the definition being allocated.</param>
 internal VccGlobalMethodDefinition(FunctionDefinition functionDefinition)
     : base(functionDefinition)
 {
     this.sourceLocation = functionDefinition.SourceLocation;
 }
示例#3
0
 private IMethodDefinition CreateForwardReferenceToMethodDefinition()
 {
     //TODO: if not compiling an object file give an error
       MethodDeclaration.Flags flags = MethodDeclaration.Flags.External;
       if (this.AcceptsExtraArguments) flags |= MethodDeclaration.Flags.AcceptsExtraArguments;
       FunctionDefinition externFunc = new FunctionDefinition(flags, this.specifiers, this.CallingConvention, TypeMemberVisibility.Public, this.Type, this.Name, this.templateParameters, this.parameters, null, this.isSpec, this.expansion, this.SourceLocation);
       externFunc.SetContainingTypeDeclaration(this.CompilationPart.GlobalDeclarationContainer, false);
       if (this.templateParameters != null) {
     foreach (GenericMethodParameterDeclaration templatePar in this.templateParameters) templatePar.SetDeclaringMethod(externFunc);
       }
       IMethodDefinition result = externFunc.MethodDefinition;
       this.TransferContract(result);
       return result;
 }