public Instructions MakeVariable(string variableName, Type variableType) { instructionTree.AddBranch( new SlimTree().AddBranchValue("step1").AddBranchValue("make").AddBranchValue(variableName). AddBranchValue(variableType.FullName)); return(this); }
protected static Tree <string> ParameterTree(Tree <string> input, int startingIndex) { var result = new SlimTree(); for (int i = startingIndex; i < input.Branches.Count; i++) { result.AddBranch(input.Branches[i]); } return(result); }
public Tree <string> Compose(TypedValue instance) { var list = instance.Value as IList ?? new List <object>(); var tree = new SlimTree(); foreach (object value in list) { tree.AddBranch(Processor.Compose(value)); } return(tree); }
static SlimTree ReadList(DelimitedString input) { var count = int.Parse(input.ReadTo(":")); var result = new SlimTree(); for (var i = 0; i < count; i++) { var itemLength = int.Parse(input.ReadTo(":")); result.AddBranch(Read(input.Read(itemLength, 1))); } return(result); }
static SlimTree ReadList(string input) { int length = int.Parse(input.Substring(0, 6)); var result = new SlimTree(); int start = 7; for (int i = 0; i < length; i++) { int itemLength = int.Parse(input.Substring(start, 6)); start += 7; result.AddBranch(Read(input.Substring(start, itemLength))); start += itemLength + 1; } return(result); }