public StatementFlowInitializer(DencProgram program, ClassHeir classHeir) { Program = program; Level = 0; Address = 0; Radix = Program.Architecture.DefaultRadix; LastLabel = null; }
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; }
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(); }
public void Setup(DencProgram program, ClassHeir classHeir, IStatement parent, ref StatementFlowInitializer flow) { }
public void Emit(CodeWriter writer, DencProgram program) { }