NODE(parser, AttrSpec)
NODE(parser, BOZLiteralConstant)
NODE(parser, BackspaceStmt)
+ NODE(parser, BasedPointer)
NODE(parser, BasedPointerStmt)
NODE(parser, BindAttr)
NODE(parser::BindAttr, Deferred)
construct<CompilerDirective>("DIR$" >> many(name))) /
endDirective)
-TYPE_PARSER(extension<LanguageFeature::CrayPointer>(
- construct<BasedPointerStmt>("POINTER (" >> objectName / ",", objectName,
- maybe(Parser<ArraySpec>{}) / ")")))
+TYPE_PARSER(extension<LanguageFeature::CrayPointer>(construct<BasedPointerStmt>(
+ "POINTER" >> nonemptyList("expected POINTER associations"_err_en_US,
+ construct<BasedPointer>("(" >> objectName / ",",
+ objectName, maybe(Parser<ArraySpec>{}) / ")")))))
TYPE_PARSER(construct<StructureStmt>("STRUCTURE /" >> name / "/", pure(true),
optionalList(entityDecl)) ||
};
// Legacy extensions
-struct BasedPointerStmt {
- TUPLE_CLASS_BOILERPLATE(BasedPointerStmt);
+struct BasedPointer {
+ TUPLE_CLASS_BOILERPLATE(BasedPointer);
std::tuple<ObjectName, ObjectName, std::optional<ArraySpec>> t;
};
+WRAPPER_CLASS(BasedPointerStmt, std::list<BasedPointer>);
struct Union;
struct StructureDef;
Put("\n");
EndOpenMP();
}
- void Unparse(const BasedPointerStmt &x) {
- Word("POINTER ("), Walk(std::get<0>(x.t)), Put(", ");
- Walk(std::get<1>(x.t));
+ void Unparse(const BasedPointer &x) {
+ Put('('), Walk(std::get<0>(x.t)), Put(","), Walk(std::get<1>(x.t));
Walk("(", std::get<std::optional<ArraySpec>>(x.t), ")"), Put(')');
}
+ void Unparse(const BasedPointerStmt &x) { Walk("POINTER ", x.v, ","); }
void Post(const StructureField &x) {
if (const auto *def{std::get_if<Statement<DataComponentDefStmt>>(&x.u)}) {
for (const auto &decl :