Stmt *new_stmt(StmtKind kind, SrcPos pos) { var s = (Stmt *)ast_alloc(sizeof(Stmt)); s->pos = pos; s->kind = kind; return(s); }
Stmt new_stmt(StmtKind kind, SrcPos pos) { var s = new Stmt(); s.pos = pos; s.kind = kind; return(s); }
public StmtState(string regBegin, string regEnd, string memBegin, string memEnd) { this.regBegin = regBegin; this.regEnd = regEnd; this.memBegin = memBegin; this.memEnd = memEnd; stmtKind = StmtKind.Other; indenter = null; }
/// <summary> /// create a new statment node /// </summary> /// <param name="kind"></param> /// <param name="name"></param> /// <param name="Linenum"></param> /// <param name="scope"></param> public TreeNode(StmtKind kind, string name, int Linenum, string scope) : this() { this.NodeKind = NodeKind.stmtK; this.Kind = kind; this.Type = TokenType.NONE; this.Name = name; this.LineNum = Linenum; this.Scope = scope; }
public TreeNode(StmtKind stmtkind) // creates a TreeNode of Stmd kind { childrens = new TreeNode[3]; for (int i = 0; i < 3; i++) { childrens[i] = null; } nodekind = NodeKind.StmtK; this.stmtkind = stmtkind; }
void SetKind(FileWriter writer, StmtKind kind) { if (kind == stmtKind) { return; } indenter?.Dispose(); indenter = null; switch (stmtKind) { case StmtKind.Other: break; case StmtKind.Register: writer.WriteLine(regEnd); break; case StmtKind.Memory: writer.WriteLine(memEnd); break; default: throw new InvalidOperationException(); } switch (kind) { case StmtKind.Other: break; case StmtKind.Register: writer.WriteLine(regBegin); indenter = writer.Indent(); break; case StmtKind.Memory: writer.WriteLine(memBegin); indenter = writer.Indent(); break; default: throw new InvalidOperationException(); } stmtKind = kind; }
TreeNode newStmtNode(StmtKind kind) { TreeNode t = new TreeNode(); int i; if (t == null) { Console.Write("Out of memory error at line %d\n"); } else { for (i = 0; i < MAXCHILDREN; i++) { t.child.Add(null); } t.sibling = null; t.nodekind = NodeKind.StmtK; t.kind.stmt = kind; } return(t); }
internal static void statements(this TextWriter trapFile, Statement stmt, StmtKind kind) { trapFile.WriteTuple("statements", stmt, (int)kind); }
internal static Tuple statements(Statement stmt, StmtKind kind) => new Tuple("statements", stmt, kind);