示例#1
0
        public StatementFlowInitializer(DencProgram program, ClassHeir classHeir)
        {
            Program = program;

            Level   = 0;
            Address = 0;

            Radix     = Program.Architecture.DefaultRadix;
            LastLabel = null;
        }
示例#2
0
        public void Emit(CodeWriter writer, DencProgram program)
        {
            var sb = new StringBuilder();

            var level = writer.BraceLevel;

            var name = program.Architecture.NameClean(ClassName);

            if (ClassBase == "")
            {
                ClassBase = program.ArchitectureElement.ArchType.ToUpperInvariant() + "Class";
            }

            sb.Append(ClassProtection.ToString().ToLowerInvariant());
            sb.Append(" partial class ");
            sb.Append(name);
            sb.Append(" : ");
            sb.Append(ClassBase);

            foreach (var i in Interfaces)
            {
                sb.Append(',');
                sb.Append(i);
            }

            writer.WriteStatementNoSemi(sb);
            writer.UpBrace();

            foreach (var s in StatementList)
            {
                if (s != null)
                {
                    s.Emit(writer, program);
                }
            }


            sb.Append("public ");
            sb.Append(name);
            sb.Append("()");
            writer.WriteStatementNoSemi(sb);
            writer.UpBrace();

            foreach (var s in constructorAdd)
            {
                writer.WriteStatement(s);
            }

            writer.DownBrace();

            writer.BraceLevel = level;
        }
示例#3
0
        public void Setup(DencProgram program, ClassHeir classHeir, IStatement parent, ref StatementFlowInitializer flow)
        {
            Program = program;

            if (classHeir == null)
            {
                flow = new StatementFlowInitializer(program, this);
            }

            flow.Push();

            foreach (var s in StatementList)
            {
                if (s != null)
                {
                    s.Setup(program, this, this, ref flow);
                }
            }

            flow.Pop();
        }
示例#4
0
 public void Setup(DencProgram program, ClassHeir classHeir, IStatement parent, ref StatementFlowInitializer flow)
 {
 }
示例#5
0
 public void Emit(CodeWriter writer, DencProgram program)
 {
 }