Permalink
Browse files

Add the FormatStmt class.

  • Loading branch information...
1 parent 885135a commit 087e96b1dc2e4f0a2ddcfe13334f477cf86aac25 Bill Wendling committed Oct 28, 2011
Showing with 36 additions and 2 deletions.
  1. +24 −2 include/flang/AST/Stmt.h
  2. +12 −0 lib/AST/Stmt.cpp
View
@@ -32,10 +32,16 @@ class Stmt {
public:
enum StmtTy {
Program,
+
+ // Specification Part
Use,
Import,
- Implicit,
- Parameter,
+
+ // Implicit Part
+ Implicit,
+ Parameter,
+ Format,
+
Asynchronous,
EndProgram,
Assignment,
@@ -271,6 +277,22 @@ class ParameterStmt : public Stmt {
}
};
+/// FormatStmt -
+///
+class FormatStmt : public Stmt {
+ FormatSpec *FS;
+
+ FormatStmt(SMLoc Loc, FormatSpec *fs, ExprResult StmtLabel);
+public:
+ static FormatStmt *Create(ASTContext &C, SMLoc Loc, FormatSpec *fs,
+ ExprResult StmtLabel);
+
+ static bool classof(const FormatStmt*) { return true; }
+ static bool classof(const Stmt *S) {
+ return S->getStatementID() == Format;
+ }
+};
+
/// AsynchronousStmt - Specifies the asynchronous attribute for a list of
/// objects.
///
View
@@ -139,6 +139,18 @@ ParameterStmt *ParameterStmt::Create(ASTContext &C, SMLoc Loc,
}
//===----------------------------------------------------------------------===//
+// Format Statement
+//===----------------------------------------------------------------------===//
+
+FormatStmt::FormatStmt(SMLoc Loc, FormatSpec *fs, ExprResult StmtLabel)
+ : Stmt(Format, Loc, StmtLabel), FS(fs) {}
+
+FormatStmt *FormatStmt::Create(ASTContext &C, SMLoc Loc, FormatSpec *fs,
+ ExprResult StmtLabel) {
+ return new (C) FormatStmt(Loc, fs, StmtLabel);
+}
+
+//===----------------------------------------------------------------------===//
// Asynchronous Statement
//===----------------------------------------------------------------------===//

0 comments on commit 087e96b

Please sign in to comment.