public override void Accept (InterfaceDeclaration contractDecl)
		{
			IodineInterface contract = new IodineInterface (contractDecl.Name);
			foreach (AstNode node in contractDecl.Children) {
				FunctionDeclaration decl = node as FunctionDeclaration;
				contract.AddMethod (new IodineMethod (methodBuilder.Module, decl.Name, decl.InstanceMethod,
					decl.Parameters.Count, 0));
			}
			methodBuilder.EmitInstruction (contractDecl.Location, Opcode.LoadConst,
				methodBuilder.Module.DefineConstant (contract));
			methodBuilder.EmitInstruction (contractDecl.Location, Opcode.StoreLocal,
				symbolTable.GetSymbol (contractDecl.Name).Index);
		}
Beispiel #2
0
 public void Accept(InterfaceDeclaration contractDecl)
 {
     IodineInterface contract = new IodineInterface (contractDecl.Name);
     foreach (AstNode node in contractDecl.Children) {
         FunctionDeclaration decl = node as FunctionDeclaration;
         contract.AddMethod (new IodineMethod (module, decl.Name, decl.InstanceMethod,
             decl.Parameters.Count, 0));
     }
     module.SetAttribute (contractDecl.Name, contract);
 }