Axiom.Compiler.Framework.PrologCompiler.GenerateInitMethod C# (CSharp) Метод

GenerateInitMethod() приватный Метод

private GenerateInitMethod ( CodeTypeDeclaration classType, ArrayList instructions ) : void
classType System.CodeDom.CodeTypeDeclaration
instructions System.Collections.ArrayList
Результат void
        private void GenerateInitMethod(CodeTypeDeclaration classType, ArrayList instructions)
        {
            CodeMemberMethod initMethod = new CodeMemberMethod();
            initMethod.Attributes = MemberAttributes.Private;
            initMethod.Name = "Init";

            initMethod.Statements.Add(new CodeSnippetStatement("ArrayList program = new ArrayList();"));
            initMethod.Statements.Add(new CodeSnippetStatement("machine = new AbstractMachineState(new AMFactory());"));
            initMethod.Statements.Add(new CodeSnippetStatement("AMInstructionSet iset = new AMInstructionSet();"));
            initMethod.Statements.Add(new CodeSnippetStatement("_more = false;"));

            // generate instructions here...
            foreach (AbstractInstruction inst in instructions)
            {
                string statement = GetInstructionStatement(inst);
                initMethod.Statements.Add(new CodeSnippetStatement(statement));
            }

            initMethod.Statements.Add(new CodeSnippetStatement("machine.Initialize(program);"));

            classType.Members.Add(initMethod);
        }