public DoWhileStmt(Stmt body, Expr cond) { this.Body = body; this.Cond = cond; }
public static DefaultStmt Create(Stmt stmt) => new DefaultStmt(stmt);
public WhileStmt(Expr cond, Stmt body) { this.Cond = cond; this.Body = body; }
private DefaultStmt(Stmt stmt) { this.Stmt = stmt; }
public static Stmt Create(Expr expr, Stmt stmt) => new CaseStmt(expr, stmt);
public IfStmt(Expr cond, Stmt stmt) { this.Cond = cond; this.Stmt = stmt; }
private LabeledStmt(String label, Stmt stmt) { this.Label = label; this.Stmt = stmt; }
public DefaultStmt(Stmt stmt) { this.stmt = stmt; }
public IfElseStmt(Expr cond, Stmt true_stmt, Stmt false_stmt) { this.cond = cond; this.true_stmt = true_stmt; this.false_stmt = false_stmt; }
public ForStmt(Option<Expr> init, Option<Expr> cond, Option<Expr> loop, Stmt body) { this.init = init; this.cond = cond; this.loop = loop; this.body = body; }
public CaseStmt(Int32 value, Stmt stmt) { this.value = value; this.stmt = stmt; }
public WhileStmt(Expr cond, Stmt body) { if (!cond.type.IsScalar) { throw new InvalidProgramException(); } this.cond = cond; this.body = body; }
public static FuncDef Create(Option <DeclnSpecs> declnSpecs, Declr declr, Stmt body) => new FuncDef(declnSpecs.IsSome ? declnSpecs.Value : DeclnSpecs.Empty, declr, body as CompoundStmt);
public override void Visit(Stmt stmt) { throw new InvalidOperationException("Cannot visit abstract Stmt"); }
public ForStmt(Option<Expr> init, Option<Expr> cond, Option<Expr> loop, Stmt body) { this.Init = init; this.Cond = cond; this.Loop = loop; this.Body = body; }
public LabeledStmt(String label, Stmt stmt) { this.label = label; this.stmt = stmt; }
public SwitchStmt(Expr expr, Stmt stmt) { this.Expr = expr; this.Stmt = stmt; }
public IfElseStmt(Expr cond, Stmt trueStmt, Stmt falseStmt) { this.Cond = cond; this.TrueStmt = trueStmt; this.FalseStmt = falseStmt; }
public static Stmt Create(Expr cond, Stmt body) => new WhileStmt(cond, body);
private CaseStmt(Expr expr, Stmt stmt) { this.Expr = expr; this.Stmt = stmt; }
public static IReadOnlyList<String> GrabLabels(Stmt stmt) { GotoLabelsGrabber grabber = new GotoLabelsGrabber(); stmt.Accept(grabber); return grabber.Labels; }
public static Stmt Create(Stmt body, Expr cond) => new DoWhileStmt(body, cond);
public static Stmt Create(Option <Expr> init, Option <Expr> cond, Option <Expr> loop, Stmt body) => new ForStmt(init, cond, loop, body);
public FuncDef(String name, Decln.SCS scs, TFunction type, Stmt stmt) { this.name = name; this.scs = scs; this.type = type; this.stmt = stmt; }
public static Stmt Create(Expr expr, Stmt stmt) => new SwitchStmt(expr, stmt);
public static Stmt Create(Option<Expr> init, Option<Expr> cond, Option<Expr> loop, Stmt body) => new ForStmt(init, cond, loop, body);
public static Stmt Create(Expr cond, Stmt stmt) => new IfStmt(cond, stmt);
public static Stmt Create(Expr cond, Stmt trueStmt, Stmt falseStmt) => new IfElseStmt(cond, trueStmt, falseStmt);
public static Stmt Create(String label, Stmt stmt) => new LabeledStmt(label, stmt);
public virtual void Visit(Stmt stmt) {}