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