@@ -131,8 +131,11 @@ class ExpressionAnalyzer {
131131 bool CheckIntrinsicSize (TypeCategory, std::int64_t size);
132132
133133 // Manage a set of active implied DO loops.
134- bool AddImpliedDo (parser::CharBlock, int );
134+ bool AddImpliedDo (parser::CharBlock, int kind );
135135 void RemoveImpliedDo (parser::CharBlock);
136+
137+ // When the argument is the name of an active implied DO index, returns
138+ // its INTEGER kind type parameter.
136139 std::optional<int > IsImpliedDo (parser::CharBlock) const ;
137140
138141 Expr<SubscriptInteger> AnalyzeKindSelector (common::TypeCategory category,
@@ -141,7 +144,7 @@ class ExpressionAnalyzer {
141144 MaybeExpr Analyze (const parser::Expr &);
142145 MaybeExpr Analyze (const parser::Variable &);
143146 MaybeExpr Analyze (const parser::Designator &);
144- MaybeExpr Analyze (const parser::DataStmtConstant &);
147+ MaybeExpr Analyze (const parser::DataStmtValue &);
145148
146149 template <typename A> MaybeExpr Analyze (const common::Indirection<A> &x) {
147150 return Analyze (x.value ());
@@ -241,6 +244,7 @@ class ExpressionAnalyzer {
241244 MaybeExpr Analyze (const parser::BOZLiteralConstant &);
242245 MaybeExpr Analyze (const parser::NamedConstant &);
243246 MaybeExpr Analyze (const parser::NullInit &);
247+ MaybeExpr Analyze (const parser::DataStmtConstant &);
244248 MaybeExpr Analyze (const parser::Substring &);
245249 MaybeExpr Analyze (const parser::ArrayElement &);
246250 MaybeExpr Analyze (const parser::CoindexedNamedObject &);
@@ -420,17 +424,19 @@ class ExprChecker {
420424 bool Walk (const parser::Program &);
421425
422426 bool Pre (const parser::Expr &x) {
423- AnalyzeExpr (context_, x);
427+ exprAnalyzer_. Analyze ( x);
424428 return false ;
425429 }
426430 bool Pre (const parser::Variable &x) {
427- AnalyzeExpr (context_, x);
431+ exprAnalyzer_. Analyze ( x);
428432 return false ;
429433 }
430- bool Pre (const parser::DataStmtConstant &x) {
431- AnalyzeExpr (context_, x);
434+ bool Pre (const parser::DataStmtValue &x) {
435+ exprAnalyzer_. Analyze ( x);
432436 return false ;
433437 }
438+ bool Pre (const parser::DataImpliedDo &);
439+
434440 bool Pre (const parser::CallStmt &x) {
435441 AnalyzeCallStmt (context_, x);
436442 return false ;
@@ -445,28 +451,29 @@ class ExprChecker {
445451 }
446452
447453 template <typename A> bool Pre (const parser::Scalar<A> &x) {
448- AnalyzeExpr (context_, x);
454+ exprAnalyzer_. Analyze ( x);
449455 return false ;
450456 }
451457 template <typename A> bool Pre (const parser::Constant<A> &x) {
452- AnalyzeExpr (context_, x);
458+ exprAnalyzer_. Analyze ( x);
453459 return false ;
454460 }
455461 template <typename A> bool Pre (const parser::Integer<A> &x) {
456- AnalyzeExpr (context_, x);
462+ exprAnalyzer_. Analyze ( x);
457463 return false ;
458464 }
459465 template <typename A> bool Pre (const parser::Logical<A> &x) {
460- AnalyzeExpr (context_, x);
466+ exprAnalyzer_. Analyze ( x);
461467 return false ;
462468 }
463469 template <typename A> bool Pre (const parser::DefaultChar<A> &x) {
464- AnalyzeExpr (context_, x);
470+ exprAnalyzer_. Analyze ( x);
465471 return false ;
466472 }
467473
468474private:
469475 SemanticsContext &context_;
476+ evaluate::ExpressionAnalyzer exprAnalyzer_{context_};
470477};
471478} // namespace Fortran::semantics
472479#endif // FORTRAN_SEMANTICS_EXPRESSION_H_
0 commit comments