예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SubroutineBuilder"/> class.
 /// </summary>
 /// <param name="symbol">The symbol of the method or constructor that's being translated.</param>
 /// <param name="isConstructor">True if a constructor is being translated, false otherwise.</param>
 /// <param name="constructorClass">If this translates a constructor, then this is the class that's being constructed, otherwise this is null.</param>
 /// <param name="parameters">The parameters of the method or constructor.</param>
 /// <param name="body">The body.</param>
 /// <param name="context">The context.</param>
 /// <param name="originalNode">The Roslyn node.</param>
 public SubroutineBuilder(
     IMethodSymbol symbol,
     bool isConstructor,
     INamedTypeSymbol constructorClass,
     List <ParameterSharpnode> parameters,
     BlockSharpnode body,
     TranslationContext context,
     SyntaxNode originalNode
     )
 {
     this.ConstructorClass = constructorClass;
     this.MethodSymbol     = symbol;
     this.IsConstructor    = isConstructor;
     this.Parameters       = parameters;
     this.BodySharpnode    = body;
     this.Context          = context;
     this.OriginalNode     = originalNode;
 }
예제 #2
0
 public MethodSharpnode(MethodDeclarationSyntax method) : base(method)
 {
     this.methodDeclarationSyntax = method;
     this.Parameters = method.ParameterList.Parameters.Select(parameterSyntax => new ParameterSharpnode(parameterSyntax)).ToList();
     this.Body       = new BlockSharpnode(method.Body);
 }