Skip to content

Commit

Permalink
Add the FormatStmt class.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Wendling committed Oct 28, 2011
1 parent 885135a commit 087e96b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
26 changes: 24 additions & 2 deletions include/flang/AST/Stmt.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ class Stmt {
public: public:
enum StmtTy { enum StmtTy {
Program, Program,

// Specification Part
Use, Use,
Import, Import,
Implicit,
Parameter, // Implicit Part
Implicit,
Parameter,
Format,

Asynchronous, Asynchronous,
EndProgram, EndProgram,
Assignment, Assignment,
Expand Down Expand Up @@ -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 /// AsynchronousStmt - Specifies the asynchronous attribute for a list of
/// objects. /// objects.
/// ///
Expand Down
12 changes: 12 additions & 0 deletions lib/AST/Stmt.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -138,6 +138,18 @@ ParameterStmt *ParameterStmt::Create(ASTContext &C, SMLoc Loc,
return new (C) ParameterStmt(Loc, NC, CE, StmtLabel); return new (C) ParameterStmt(Loc, NC, CE, StmtLabel);
} }


//===----------------------------------------------------------------------===//
// 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 // Asynchronous Statement
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
Expand Down

0 comments on commit 087e96b

Please sign in to comment.