mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 12:30:32 +00:00
25 lines
859 B
C#
25 lines
859 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Cosmos.Compiler.XSharp {
|
|
public class CodeGroup {
|
|
public void Assemble() {
|
|
var xThisType = this.GetType();
|
|
foreach (var xType in xThisType.GetNestedTypes()) {
|
|
if (xType is CodeBlock) {
|
|
var xCtor = xType.GetConstructor(new Type[0]);
|
|
var xBlock = (CodeBlock)(xCtor.Invoke(new Object[0]));
|
|
|
|
// Issue label for the routine
|
|
xBlock.Label = xThisType.Name + "_" + xType.Name;
|
|
// Assemble the routine itself
|
|
xBlock.Assemble();
|
|
// Issue the return for the routine
|
|
xBlock.Return();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|