public int CreateStruct(Name name, Grammar.ASTNodeDeclStruct declASTNode) { var decl = new DeclStruct(); decl.declASTNode = declASTNode; this.declStructs.Add(decl); var declRef = new DeclReference { kind = DeclReference.Kind.Struct, index = this.declStructs.Count - 1 }; this.declTree.Add(name, declRef); return this.declStructs.Count - 1; }
public int CreatePrimitiveStruct(Name name) { var decl = new DeclStruct(); decl.primitive = true; decl.declASTNode = null; this.declStructs.Add(decl); var declRef = new DeclReference { kind = DeclReference.Kind.Struct, index = this.declStructs.Count - 1 }; this.declTree.Add(name, declRef); return this.declStructs.Count - 1; }
public int CreateStruct(Name name, Grammar.ASTNodeDeclStruct declASTNode) { var decl = new DeclStruct(); decl.declASTNode = declASTNode; this.declStructs.Add(decl); var declRef = new DeclReference { kind = DeclReference.Kind.Struct, index = this.declStructs.Count - 1 }; this.declTree.Add(name, declRef); return(this.declStructs.Count - 1); }
public int CreatePrimitiveStruct(Name name) { var decl = new DeclStruct(); decl.primitive = true; decl.declASTNode = null; this.declStructs.Add(decl); var declRef = new DeclReference { kind = DeclReference.Kind.Struct, index = this.declStructs.Count - 1 }; this.declTree.Add(name, declRef); return(this.declStructs.Count - 1); }
public void PrintStructToConsole(DeclStruct decl, string indentation) { for (var i = 0; i < decl.fieldTypes.Count; i++) { Console.ResetColor(); Console.Out.Write(indentation); Name fieldName; decl.fieldNames.FindByValue(i, out fieldName); Console.Out.Write(fieldName.GetString()); Console.Out.Write(" "); Console.ForegroundColor = ConsoleColor.DarkGray; Console.Out.Write(decl.fieldTypes[i].GetString(this)); Console.ResetColor(); Console.Out.WriteLine(); } }