33 using EntryStmtList = std::list<common::Reference<const parser::EntryStmt>>;
34 using GenericSpecList =
35 std::list<common::Reference<const parser::GenericSpec>>;
39 static std::optional<ProgramTree> Build(
41 static std::optional<ProgramTree> Build(
43 static std::optional<ProgramTree> Build(
45 static std::optional<ProgramTree> Build(
47 static std::optional<ProgramTree> Build(
49 static std::optional<ProgramTree> Build(
51 static std::optional<ProgramTree> Build(
53 static std::optional<ProgramTree> Build(
55 static std::optional<ProgramTree> Build(
59 Program, Function, Subroutine, MpSubprogram, Module, Submodule, BlockData)
60 using Stmt = std::variant<
70 const parser::ExecutionPart *exec =
nullptr)
71 : name_{name}, spec_{spec}, exec_{exec} {}
75 const Stmt &stmt()
const {
return stmt_; }
76 bool isSpecificationPartResolved()
const {
77 return isSpecificationPartResolved_;
79 void set_isSpecificationPartResolved(
bool yes =
true) {
80 isSpecificationPartResolved_ = yes;
84 const parser::ExecutionPart *exec()
const {
return exec_; }
85 std::list<ProgramTree> &children() {
return children_; }
86 const std::list<ProgramTree> &children()
const {
return children_; }
87 const EntryStmtList &entryStmts()
const {
return entryStmts_; }
88 const GenericSpecList &genericSpecs()
const {
return genericSpecs_; }
90 Symbol::Flag GetSubpFlag()
const;
91 bool IsModule()
const;
92 bool HasModulePrefix()
const;
93 Scope *scope()
const {
return scope_; }
94 void set_scope(
Scope &);
102 void AddChild(ProgramTree &&);
106 template <
typename T>
111 template <
typename T>
113 endStmt_ = &stmt.source;
122 const parser::ExecutionPart *exec_{
nullptr};
123 std::list<ProgramTree> children_;
124 EntryStmtList entryStmts_;
125 GenericSpecList genericSpecs_;
126 Scope *scope_{
nullptr};
128 bool isSpecificationPartResolved_{
false};
Definition semantics.h:67
Definition parse-tree.h:3332
Definition parse-tree.h:2936