Example #1
0
 public DoWhileStmt(Stmt body, Expr cond) {
     this.Body = body;
     this.Cond = cond;
 }
Example #2
0
 public static DefaultStmt Create(Stmt stmt) =>
 new DefaultStmt(stmt);
Example #3
0
 public WhileStmt(Expr cond, Stmt body) {
     this.Cond = cond;
     this.Body = body;
 }
Example #4
0
 private DefaultStmt(Stmt stmt) {
     this.Stmt = stmt;
 }
Example #5
0
 public static Stmt Create(Expr expr, Stmt stmt) =>
 new CaseStmt(expr, stmt);
Example #6
0
 public IfStmt(Expr cond, Stmt stmt) {
     this.Cond = cond;
     this.Stmt = stmt;
 }
Example #7
0
 private LabeledStmt(String label, Stmt stmt) {
     this.Label = label;
     this.Stmt = stmt;
 }
Example #8
0
 public DefaultStmt(Stmt stmt) {
     this.stmt = stmt;
 }
Example #9
0
 public IfElseStmt(Expr cond, Stmt true_stmt, Stmt false_stmt) {
     this.cond = cond;
     this.true_stmt = true_stmt;
     this.false_stmt = false_stmt;
 }
Example #10
0
 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;
 }
Example #11
0
 public CaseStmt(Int32 value, Stmt stmt) {
     this.value = value;
     this.stmt = stmt;
 }
Example #12
0
 public WhileStmt(Expr cond, Stmt body) {
     if (!cond.type.IsScalar) {
         throw new InvalidProgramException();
     }
     this.cond = cond;
     this.body = body;
 }
Example #13
0
 public static FuncDef Create(Option <DeclnSpecs> declnSpecs, Declr declr, Stmt body) =>
 new FuncDef(declnSpecs.IsSome ? declnSpecs.Value : DeclnSpecs.Empty, declr, body as CompoundStmt);
Example #14
0
 public override void Visit(Stmt stmt) {
     throw new InvalidOperationException("Cannot visit abstract Stmt");
 }
Example #15
0
 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;
 }
Example #16
0
 public LabeledStmt(String label, Stmt stmt) {
     this.label = label;
     this.stmt = stmt;
 }
Example #17
0
 public SwitchStmt(Expr expr, Stmt stmt) {
     this.Expr = expr;
     this.Stmt = stmt;
 }
Example #18
0
 public WhileStmt(Expr cond, Stmt body)
 {
     this.Cond = cond;
     this.Body = body;
 }
Example #19
0
 public IfElseStmt(Expr cond, Stmt trueStmt, Stmt falseStmt) {
     this.Cond = cond;
     this.TrueStmt = trueStmt;
     this.FalseStmt = falseStmt;
 }
Example #20
0
 public static Stmt Create(Expr cond, Stmt body) =>
 new WhileStmt(cond, body);
Example #21
0
 private CaseStmt(Expr expr, Stmt stmt) {
     this.Expr = expr;
     this.Stmt = stmt;
 }
Example #22
0
 public DoWhileStmt(Stmt body, Expr cond)
 {
     this.Body = body;
     this.Cond = cond;
 }
Example #23
0
 public static IReadOnlyList<String> GrabLabels(Stmt stmt) {
     GotoLabelsGrabber grabber = new GotoLabelsGrabber();
     stmt.Accept(grabber);
     return grabber.Labels;
 }
Example #24
0
 public static Stmt Create(Stmt body, Expr cond) =>
 new DoWhileStmt(body, cond);
Example #25
0
 private DefaultStmt(Stmt stmt)
 {
     this.Stmt = stmt;
 }
Example #26
0
 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;
 }
Example #28
0
 public SwitchStmt(Expr expr, Stmt stmt)
 {
     this.Expr = expr;
     this.Stmt = stmt;
 }
Example #29
0
 public static Stmt Create(Expr cond, Stmt body) =>
     new WhileStmt(cond, body);
Example #30
0
 public static Stmt Create(Expr expr, Stmt stmt) =>
 new SwitchStmt(expr, stmt);
Example #31
0
 public static Stmt Create(Stmt body, Expr cond) =>
     new DoWhileStmt(body, cond);
Example #32
0
 public IfStmt(Expr cond, Stmt stmt)
 {
     this.Cond = cond;
     this.Stmt = stmt;
 }
Example #33
0
 public static Stmt Create(Option<Expr> init, Option<Expr> cond, Option<Expr> loop, Stmt body) =>
     new ForStmt(init, cond, loop, body);
Example #34
0
 public static Stmt Create(Expr cond, Stmt stmt) =>
 new IfStmt(cond, stmt);
Example #35
0
 public static Stmt Create(Expr expr, Stmt stmt) =>
     new SwitchStmt(expr, stmt);
Example #36
0
 public IfElseStmt(Expr cond, Stmt trueStmt, Stmt falseStmt)
 {
     this.Cond      = cond;
     this.TrueStmt  = trueStmt;
     this.FalseStmt = falseStmt;
 }
Example #37
0
 public static Stmt Create(Expr cond, Stmt stmt) =>
     new IfStmt(cond, stmt);
Example #38
0
 public static Stmt Create(Expr cond, Stmt trueStmt, Stmt falseStmt) =>
 new IfElseStmt(cond, trueStmt, falseStmt);
Example #39
0
 public static Stmt Create(Expr cond, Stmt trueStmt, Stmt falseStmt) =>
     new IfElseStmt(cond, trueStmt, falseStmt);
Example #40
0
 private LabeledStmt(String label, Stmt stmt)
 {
     this.Label = label;
     this.Stmt  = stmt;
 }
Example #41
0
 public static Stmt Create(String label, Stmt stmt) =>
     new LabeledStmt(label, stmt);
Example #42
0
 public static Stmt Create(String label, Stmt stmt) =>
 new LabeledStmt(label, stmt);
Example #43
0
 public static Stmt Create(Expr expr, Stmt stmt) =>
     new CaseStmt(expr, stmt);
Example #44
0
 private CaseStmt(Expr expr, Stmt stmt)
 {
     this.Expr = expr;
     this.Stmt = stmt;
 }
Example #45
0
 public static DefaultStmt Create(Stmt stmt) =>
     new DefaultStmt(stmt);
Example #46
0
 public virtual void Visit(Stmt stmt) {}