Пример #1
0
        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(module, decl.Name, decl.InstanceMethod,
                                                    decl.Parameters.Count, 0));
            }
            module.SetAttribute(contractDecl.Name, contract);
        }
Пример #2
0
        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);
        }