internal override void EmitStmt(ILGenerator ilg) { Stmt.Emit(ilg); }
internal FixedStmt(Token t, DeclStmt decl, Stmt s) : base(t) { Decl = decl; Stmt = s; }
internal static IfStmt Bound(Expr cond, Stmt sTrue, Stmt sFalse) { return(new IfStmt(null, cond, sTrue, sFalse)); }
internal ScopeStmt(Token t, Stmt s) : base(t) { Stmt = s; }
internal UsingStmt(Token t, Expr e, Stmt s) : base(t) { Expr = e; Stmt = s; }
internal TryStmt(Token t, Stmt s, CatchBlock[] cb, FinallyBlock fb) : base(t) { Stmt = s; Catches = cb; Finally = fb; }
internal FinallyBlock(Token t, Stmt s) : base(t) { Stmt = s; }
internal ForStmt(Token t, VarDecl d, Token dir, Expr final, Expr step, Stmt s) : this(t, dir, final, step, s) { ForDecl = d; }
public override string ToString() => "FOR " + (AssignExpr?.ToString() ?? ((ForDecl is ImpliedVarDecl ? "VAR " : "LOCAL ") + ForDecl.ToString())) + " " + Dir.Type + " " + Final + (Step != null ? " STEP " + Step : "") + "\n " + Stmt.ToString().Replace("\n", "\n ") + "\nEND FOR";
private ForStmt(Token t, Token dir, Expr final, Expr step, Stmt s) : base(t) { ForDecl = null; AssignExpr = null; Dir = dir; Final = final; Step = step; Stmt = s; }
internal ForStmt(Token t, AssignExpr a, Token dir, Expr final, Expr step, Stmt s) : this(t, dir, final, step, s) { AssignExpr = a; }
public override string ToString() => "REPEAT\n " + Stmt.ToString().Replace("\n", "\n ") + "\nUNTIL " + Cond.ToString();
internal RepeatStmt(Token t, Expr cond, Stmt s) : base(t, cond, s) { }
internal WhileStmt(Token t, Expr cond, Stmt s) : base(t) { Cond = cond; Stmt = s; }
internal SwitchBlockType(Token t, Token n, TypeExpr type, Expr when, Stmt s) : base(t, s) { Name = n; Type = type; When = when; }
internal ForeachStmt(Token t, VarDecl d, Expr e, Stmt s) : base(t) { ForDecl = d; Expr = e; Stmt = s; }
public override string ToString() => Token.Type + " " + Name + " AS " + Type + (When != null ? "WHEN " + When : "") + "\n " + Stmt?.ToString().Replace("\n", "\n ");
public override string ToString() => "FOREACH " + (ForDecl is ImpliedVarDecl ? "VAR " : "") + ForDecl.ToString() + " IN " + Expr + "\n " + Stmt.ToString().Replace("\n", "\n ") + "\nEND FOREACH";
internal CatchBlock(Token t, Token name, TypeExpr type, Expr when, Stmt s) : base(t) { Name = name; Type = type; When = when; Stmt = s; }
internal IfStmt(Token t, Expr cond, Stmt si, Stmt se) : base(t) { Cond = cond; StmtIf = si; StmtElse = se; }
internal SequenceStmt(Token t, Stmt s, Token n, StmtBlock r, StmtBlock f) : base(t) { Stmt = s; Name = n; Recover = r; Finally = f; }
internal DoCaseStmt(Token t, CaseBlock[] cases, Stmt otherwise) : base(t) { Cases = cases; Otherwise = otherwise; }
internal LockStmt(Token t, Expr key, Stmt s) : base(t) { Key = key; Stmt = s; }
internal CaseBlock(Token t, Expr cond, Stmt s) : base(t) { Cond = cond; Stmt = s; }
internal UsingStmt(Token t, DeclStmt decl, Stmt s) : base(t) { Decl = decl; Stmt = s; }
internal SwitchBlock(Token t, Stmt s) : base(t) { Stmt = s; }
internal Script(Token t, Stmt s) : base(t) { Body = s; }
internal SwitchBlockExpr(Token t, Expr e, Expr when, Stmt s) : base(t, s) { Expr = e; When = when; }
internal Codeblock(IList <IdExpr> p, Stmt l) : base(null) { Params = p; Body = l; }
internal override void Emit(ILGenerator ilg) { ilg.BeginFinallyBlock(); Stmt.Emit(ilg); }