Write an expression to the screen
Inheritance: Statement
示例#1
0
 public virtual void Visit(Write node)
 {
 }
 void Stmt(out Statement stmt)
 {
     Expression exp = null;
                                      stmt = null;
     int sl = la.line, sc = la.col;
     StatementSequence stmtSeq;
     Token bf;
     switch (la.kind) {
     case 1: {
     AssignStmt(out stmt);
     stmt.AddSequencePoint(sl,sc, t.line,t.col+t.val.Length);
     break;
     }
     case 13: {
     Get();
     stmt = new Skip();stmt.AddSequencePoint(t);
     break;
     }
     case 3: {
     BlockStmt(out stmt);
     break;
     }
     case 18: {
     IfStmt(out stmt);
     break;
     }
     case 22: {
     WhileStmt(out stmt);
     break;
     }
     case 15: {
     ReadStmt(out stmt);
     stmt.AddSequencePoint(sl,sc, t.line,t.col+t.val.Length);
     break;
     }
     case 14: {
     Get();
     Expr(out exp);
     stmt = new Write(exp); stmt.AddSequencePoint(sl,sc, t.line,t.col+t.val.Length);
     break;
     }
     case 25: {
     CallProc(out stmt);
     stmt.AddSequencePoint(sl,sc, t.line,t.col+t.val.Length);
     break;
     }
     case 6: {
     Get();
     bf = t;
     StmtSeq(out stmtSeq);
     Expect(9);
     stmt = stmtSeq;
     stmt.AddSequencePoint(bf);
     stmt.AddSequencePoint(t);
     break;
     }
     default: SynErr(52); break;
     }
 }