Пример #1
0
 public override void Dispatch(ICodeVisitor visitor) {
   CompileTimeConstant labelIndex = new CompileTimeConstant(this.rootClass.GetLabelIndex(this.TargetLabel.Name), this.TargetLabel.SourceLocation);
   labelIndex.SetContainingExpression(this.TargetLabel);
   List<Expression> arguments = new List<Expression>(1);
   arguments.Add(labelIndex);
   IMethodDefinition constructor = Dummy.Method;
   foreach (IMethodDefinition cons in this.rootClass.TypeDefinition.GetMembersNamed(this.Compilation.NameTable.Ctor, false)) {
     constructor = cons; break;
   }
   Expression thisArgument = new CreateObjectInstanceForResolvedConstructor(constructor, arguments, this.SourceLocation);
   //^ assume this.ContainingBlock.ContainingMethodDeclaration != null;
   MethodCall mcall = new ResolvedMethodCall(this.rootClass.MainMethod.MethodDefinition, thisArgument, new List<Expression>(0), this.SourceLocation);
   ExpressionStatement gosub = new ExpressionStatement(mcall);
   gosub.Dispatch(visitor);
 }