File: | build/source/flang/include/flang/Common/reference-counted.h |
Warning: | line 64, column 7 Use of memory after it is freed |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | //===-- lib/Parser/Fortran-parsers.cpp ------------------------------------===// | |||
2 | // | |||
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |||
4 | // See https://llvm.org/LICENSE.txt for license information. | |||
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |||
6 | // | |||
7 | //===----------------------------------------------------------------------===// | |||
8 | ||||
9 | // Top-level grammar specification for Fortran. These parsers drive | |||
10 | // the tokenization parsers in cooked-tokens.h to consume characters, | |||
11 | // recognize the productions of Fortran, and to construct a parse tree. | |||
12 | // See ParserCombinators.md for documentation on the parser combinator | |||
13 | // library used here to implement an LL recursive descent recognizer. | |||
14 | ||||
15 | // The productions that follow are derived from the draft Fortran 2018 | |||
16 | // standard, with some necessary modifications to remove left recursion | |||
17 | // and some generalization in order to defer cases where parses depend | |||
18 | // on the definitions of symbols. The "Rxxx" numbers that appear in | |||
19 | // comments refer to these numbered requirements in the Fortran standard. | |||
20 | ||||
21 | // The whole Fortran grammar originally constituted one header file, | |||
22 | // but that turned out to require more memory to compile with current | |||
23 | // C++ compilers than some people were willing to accept, so now the | |||
24 | // various per-type parsers are partitioned into several C++ source | |||
25 | // files. This file contains parsers for constants, types, declarations, | |||
26 | // and misfits (mostly clauses 7, 8, & 9 of Fortran 2018). The others: | |||
27 | // executable-parsers.cpp Executable statements | |||
28 | // expr-parsers.cpp Expressions | |||
29 | // io-parsers.cpp I/O statements and FORMAT | |||
30 | // openmp-parsers.cpp OpenMP directives | |||
31 | // program-parsers.cpp Program units | |||
32 | ||||
33 | #include "basic-parsers.h" | |||
34 | #include "expr-parsers.h" | |||
35 | #include "misc-parsers.h" | |||
36 | #include "stmt-parser.h" | |||
37 | #include "token-parsers.h" | |||
38 | #include "type-parser-implementation.h" | |||
39 | #include "flang/Parser/parse-tree.h" | |||
40 | #include "flang/Parser/user-state.h" | |||
41 | ||||
42 | namespace Fortran::parser { | |||
43 | ||||
44 | // R601 alphanumeric-character -> letter | digit | underscore | |||
45 | // R603 name -> letter [alphanumeric-character]... | |||
46 | constexpr auto nonDigitIdChar{letter || otherIdChar}; | |||
47 | constexpr auto rawName{nonDigitIdChar >> many(nonDigitIdChar || digit)}; | |||
48 | TYPE_PARSER(space >> sourced(rawName >> construct<Name>()))template <> auto Parser<typename decltype(attempt(space >> sourced(rawName >> construct<Name>()))) ::resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(space >> sourced(rawName >> construct<Name>()))}; return parser .Parse(state); } | |||
49 | ||||
50 | // R608 intrinsic-operator -> | |||
51 | // power-op | mult-op | add-op | concat-op | rel-op | | |||
52 | // not-op | and-op | or-op | equiv-op | |||
53 | // R610 extended-intrinsic-op -> intrinsic-operator | |||
54 | // These parsers must be ordered carefully to avoid misrecognition. | |||
55 | constexpr auto namedIntrinsicOperator{ | |||
56 | ".LT." >> pure(DefinedOperator::IntrinsicOperator::LT) || | |||
57 | ".LE." >> pure(DefinedOperator::IntrinsicOperator::LE) || | |||
58 | ".EQ." >> pure(DefinedOperator::IntrinsicOperator::EQ) || | |||
59 | ".NE." >> pure(DefinedOperator::IntrinsicOperator::NE) || | |||
60 | ".GE." >> pure(DefinedOperator::IntrinsicOperator::GE) || | |||
61 | ".GT." >> pure(DefinedOperator::IntrinsicOperator::GT) || | |||
62 | ".NOT." >> pure(DefinedOperator::IntrinsicOperator::NOT) || | |||
63 | ".AND." >> pure(DefinedOperator::IntrinsicOperator::AND) || | |||
64 | ".OR." >> pure(DefinedOperator::IntrinsicOperator::OR) || | |||
65 | ".EQV." >> pure(DefinedOperator::IntrinsicOperator::EQV) || | |||
66 | ".NEQV." >> pure(DefinedOperator::IntrinsicOperator::NEQV) || | |||
67 | extension<LanguageFeature::XOROperator>( | |||
68 | "nonstandard usage: .XOR. spelling of .NEQV."_port_en_US, | |||
69 | ".XOR." >> pure(DefinedOperator::IntrinsicOperator::NEQV)) || | |||
70 | extension<LanguageFeature::LogicalAbbreviations>( | |||
71 | "nonstandard usage: abbreviated logical operator"_port_en_US, | |||
72 | ".N." >> pure(DefinedOperator::IntrinsicOperator::NOT) || | |||
73 | ".A." >> pure(DefinedOperator::IntrinsicOperator::AND) || | |||
74 | ".O." >> pure(DefinedOperator::IntrinsicOperator::OR) || | |||
75 | extension<LanguageFeature::XOROperator>( | |||
76 | "nonstandard usage: .X. spelling of .NEQV."_port_en_US, | |||
77 | ".X." >> pure(DefinedOperator::IntrinsicOperator::NEQV)))}; | |||
78 | ||||
79 | constexpr auto intrinsicOperator{ | |||
80 | "**" >> pure(DefinedOperator::IntrinsicOperator::Power) || | |||
81 | "*" >> pure(DefinedOperator::IntrinsicOperator::Multiply) || | |||
82 | "//" >> pure(DefinedOperator::IntrinsicOperator::Concat) || | |||
83 | "/=" >> pure(DefinedOperator::IntrinsicOperator::NE) || | |||
84 | "/" >> pure(DefinedOperator::IntrinsicOperator::Divide) || | |||
85 | "+" >> pure(DefinedOperator::IntrinsicOperator::Add) || | |||
86 | "-" >> pure(DefinedOperator::IntrinsicOperator::Subtract) || | |||
87 | "<=" >> pure(DefinedOperator::IntrinsicOperator::LE) || | |||
88 | extension<LanguageFeature::AlternativeNE>( | |||
89 | "nonstandard usage: <> spelling of /= or .NE."_port_en_US, | |||
90 | "<>" >> pure(DefinedOperator::IntrinsicOperator::NE)) || | |||
91 | "<" >> pure(DefinedOperator::IntrinsicOperator::LT) || | |||
92 | "==" >> pure(DefinedOperator::IntrinsicOperator::EQ) || | |||
93 | ">=" >> pure(DefinedOperator::IntrinsicOperator::GE) || | |||
94 | ">" >> pure(DefinedOperator::IntrinsicOperator::GT) || | |||
95 | namedIntrinsicOperator}; | |||
96 | ||||
97 | // R609 defined-operator -> | |||
98 | // defined-unary-op | defined-binary-op | extended-intrinsic-op | |||
99 | TYPE_PARSER(construct<DefinedOperator>(intrinsicOperator) ||template <> auto Parser<typename decltype(attempt(construct <DefinedOperator>(intrinsicOperator) || construct<DefinedOperator >(definedOpName)))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<DefinedOperator>(intrinsicOperator ) || construct<DefinedOperator>(definedOpName))}; return parser.Parse(state); } | |||
100 | construct<DefinedOperator>(definedOpName))template <> auto Parser<typename decltype(attempt(construct <DefinedOperator>(intrinsicOperator) || construct<DefinedOperator >(definedOpName)))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<DefinedOperator>(intrinsicOperator ) || construct<DefinedOperator>(definedOpName))}; return parser.Parse(state); } | |||
101 | ||||
102 | // R505 implicit-part -> [implicit-part-stmt]... implicit-stmt | |||
103 | // N.B. PARAMETER, FORMAT, & ENTRY statements that appear before any | |||
104 | // other kind of declaration-construct will be parsed into the | |||
105 | // implicit-part. | |||
106 | TYPE_CONTEXT_PARSER("implicit part"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("implicit part"_en_US)), inContext((("implicit part"_en_US )), ((construct<ImplicitPart>(many(Parser<ImplicitPartStmt >{}))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("implicit part"_en_US)), inContext((( "implicit part"_en_US)), ((construct<ImplicitPart>(many (Parser<ImplicitPartStmt>{})))))))}; return parser.Parse (state); } | |||
107 | construct<ImplicitPart>(many(Parser<ImplicitPartStmt>{})))template <> auto Parser<typename decltype(attempt(instrumented ((("implicit part"_en_US)), inContext((("implicit part"_en_US )), ((construct<ImplicitPart>(many(Parser<ImplicitPartStmt >{}))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("implicit part"_en_US)), inContext((( "implicit part"_en_US)), ((construct<ImplicitPart>(many (Parser<ImplicitPartStmt>{})))))))}; return parser.Parse (state); } | |||
108 | ||||
109 | // R506 implicit-part-stmt -> | |||
110 | // implicit-stmt | parameter-stmt | format-stmt | entry-stmt | |||
111 | TYPE_PARSER(first(template <> auto Parser<typename decltype(attempt(first ( construct<ImplicitPartStmt>(statement(indirect(Parser <ImplicitStmt>{}))), construct<ImplicitPartStmt>( statement(indirect(parameterStmt))), construct<ImplicitPartStmt >(statement(indirect(oldParameterStmt))), construct<ImplicitPartStmt >(statement(indirect(formatStmt))), construct<ImplicitPartStmt >(statement(indirect(entryStmt))), construct<ImplicitPartStmt >(indirect(compilerDirective)))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(first( construct<ImplicitPartStmt>(statement (indirect(Parser<ImplicitStmt>{}))), construct<ImplicitPartStmt >(statement(indirect(parameterStmt))), construct<ImplicitPartStmt >(statement(indirect(oldParameterStmt))), construct<ImplicitPartStmt >(statement(indirect(formatStmt))), construct<ImplicitPartStmt >(statement(indirect(entryStmt))), construct<ImplicitPartStmt >(indirect(compilerDirective))))}; return parser.Parse(state ); } | |||
112 | construct<ImplicitPartStmt>(statement(indirect(Parser<ImplicitStmt>{}))),template <> auto Parser<typename decltype(attempt(first ( construct<ImplicitPartStmt>(statement(indirect(Parser <ImplicitStmt>{}))), construct<ImplicitPartStmt>( statement(indirect(parameterStmt))), construct<ImplicitPartStmt >(statement(indirect(oldParameterStmt))), construct<ImplicitPartStmt >(statement(indirect(formatStmt))), construct<ImplicitPartStmt >(statement(indirect(entryStmt))), construct<ImplicitPartStmt >(indirect(compilerDirective)))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(first( construct<ImplicitPartStmt>(statement (indirect(Parser<ImplicitStmt>{}))), construct<ImplicitPartStmt >(statement(indirect(parameterStmt))), construct<ImplicitPartStmt >(statement(indirect(oldParameterStmt))), construct<ImplicitPartStmt >(statement(indirect(formatStmt))), construct<ImplicitPartStmt >(statement(indirect(entryStmt))), construct<ImplicitPartStmt >(indirect(compilerDirective))))}; return parser.Parse(state ); } | |||
113 | construct<ImplicitPartStmt>(statement(indirect(parameterStmt))),template <> auto Parser<typename decltype(attempt(first ( construct<ImplicitPartStmt>(statement(indirect(Parser <ImplicitStmt>{}))), construct<ImplicitPartStmt>( statement(indirect(parameterStmt))), construct<ImplicitPartStmt >(statement(indirect(oldParameterStmt))), construct<ImplicitPartStmt >(statement(indirect(formatStmt))), construct<ImplicitPartStmt >(statement(indirect(entryStmt))), construct<ImplicitPartStmt >(indirect(compilerDirective)))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(first( construct<ImplicitPartStmt>(statement (indirect(Parser<ImplicitStmt>{}))), construct<ImplicitPartStmt >(statement(indirect(parameterStmt))), construct<ImplicitPartStmt >(statement(indirect(oldParameterStmt))), construct<ImplicitPartStmt >(statement(indirect(formatStmt))), construct<ImplicitPartStmt >(statement(indirect(entryStmt))), construct<ImplicitPartStmt >(indirect(compilerDirective))))}; return parser.Parse(state ); } | |||
114 | construct<ImplicitPartStmt>(statement(indirect(oldParameterStmt))),template <> auto Parser<typename decltype(attempt(first ( construct<ImplicitPartStmt>(statement(indirect(Parser <ImplicitStmt>{}))), construct<ImplicitPartStmt>( statement(indirect(parameterStmt))), construct<ImplicitPartStmt >(statement(indirect(oldParameterStmt))), construct<ImplicitPartStmt >(statement(indirect(formatStmt))), construct<ImplicitPartStmt >(statement(indirect(entryStmt))), construct<ImplicitPartStmt >(indirect(compilerDirective)))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(first( construct<ImplicitPartStmt>(statement (indirect(Parser<ImplicitStmt>{}))), construct<ImplicitPartStmt >(statement(indirect(parameterStmt))), construct<ImplicitPartStmt >(statement(indirect(oldParameterStmt))), construct<ImplicitPartStmt >(statement(indirect(formatStmt))), construct<ImplicitPartStmt >(statement(indirect(entryStmt))), construct<ImplicitPartStmt >(indirect(compilerDirective))))}; return parser.Parse(state ); } | |||
115 | construct<ImplicitPartStmt>(statement(indirect(formatStmt))),template <> auto Parser<typename decltype(attempt(first ( construct<ImplicitPartStmt>(statement(indirect(Parser <ImplicitStmt>{}))), construct<ImplicitPartStmt>( statement(indirect(parameterStmt))), construct<ImplicitPartStmt >(statement(indirect(oldParameterStmt))), construct<ImplicitPartStmt >(statement(indirect(formatStmt))), construct<ImplicitPartStmt >(statement(indirect(entryStmt))), construct<ImplicitPartStmt >(indirect(compilerDirective)))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(first( construct<ImplicitPartStmt>(statement (indirect(Parser<ImplicitStmt>{}))), construct<ImplicitPartStmt >(statement(indirect(parameterStmt))), construct<ImplicitPartStmt >(statement(indirect(oldParameterStmt))), construct<ImplicitPartStmt >(statement(indirect(formatStmt))), construct<ImplicitPartStmt >(statement(indirect(entryStmt))), construct<ImplicitPartStmt >(indirect(compilerDirective))))}; return parser.Parse(state ); } | |||
116 | construct<ImplicitPartStmt>(statement(indirect(entryStmt))),template <> auto Parser<typename decltype(attempt(first ( construct<ImplicitPartStmt>(statement(indirect(Parser <ImplicitStmt>{}))), construct<ImplicitPartStmt>( statement(indirect(parameterStmt))), construct<ImplicitPartStmt >(statement(indirect(oldParameterStmt))), construct<ImplicitPartStmt >(statement(indirect(formatStmt))), construct<ImplicitPartStmt >(statement(indirect(entryStmt))), construct<ImplicitPartStmt >(indirect(compilerDirective)))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(first( construct<ImplicitPartStmt>(statement (indirect(Parser<ImplicitStmt>{}))), construct<ImplicitPartStmt >(statement(indirect(parameterStmt))), construct<ImplicitPartStmt >(statement(indirect(oldParameterStmt))), construct<ImplicitPartStmt >(statement(indirect(formatStmt))), construct<ImplicitPartStmt >(statement(indirect(entryStmt))), construct<ImplicitPartStmt >(indirect(compilerDirective))))}; return parser.Parse(state ); } | |||
117 | construct<ImplicitPartStmt>(indirect(compilerDirective))))template <> auto Parser<typename decltype(attempt(first ( construct<ImplicitPartStmt>(statement(indirect(Parser <ImplicitStmt>{}))), construct<ImplicitPartStmt>( statement(indirect(parameterStmt))), construct<ImplicitPartStmt >(statement(indirect(oldParameterStmt))), construct<ImplicitPartStmt >(statement(indirect(formatStmt))), construct<ImplicitPartStmt >(statement(indirect(entryStmt))), construct<ImplicitPartStmt >(indirect(compilerDirective)))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(first( construct<ImplicitPartStmt>(statement (indirect(Parser<ImplicitStmt>{}))), construct<ImplicitPartStmt >(statement(indirect(parameterStmt))), construct<ImplicitPartStmt >(statement(indirect(oldParameterStmt))), construct<ImplicitPartStmt >(statement(indirect(formatStmt))), construct<ImplicitPartStmt >(statement(indirect(entryStmt))), construct<ImplicitPartStmt >(indirect(compilerDirective))))}; return parser.Parse(state ); } | |||
118 | ||||
119 | // R512 internal-subprogram -> function-subprogram | subroutine-subprogram | |||
120 | // Internal subprograms are not program units, so their END statements | |||
121 | // can be followed by ';' and another statement on the same line. | |||
122 | TYPE_CONTEXT_PARSER("internal subprogram"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("internal subprogram"_en_US)), inContext((("internal subprogram"_en_US )), (((construct<InternalSubprogram>(indirect(functionSubprogram )) || construct<InternalSubprogram>(indirect(subroutineSubprogram ))) / forceEndOfStmt))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("internal subprogram"_en_US)), inContext ((("internal subprogram"_en_US)), (((construct<InternalSubprogram >(indirect(functionSubprogram)) || construct<InternalSubprogram >(indirect(subroutineSubprogram))) / forceEndOfStmt)))))}; return parser.Parse(state); } | |||
123 | (construct<InternalSubprogram>(indirect(functionSubprogram)) ||template <> auto Parser<typename decltype(attempt(instrumented ((("internal subprogram"_en_US)), inContext((("internal subprogram"_en_US )), (((construct<InternalSubprogram>(indirect(functionSubprogram )) || construct<InternalSubprogram>(indirect(subroutineSubprogram ))) / forceEndOfStmt))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("internal subprogram"_en_US)), inContext ((("internal subprogram"_en_US)), (((construct<InternalSubprogram >(indirect(functionSubprogram)) || construct<InternalSubprogram >(indirect(subroutineSubprogram))) / forceEndOfStmt)))))}; return parser.Parse(state); } | |||
124 | construct<InternalSubprogram>(indirect(subroutineSubprogram))) /template <> auto Parser<typename decltype(attempt(instrumented ((("internal subprogram"_en_US)), inContext((("internal subprogram"_en_US )), (((construct<InternalSubprogram>(indirect(functionSubprogram )) || construct<InternalSubprogram>(indirect(subroutineSubprogram ))) / forceEndOfStmt))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("internal subprogram"_en_US)), inContext ((("internal subprogram"_en_US)), (((construct<InternalSubprogram >(indirect(functionSubprogram)) || construct<InternalSubprogram >(indirect(subroutineSubprogram))) / forceEndOfStmt)))))}; return parser.Parse(state); } | |||
125 | forceEndOfStmt)template <> auto Parser<typename decltype(attempt(instrumented ((("internal subprogram"_en_US)), inContext((("internal subprogram"_en_US )), (((construct<InternalSubprogram>(indirect(functionSubprogram )) || construct<InternalSubprogram>(indirect(subroutineSubprogram ))) / forceEndOfStmt))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("internal subprogram"_en_US)), inContext ((("internal subprogram"_en_US)), (((construct<InternalSubprogram >(indirect(functionSubprogram)) || construct<InternalSubprogram >(indirect(subroutineSubprogram))) / forceEndOfStmt)))))}; return parser.Parse(state); } | |||
126 | ||||
127 | // R511 internal-subprogram-part -> contains-stmt [internal-subprogram]... | |||
128 | TYPE_CONTEXT_PARSER("internal subprogram part"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("internal subprogram part"_en_US)), inContext((("internal subprogram part"_en_US )), ((construct<InternalSubprogramPart>(statement(containsStmt ), many(StartNewSubprogram{} >> Parser<InternalSubprogram >{}))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("internal subprogram part"_en_US)), inContext ((("internal subprogram part"_en_US)), ((construct<InternalSubprogramPart >(statement(containsStmt), many(StartNewSubprogram{} >> Parser<InternalSubprogram>{})))))))}; return parser.Parse (state); } | |||
129 | construct<InternalSubprogramPart>(statement(containsStmt),template <> auto Parser<typename decltype(attempt(instrumented ((("internal subprogram part"_en_US)), inContext((("internal subprogram part"_en_US )), ((construct<InternalSubprogramPart>(statement(containsStmt ), many(StartNewSubprogram{} >> Parser<InternalSubprogram >{}))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("internal subprogram part"_en_US)), inContext ((("internal subprogram part"_en_US)), ((construct<InternalSubprogramPart >(statement(containsStmt), many(StartNewSubprogram{} >> Parser<InternalSubprogram>{})))))))}; return parser.Parse (state); } | |||
130 | many(StartNewSubprogram{} >> Parser<InternalSubprogram>{})))template <> auto Parser<typename decltype(attempt(instrumented ((("internal subprogram part"_en_US)), inContext((("internal subprogram part"_en_US )), ((construct<InternalSubprogramPart>(statement(containsStmt ), many(StartNewSubprogram{} >> Parser<InternalSubprogram >{}))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("internal subprogram part"_en_US)), inContext ((("internal subprogram part"_en_US)), ((construct<InternalSubprogramPart >(statement(containsStmt), many(StartNewSubprogram{} >> Parser<InternalSubprogram>{})))))))}; return parser.Parse (state); } | |||
131 | ||||
132 | // R605 literal-constant -> | |||
133 | // int-literal-constant | real-literal-constant | | |||
134 | // complex-literal-constant | logical-literal-constant | | |||
135 | // char-literal-constant | boz-literal-constant | |||
136 | TYPE_PARSER(template <> auto Parser<typename decltype(attempt(first (construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(first(construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{})))}; return parser.Parse(state); } | |||
137 | first(construct<LiteralConstant>(Parser<HollerithLiteralConstant>{}),template <> auto Parser<typename decltype(attempt(first (construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(first(construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{})))}; return parser.Parse(state); } | |||
138 | construct<LiteralConstant>(realLiteralConstant),template <> auto Parser<typename decltype(attempt(first (construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(first(construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{})))}; return parser.Parse(state); } | |||
139 | construct<LiteralConstant>(intLiteralConstant),template <> auto Parser<typename decltype(attempt(first (construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(first(construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{})))}; return parser.Parse(state); } | |||
140 | construct<LiteralConstant>(Parser<ComplexLiteralConstant>{}),template <> auto Parser<typename decltype(attempt(first (construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(first(construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{})))}; return parser.Parse(state); } | |||
141 | construct<LiteralConstant>(Parser<BOZLiteralConstant>{}),template <> auto Parser<typename decltype(attempt(first (construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(first(construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{})))}; return parser.Parse(state); } | |||
142 | construct<LiteralConstant>(charLiteralConstant),template <> auto Parser<typename decltype(attempt(first (construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(first(construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{})))}; return parser.Parse(state); } | |||
143 | construct<LiteralConstant>(Parser<LogicalLiteralConstant>{})))template <> auto Parser<typename decltype(attempt(first (construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(first(construct<LiteralConstant>(Parser<HollerithLiteralConstant >{}), construct<LiteralConstant>(realLiteralConstant ), construct<LiteralConstant>(intLiteralConstant), construct <LiteralConstant>(Parser<ComplexLiteralConstant>{ }), construct<LiteralConstant>(Parser<BOZLiteralConstant >{}), construct<LiteralConstant>(charLiteralConstant ), construct<LiteralConstant>(Parser<LogicalLiteralConstant >{})))}; return parser.Parse(state); } | |||
144 | ||||
145 | // R606 named-constant -> name | |||
146 | TYPE_PARSER(construct<NamedConstant>(name))template <> auto Parser<typename decltype(attempt(construct <NamedConstant>(name)))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<NamedConstant>(name))}; return parser .Parse(state); } | |||
147 | ||||
148 | // R701 type-param-value -> scalar-int-expr | * | : | |||
149 | TYPE_PARSER(construct<TypeParamValue>(scalarIntExpr) ||template <> auto Parser<typename decltype(attempt(construct <TypeParamValue>(scalarIntExpr) || construct<TypeParamValue >(star) || construct<TypeParamValue>(construct<TypeParamValue ::Deferred>(":"_tok))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeParamValue>(scalarIntExpr) || construct<TypeParamValue>(star) || construct<TypeParamValue >(construct<TypeParamValue::Deferred>(":"_tok)))}; return parser.Parse(state); } | |||
150 | construct<TypeParamValue>(star) ||template <> auto Parser<typename decltype(attempt(construct <TypeParamValue>(scalarIntExpr) || construct<TypeParamValue >(star) || construct<TypeParamValue>(construct<TypeParamValue ::Deferred>(":"_tok))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeParamValue>(scalarIntExpr) || construct<TypeParamValue>(star) || construct<TypeParamValue >(construct<TypeParamValue::Deferred>(":"_tok)))}; return parser.Parse(state); } | |||
151 | construct<TypeParamValue>(construct<TypeParamValue::Deferred>(":"_tok)))template <> auto Parser<typename decltype(attempt(construct <TypeParamValue>(scalarIntExpr) || construct<TypeParamValue >(star) || construct<TypeParamValue>(construct<TypeParamValue ::Deferred>(":"_tok))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeParamValue>(scalarIntExpr) || construct<TypeParamValue>(star) || construct<TypeParamValue >(construct<TypeParamValue::Deferred>(":"_tok)))}; return parser.Parse(state); } | |||
152 | ||||
153 | // R702 type-spec -> intrinsic-type-spec | derived-type-spec | |||
154 | // N.B. This type-spec production is one of two instances in the Fortran | |||
155 | // grammar where intrinsic types and bare derived type names can clash; | |||
156 | // the other is below in R703 declaration-type-spec. Look-ahead is required | |||
157 | // to disambiguate the cases where a derived type name begins with the name | |||
158 | // of an intrinsic type, e.g., REALITY. | |||
159 | TYPE_CONTEXT_PARSER("type spec"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("type spec"_en_US)), inContext((("type spec"_en_US)), ((construct <TypeSpec>(intrinsicTypeSpec / lookAhead("::"_tok || ")"_tok )) || construct<TypeSpec>(derivedTypeSpec)))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("type spec"_en_US )), inContext((("type spec"_en_US)), ((construct<TypeSpec> (intrinsicTypeSpec / lookAhead("::"_tok || ")"_tok)) || construct <TypeSpec>(derivedTypeSpec))))))}; return parser.Parse( state); } | |||
160 | construct<TypeSpec>(intrinsicTypeSpec / lookAhead("::"_tok || ")"_tok)) ||template <> auto Parser<typename decltype(attempt(instrumented ((("type spec"_en_US)), inContext((("type spec"_en_US)), ((construct <TypeSpec>(intrinsicTypeSpec / lookAhead("::"_tok || ")"_tok )) || construct<TypeSpec>(derivedTypeSpec)))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("type spec"_en_US )), inContext((("type spec"_en_US)), ((construct<TypeSpec> (intrinsicTypeSpec / lookAhead("::"_tok || ")"_tok)) || construct <TypeSpec>(derivedTypeSpec))))))}; return parser.Parse( state); } | |||
161 | construct<TypeSpec>(derivedTypeSpec))template <> auto Parser<typename decltype(attempt(instrumented ((("type spec"_en_US)), inContext((("type spec"_en_US)), ((construct <TypeSpec>(intrinsicTypeSpec / lookAhead("::"_tok || ")"_tok )) || construct<TypeSpec>(derivedTypeSpec)))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("type spec"_en_US )), inContext((("type spec"_en_US)), ((construct<TypeSpec> (intrinsicTypeSpec / lookAhead("::"_tok || ")"_tok)) || construct <TypeSpec>(derivedTypeSpec))))))}; return parser.Parse( state); } | |||
162 | ||||
163 | // R703 declaration-type-spec -> | |||
164 | // intrinsic-type-spec | TYPE ( intrinsic-type-spec ) | | |||
165 | // TYPE ( derived-type-spec ) | CLASS ( derived-type-spec ) | | |||
166 | // CLASS ( * ) | TYPE ( * ) | |||
167 | // N.B. It is critical to distribute "parenthesized()" over the alternatives | |||
168 | // for TYPE (...), rather than putting the alternatives within it, which | |||
169 | // would fail on "TYPE(real_derived)" with a misrecognition of "real" as an | |||
170 | // intrinsic-type-spec. | |||
171 | // N.B. TYPE(x) is a derived type if x is a one-word extension intrinsic | |||
172 | // type (BYTE or DOUBLECOMPLEX), not the extension intrinsic type. | |||
173 | TYPE_CONTEXT_PARSER("declaration type spec"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
174 | construct<DeclarationTypeSpec>(intrinsicTypeSpec) ||template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
175 | "TYPE" >>template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
176 | (parenthesized(construct<DeclarationTypeSpec>(template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
177 | !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) ||template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
178 | parenthesized(construct<DeclarationTypeSpec>(template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
179 | construct<DeclarationTypeSpec::Type>(derivedTypeSpec))) ||template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
180 | construct<DeclarationTypeSpec>(template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
181 | "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) ||template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
182 | "CLASS" >> parenthesized(construct<DeclarationTypeSpec>(template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
183 | construct<DeclarationTypeSpec::Class>(template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
184 | derivedTypeSpec)) ||template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
185 | construct<DeclarationTypeSpec>("*" >>template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
186 | construct<DeclarationTypeSpec::ClassStar>())) ||template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
187 | extension<LanguageFeature::DECStructures>(template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
188 | "nonstandard usage: STRUCTURE"_port_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
189 | construct<DeclarationTypeSpec>(template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
190 | // As is also done for the STRUCTURE statement, the name oftemplate <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
191 | // the structure includes the surrounding slashes to avoidtemplate <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
192 | // name clashes.template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
193 | construct<DeclarationTypeSpec::Record>(template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
194 | "RECORD" >> sourced("/" >> name / "/")))))template <> auto Parser<typename decltype(attempt(instrumented ((("declaration type spec"_en_US)), inContext((("declaration type spec"_en_US )), ((construct<DeclarationTypeSpec>(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct<DeclarationTypeSpec >( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec )) || parenthesized(construct<DeclarationTypeSpec>( construct <DeclarationTypeSpec::Type>(derivedTypeSpec))) || construct <DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec ::TypeStar>())) || "CLASS" >> parenthesized(construct <DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Class>( derivedTypeSpec)) || construct<DeclarationTypeSpec >("*" >> construct<DeclarationTypeSpec::ClassStar >())) || extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("declaration type spec"_en_US)), inContext(( ("declaration type spec"_en_US)), ((construct<DeclarationTypeSpec >(intrinsicTypeSpec) || "TYPE" >> (parenthesized(construct <DeclarationTypeSpec>( !"DOUBLECOMPLEX"_tok >> !"BYTE"_tok >> intrinsicTypeSpec)) || parenthesized(construct<DeclarationTypeSpec >( construct<DeclarationTypeSpec::Type>(derivedTypeSpec ))) || construct<DeclarationTypeSpec>( "( * )" >> construct<DeclarationTypeSpec::TypeStar>())) || "CLASS" >> parenthesized(construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec::Class>( derivedTypeSpec )) || construct<DeclarationTypeSpec>("*" >> construct <DeclarationTypeSpec::ClassStar>())) || extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<DeclarationTypeSpec>( construct<DeclarationTypeSpec ::Record>( "RECORD" >> sourced("/" >> name / "/" )))))))))}; return parser.Parse(state); } | |||
195 | ||||
196 | // R704 intrinsic-type-spec -> | |||
197 | // integer-type-spec | REAL [kind-selector] | DOUBLE PRECISION | | |||
198 | // COMPLEX [kind-selector] | CHARACTER [char-selector] | | |||
199 | // LOGICAL [kind-selector] | |||
200 | // Extensions: DOUBLE COMPLEX, BYTE | |||
201 | TYPE_CONTEXT_PARSER("intrinsic type spec"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
202 | first(construct<IntrinsicTypeSpec>(integerTypeSpec),template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
203 | construct<IntrinsicTypeSpec>(template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
204 | construct<IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector))),template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
205 | construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >>template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
206 | construct<IntrinsicTypeSpec::DoublePrecision>()),template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
207 | construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex>(template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
208 | "COMPLEX" >> maybe(kindSelector))),template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
209 | construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character>(template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
210 | "CHARACTER" >> maybe(Parser<CharSelector>{}))),template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
211 | construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Logical>(template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
212 | "LOGICAL" >> maybe(kindSelector))),template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
213 | extension<LanguageFeature::DoubleComplex>(template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
214 | "nonstandard usage: DOUBLE COMPLEX"_port_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
215 | construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >>template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
216 | construct<IntrinsicTypeSpec::DoubleComplex>())),template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
217 | extension<LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
218 | construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec>(template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
219 | "BYTE" >> construct<std::optional<KindSelector>>(pure(1)))))))template <> auto Parser<typename decltype(attempt(instrumented ((("intrinsic type spec"_en_US)), inContext((("intrinsic type spec"_en_US )), ((first(construct<IntrinsicTypeSpec>(integerTypeSpec ), construct<IntrinsicTypeSpec>( construct<IntrinsicTypeSpec ::Real>("REAL" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct< IntrinsicTypeSpec::DoublePrecision>()), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Complex>( "COMPLEX" >> maybe(kindSelector))), construct<IntrinsicTypeSpec>(construct <IntrinsicTypeSpec::Character>( "CHARACTER" >> maybe (Parser<CharSelector>{}))), construct<IntrinsicTypeSpec >(construct<IntrinsicTypeSpec::Logical>( "LOGICAL" >> maybe(kindSelector))), extension<LanguageFeature::DoubleComplex >( "nonstandard usage: DOUBLE COMPLEX"_port_en_US, construct <IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct <IntrinsicTypeSpec::DoubleComplex>())), extension<LanguageFeature ::Byte>("nonstandard usage: BYTE"_port_en_US, construct< IntrinsicTypeSpec>(construct<IntegerTypeSpec>( "BYTE" >> construct<std::optional<KindSelector>>( pure(1))))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("intrinsic type spec"_en_US)), inContext ((("intrinsic type spec"_en_US)), ((first(construct<IntrinsicTypeSpec >(integerTypeSpec), construct<IntrinsicTypeSpec>( construct <IntrinsicTypeSpec::Real>("REAL" >> maybe(kindSelector ))), construct<IntrinsicTypeSpec>("DOUBLE PRECISION" >> construct<IntrinsicTypeSpec::DoublePrecision>()), construct <IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Complex >( "COMPLEX" >> maybe(kindSelector))), construct< IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character >( "CHARACTER" >> maybe(Parser<CharSelector>{} ))), construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec ::Logical>( "LOGICAL" >> maybe(kindSelector))), extension <LanguageFeature::DoubleComplex>( "nonstandard usage: DOUBLE COMPLEX"_port_en_US , construct<IntrinsicTypeSpec>("DOUBLE COMPLEX"_sptok >> construct<IntrinsicTypeSpec::DoubleComplex>())), extension <LanguageFeature::Byte>("nonstandard usage: BYTE"_port_en_US , construct<IntrinsicTypeSpec>(construct<IntegerTypeSpec >( "BYTE" >> construct<std::optional<KindSelector >>(pure(1)))))))))))}; return parser.Parse(state); } | |||
220 | ||||
221 | // R705 integer-type-spec -> INTEGER [kind-selector] | |||
222 | TYPE_PARSER(construct<IntegerTypeSpec>("INTEGER" >> maybe(kindSelector)))template <> auto Parser<typename decltype(attempt(construct <IntegerTypeSpec>("INTEGER" >> maybe(kindSelector ))))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <IntegerTypeSpec>("INTEGER" >> maybe(kindSelector )))}; return parser.Parse(state); } | |||
223 | ||||
224 | // R706 kind-selector -> ( [KIND =] scalar-int-constant-expr ) | |||
225 | // Legacy extension: kind-selector -> * digit-string | |||
226 | TYPE_PARSER(construct<KindSelector>(template <> auto Parser<typename decltype(attempt(construct <KindSelector>( parenthesized(maybe("KIND ="_tok) >> scalarIntConstantExpr)) || extension<LanguageFeature::StarKind >( "nonstandard usage: TYPE*KIND syntax"_port_en_US, construct <KindSelector>(construct<KindSelector::StarSize>( "*" >> digitString64 / spaceCheck)))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<KindSelector >( parenthesized(maybe("KIND ="_tok) >> scalarIntConstantExpr )) || extension<LanguageFeature::StarKind>( "nonstandard usage: TYPE*KIND syntax"_port_en_US , construct<KindSelector>(construct<KindSelector::StarSize >( "*" >> digitString64 / spaceCheck))))}; return parser .Parse(state); } | |||
227 | parenthesized(maybe("KIND ="_tok) >> scalarIntConstantExpr)) ||template <> auto Parser<typename decltype(attempt(construct <KindSelector>( parenthesized(maybe("KIND ="_tok) >> scalarIntConstantExpr)) || extension<LanguageFeature::StarKind >( "nonstandard usage: TYPE*KIND syntax"_port_en_US, construct <KindSelector>(construct<KindSelector::StarSize>( "*" >> digitString64 / spaceCheck)))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<KindSelector >( parenthesized(maybe("KIND ="_tok) >> scalarIntConstantExpr )) || extension<LanguageFeature::StarKind>( "nonstandard usage: TYPE*KIND syntax"_port_en_US , construct<KindSelector>(construct<KindSelector::StarSize >( "*" >> digitString64 / spaceCheck))))}; return parser .Parse(state); } | |||
228 | extension<LanguageFeature::StarKind>(template <> auto Parser<typename decltype(attempt(construct <KindSelector>( parenthesized(maybe("KIND ="_tok) >> scalarIntConstantExpr)) || extension<LanguageFeature::StarKind >( "nonstandard usage: TYPE*KIND syntax"_port_en_US, construct <KindSelector>(construct<KindSelector::StarSize>( "*" >> digitString64 / spaceCheck)))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<KindSelector >( parenthesized(maybe("KIND ="_tok) >> scalarIntConstantExpr )) || extension<LanguageFeature::StarKind>( "nonstandard usage: TYPE*KIND syntax"_port_en_US , construct<KindSelector>(construct<KindSelector::StarSize >( "*" >> digitString64 / spaceCheck))))}; return parser .Parse(state); } | |||
229 | "nonstandard usage: TYPE*KIND syntax"_port_en_US,template <> auto Parser<typename decltype(attempt(construct <KindSelector>( parenthesized(maybe("KIND ="_tok) >> scalarIntConstantExpr)) || extension<LanguageFeature::StarKind >( "nonstandard usage: TYPE*KIND syntax"_port_en_US, construct <KindSelector>(construct<KindSelector::StarSize>( "*" >> digitString64 / spaceCheck)))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<KindSelector >( parenthesized(maybe("KIND ="_tok) >> scalarIntConstantExpr )) || extension<LanguageFeature::StarKind>( "nonstandard usage: TYPE*KIND syntax"_port_en_US , construct<KindSelector>(construct<KindSelector::StarSize >( "*" >> digitString64 / spaceCheck))))}; return parser .Parse(state); } | |||
230 | construct<KindSelector>(construct<KindSelector::StarSize>(template <> auto Parser<typename decltype(attempt(construct <KindSelector>( parenthesized(maybe("KIND ="_tok) >> scalarIntConstantExpr)) || extension<LanguageFeature::StarKind >( "nonstandard usage: TYPE*KIND syntax"_port_en_US, construct <KindSelector>(construct<KindSelector::StarSize>( "*" >> digitString64 / spaceCheck)))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<KindSelector >( parenthesized(maybe("KIND ="_tok) >> scalarIntConstantExpr )) || extension<LanguageFeature::StarKind>( "nonstandard usage: TYPE*KIND syntax"_port_en_US , construct<KindSelector>(construct<KindSelector::StarSize >( "*" >> digitString64 / spaceCheck))))}; return parser .Parse(state); } | |||
231 | "*" >> digitString64 / spaceCheck))))template <> auto Parser<typename decltype(attempt(construct <KindSelector>( parenthesized(maybe("KIND ="_tok) >> scalarIntConstantExpr)) || extension<LanguageFeature::StarKind >( "nonstandard usage: TYPE*KIND syntax"_port_en_US, construct <KindSelector>(construct<KindSelector::StarSize>( "*" >> digitString64 / spaceCheck)))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<KindSelector >( parenthesized(maybe("KIND ="_tok) >> scalarIntConstantExpr )) || extension<LanguageFeature::StarKind>( "nonstandard usage: TYPE*KIND syntax"_port_en_US , construct<KindSelector>(construct<KindSelector::StarSize >( "*" >> digitString64 / spaceCheck))))}; return parser .Parse(state); } | |||
232 | ||||
233 | constexpr auto noSpace{ | |||
234 | recovery(withMessage("invalid space"_err_en_US, !" "_ch), space)}; | |||
235 | ||||
236 | // R707 signed-int-literal-constant -> [sign] int-literal-constant | |||
237 | TYPE_PARSER(sourced(template <> auto Parser<typename decltype(attempt(sourced ( construct<SignedIntLiteralConstant>(SignedIntLiteralConstantWithoutKind {}, maybe(noSpace >> underscore >> noSpace >> kindParam)))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(sourced( construct<SignedIntLiteralConstant>(SignedIntLiteralConstantWithoutKind {}, maybe(noSpace >> underscore >> noSpace >> kindParam))))}; return parser.Parse(state); } | |||
238 | construct<SignedIntLiteralConstant>(SignedIntLiteralConstantWithoutKind{},template <> auto Parser<typename decltype(attempt(sourced ( construct<SignedIntLiteralConstant>(SignedIntLiteralConstantWithoutKind {}, maybe(noSpace >> underscore >> noSpace >> kindParam)))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(sourced( construct<SignedIntLiteralConstant>(SignedIntLiteralConstantWithoutKind {}, maybe(noSpace >> underscore >> noSpace >> kindParam))))}; return parser.Parse(state); } | |||
239 | maybe(noSpace >> underscore >> noSpace >> kindParam))))template <> auto Parser<typename decltype(attempt(sourced ( construct<SignedIntLiteralConstant>(SignedIntLiteralConstantWithoutKind {}, maybe(noSpace >> underscore >> noSpace >> kindParam)))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(sourced( construct<SignedIntLiteralConstant>(SignedIntLiteralConstantWithoutKind {}, maybe(noSpace >> underscore >> noSpace >> kindParam))))}; return parser.Parse(state); } | |||
240 | ||||
241 | // R708 int-literal-constant -> digit-string [_ kind-param] | |||
242 | // The negated look-ahead for a trailing underscore prevents misrecognition | |||
243 | // when the digit string is a numeric kind parameter of a character literal. | |||
244 | TYPE_PARSER(construct<IntLiteralConstant>(space >> digitString,template <> auto Parser<typename decltype(attempt(construct <IntLiteralConstant>(space >> digitString, maybe( underscore >> noSpace >> kindParam) / !underscore )))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <IntLiteralConstant>(space >> digitString, maybe( underscore >> noSpace >> kindParam) / !underscore ))}; return parser.Parse(state); } | |||
245 | maybe(underscore >> noSpace >> kindParam) / !underscore))template <> auto Parser<typename decltype(attempt(construct <IntLiteralConstant>(space >> digitString, maybe( underscore >> noSpace >> kindParam) / !underscore )))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <IntLiteralConstant>(space >> digitString, maybe( underscore >> noSpace >> kindParam) / !underscore ))}; return parser.Parse(state); } | |||
246 | ||||
247 | // R709 kind-param -> digit-string | scalar-int-constant-name | |||
248 | TYPE_PARSER(construct<KindParam>(digitString64) ||template <> auto Parser<typename decltype(attempt(construct <KindParam>(digitString64) || construct<KindParam> ( scalar(integer(constant(sourced(rawName >> construct< Name>())))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<KindParam>(digitString64) || construct <KindParam>( scalar(integer(constant(sourced(rawName >> construct<Name>()))))))}; return parser.Parse(state); } | |||
249 | construct<KindParam>(template <> auto Parser<typename decltype(attempt(construct <KindParam>(digitString64) || construct<KindParam> ( scalar(integer(constant(sourced(rawName >> construct< Name>())))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<KindParam>(digitString64) || construct <KindParam>( scalar(integer(constant(sourced(rawName >> construct<Name>()))))))}; return parser.Parse(state); } | |||
250 | scalar(integer(constant(sourced(rawName >> construct<Name>()))))))template <> auto Parser<typename decltype(attempt(construct <KindParam>(digitString64) || construct<KindParam> ( scalar(integer(constant(sourced(rawName >> construct< Name>())))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<KindParam>(digitString64) || construct <KindParam>( scalar(integer(constant(sourced(rawName >> construct<Name>()))))))}; return parser.Parse(state); } | |||
251 | ||||
252 | // R712 sign -> + | - | |||
253 | // N.B. A sign constitutes a whole token, so a space is allowed in free form | |||
254 | // after the sign and before a real-literal-constant or | |||
255 | // complex-literal-constant. A sign is not a unary operator in these contexts. | |||
256 | constexpr auto sign{ | |||
257 | "+"_tok >> pure(Sign::Positive) || "-"_tok >> pure(Sign::Negative)}; | |||
258 | ||||
259 | // R713 signed-real-literal-constant -> [sign] real-literal-constant | |||
260 | constexpr auto signedRealLiteralConstant{ | |||
261 | construct<SignedRealLiteralConstant>(maybe(sign), realLiteralConstant)}; | |||
262 | ||||
263 | // R714 real-literal-constant -> | |||
264 | // significand [exponent-letter exponent] [_ kind-param] | | |||
265 | // digit-string exponent-letter exponent [_ kind-param] | |||
266 | // R715 significand -> digit-string . [digit-string] | . digit-string | |||
267 | // R716 exponent-letter -> E | D | |||
268 | // Extension: Q | |||
269 | // R717 exponent -> signed-digit-string | |||
270 | constexpr auto exponentPart{ | |||
271 | ("ed"_ch || | |||
272 | extension<LanguageFeature::QuadPrecision>( | |||
273 | "nonstandard usage: Q exponent"_port_en_US, "q"_ch)) >> | |||
274 | SignedDigitString{}}; | |||
275 | ||||
276 | TYPE_CONTEXT_PARSER("REAL literal constant"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("REAL literal constant"_en_US)), inContext((("REAL literal constant"_en_US )), ((space >> construct<RealLiteralConstant>( sourced ((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString) >> maybe(exponentPart ) >> ok || "."_ch >> digitString >> maybe(exponentPart ) >> ok || digitString >> exponentPart >> ok ) >> construct<RealLiteralConstant::Real>()), maybe (noSpace >> underscore >> noSpace >> kindParam ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("REAL literal constant"_en_US)), inContext(( ("REAL literal constant"_en_US)), ((space >> construct< RealLiteralConstant>( sourced((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString ) >> maybe(exponentPart) >> ok || "."_ch >> digitString >> maybe(exponentPart) >> ok || digitString >> exponentPart >> ok) >> construct<RealLiteralConstant ::Real>()), maybe(noSpace >> underscore >> noSpace >> kindParam)))))))}; return parser.Parse(state); } | |||
277 | space >>template <> auto Parser<typename decltype(attempt(instrumented ((("REAL literal constant"_en_US)), inContext((("REAL literal constant"_en_US )), ((space >> construct<RealLiteralConstant>( sourced ((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString) >> maybe(exponentPart ) >> ok || "."_ch >> digitString >> maybe(exponentPart ) >> ok || digitString >> exponentPart >> ok ) >> construct<RealLiteralConstant::Real>()), maybe (noSpace >> underscore >> noSpace >> kindParam ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("REAL literal constant"_en_US)), inContext(( ("REAL literal constant"_en_US)), ((space >> construct< RealLiteralConstant>( sourced((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString ) >> maybe(exponentPart) >> ok || "."_ch >> digitString >> maybe(exponentPart) >> ok || digitString >> exponentPart >> ok) >> construct<RealLiteralConstant ::Real>()), maybe(noSpace >> underscore >> noSpace >> kindParam)))))))}; return parser.Parse(state); } | |||
278 | construct<RealLiteralConstant>(template <> auto Parser<typename decltype(attempt(instrumented ((("REAL literal constant"_en_US)), inContext((("REAL literal constant"_en_US )), ((space >> construct<RealLiteralConstant>( sourced ((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString) >> maybe(exponentPart ) >> ok || "."_ch >> digitString >> maybe(exponentPart ) >> ok || digitString >> exponentPart >> ok ) >> construct<RealLiteralConstant::Real>()), maybe (noSpace >> underscore >> noSpace >> kindParam ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("REAL literal constant"_en_US)), inContext(( ("REAL literal constant"_en_US)), ((space >> construct< RealLiteralConstant>( sourced((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString ) >> maybe(exponentPart) >> ok || "."_ch >> digitString >> maybe(exponentPart) >> ok || digitString >> exponentPart >> ok) >> construct<RealLiteralConstant ::Real>()), maybe(noSpace >> underscore >> noSpace >> kindParam)))))))}; return parser.Parse(state); } | |||
279 | sourced((digitString >> "."_ch >>template <> auto Parser<typename decltype(attempt(instrumented ((("REAL literal constant"_en_US)), inContext((("REAL literal constant"_en_US )), ((space >> construct<RealLiteralConstant>( sourced ((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString) >> maybe(exponentPart ) >> ok || "."_ch >> digitString >> maybe(exponentPart ) >> ok || digitString >> exponentPart >> ok ) >> construct<RealLiteralConstant::Real>()), maybe (noSpace >> underscore >> noSpace >> kindParam ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("REAL literal constant"_en_US)), inContext(( ("REAL literal constant"_en_US)), ((space >> construct< RealLiteralConstant>( sourced((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString ) >> maybe(exponentPart) >> ok || "."_ch >> digitString >> maybe(exponentPart) >> ok || digitString >> exponentPart >> ok) >> construct<RealLiteralConstant ::Real>()), maybe(noSpace >> underscore >> noSpace >> kindParam)))))))}; return parser.Parse(state); } | |||
280 | !(some(letter) >>template <> auto Parser<typename decltype(attempt(instrumented ((("REAL literal constant"_en_US)), inContext((("REAL literal constant"_en_US )), ((space >> construct<RealLiteralConstant>( sourced ((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString) >> maybe(exponentPart ) >> ok || "."_ch >> digitString >> maybe(exponentPart ) >> ok || digitString >> exponentPart >> ok ) >> construct<RealLiteralConstant::Real>()), maybe (noSpace >> underscore >> noSpace >> kindParam ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("REAL literal constant"_en_US)), inContext(( ("REAL literal constant"_en_US)), ((space >> construct< RealLiteralConstant>( sourced((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString ) >> maybe(exponentPart) >> ok || "."_ch >> digitString >> maybe(exponentPart) >> ok || digitString >> exponentPart >> ok) >> construct<RealLiteralConstant ::Real>()), maybe(noSpace >> underscore >> noSpace >> kindParam)))))))}; return parser.Parse(state); } | |||
281 | "."_ch /* don't misinterpret 1.AND. */) >>template <> auto Parser<typename decltype(attempt(instrumented ((("REAL literal constant"_en_US)), inContext((("REAL literal constant"_en_US )), ((space >> construct<RealLiteralConstant>( sourced ((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString) >> maybe(exponentPart ) >> ok || "."_ch >> digitString >> maybe(exponentPart ) >> ok || digitString >> exponentPart >> ok ) >> construct<RealLiteralConstant::Real>()), maybe (noSpace >> underscore >> noSpace >> kindParam ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("REAL literal constant"_en_US)), inContext(( ("REAL literal constant"_en_US)), ((space >> construct< RealLiteralConstant>( sourced((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString ) >> maybe(exponentPart) >> ok || "."_ch >> digitString >> maybe(exponentPart) >> ok || digitString >> exponentPart >> ok) >> construct<RealLiteralConstant ::Real>()), maybe(noSpace >> underscore >> noSpace >> kindParam)))))))}; return parser.Parse(state); } | |||
282 | maybe(digitString) >> maybe(exponentPart) >> ok ||template <> auto Parser<typename decltype(attempt(instrumented ((("REAL literal constant"_en_US)), inContext((("REAL literal constant"_en_US )), ((space >> construct<RealLiteralConstant>( sourced ((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString) >> maybe(exponentPart ) >> ok || "."_ch >> digitString >> maybe(exponentPart ) >> ok || digitString >> exponentPart >> ok ) >> construct<RealLiteralConstant::Real>()), maybe (noSpace >> underscore >> noSpace >> kindParam ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("REAL literal constant"_en_US)), inContext(( ("REAL literal constant"_en_US)), ((space >> construct< RealLiteralConstant>( sourced((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString ) >> maybe(exponentPart) >> ok || "."_ch >> digitString >> maybe(exponentPart) >> ok || digitString >> exponentPart >> ok) >> construct<RealLiteralConstant ::Real>()), maybe(noSpace >> underscore >> noSpace >> kindParam)))))))}; return parser.Parse(state); } | |||
283 | "."_ch >> digitString >> maybe(exponentPart) >> ok ||template <> auto Parser<typename decltype(attempt(instrumented ((("REAL literal constant"_en_US)), inContext((("REAL literal constant"_en_US )), ((space >> construct<RealLiteralConstant>( sourced ((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString) >> maybe(exponentPart ) >> ok || "."_ch >> digitString >> maybe(exponentPart ) >> ok || digitString >> exponentPart >> ok ) >> construct<RealLiteralConstant::Real>()), maybe (noSpace >> underscore >> noSpace >> kindParam ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("REAL literal constant"_en_US)), inContext(( ("REAL literal constant"_en_US)), ((space >> construct< RealLiteralConstant>( sourced((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString ) >> maybe(exponentPart) >> ok || "."_ch >> digitString >> maybe(exponentPart) >> ok || digitString >> exponentPart >> ok) >> construct<RealLiteralConstant ::Real>()), maybe(noSpace >> underscore >> noSpace >> kindParam)))))))}; return parser.Parse(state); } | |||
284 | digitString >> exponentPart >> ok) >>template <> auto Parser<typename decltype(attempt(instrumented ((("REAL literal constant"_en_US)), inContext((("REAL literal constant"_en_US )), ((space >> construct<RealLiteralConstant>( sourced ((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString) >> maybe(exponentPart ) >> ok || "."_ch >> digitString >> maybe(exponentPart ) >> ok || digitString >> exponentPart >> ok ) >> construct<RealLiteralConstant::Real>()), maybe (noSpace >> underscore >> noSpace >> kindParam ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("REAL literal constant"_en_US)), inContext(( ("REAL literal constant"_en_US)), ((space >> construct< RealLiteralConstant>( sourced((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString ) >> maybe(exponentPart) >> ok || "."_ch >> digitString >> maybe(exponentPart) >> ok || digitString >> exponentPart >> ok) >> construct<RealLiteralConstant ::Real>()), maybe(noSpace >> underscore >> noSpace >> kindParam)))))))}; return parser.Parse(state); } | |||
285 | construct<RealLiteralConstant::Real>()),template <> auto Parser<typename decltype(attempt(instrumented ((("REAL literal constant"_en_US)), inContext((("REAL literal constant"_en_US )), ((space >> construct<RealLiteralConstant>( sourced ((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString) >> maybe(exponentPart ) >> ok || "."_ch >> digitString >> maybe(exponentPart ) >> ok || digitString >> exponentPart >> ok ) >> construct<RealLiteralConstant::Real>()), maybe (noSpace >> underscore >> noSpace >> kindParam ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("REAL literal constant"_en_US)), inContext(( ("REAL literal constant"_en_US)), ((space >> construct< RealLiteralConstant>( sourced((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString ) >> maybe(exponentPart) >> ok || "."_ch >> digitString >> maybe(exponentPart) >> ok || digitString >> exponentPart >> ok) >> construct<RealLiteralConstant ::Real>()), maybe(noSpace >> underscore >> noSpace >> kindParam)))))))}; return parser.Parse(state); } | |||
286 | maybe(noSpace >> underscore >> noSpace >> kindParam)))template <> auto Parser<typename decltype(attempt(instrumented ((("REAL literal constant"_en_US)), inContext((("REAL literal constant"_en_US )), ((space >> construct<RealLiteralConstant>( sourced ((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString) >> maybe(exponentPart ) >> ok || "."_ch >> digitString >> maybe(exponentPart ) >> ok || digitString >> exponentPart >> ok ) >> construct<RealLiteralConstant::Real>()), maybe (noSpace >> underscore >> noSpace >> kindParam ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("REAL literal constant"_en_US)), inContext(( ("REAL literal constant"_en_US)), ((space >> construct< RealLiteralConstant>( sourced((digitString >> "."_ch >> !(some(letter) >> "."_ch ) >> maybe(digitString ) >> maybe(exponentPart) >> ok || "."_ch >> digitString >> maybe(exponentPart) >> ok || digitString >> exponentPart >> ok) >> construct<RealLiteralConstant ::Real>()), maybe(noSpace >> underscore >> noSpace >> kindParam)))))))}; return parser.Parse(state); } | |||
287 | ||||
288 | // R718 complex-literal-constant -> ( real-part , imag-part ) | |||
289 | TYPE_CONTEXT_PARSER("COMPLEX literal constant"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("COMPLEX literal constant"_en_US)), inContext((("COMPLEX literal constant"_en_US )), ((parenthesized(construct<ComplexLiteralConstant>( Parser <ComplexPart>{} / ",", Parser<ComplexPart>{}))))) )))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(instrumented ((("COMPLEX literal constant"_en_US)), inContext((("COMPLEX literal constant"_en_US )), ((parenthesized(construct<ComplexLiteralConstant>( Parser <ComplexPart>{} / ",", Parser<ComplexPart>{}))))) ))}; return parser.Parse(state); } | |||
290 | parenthesized(construct<ComplexLiteralConstant>(template <> auto Parser<typename decltype(attempt(instrumented ((("COMPLEX literal constant"_en_US)), inContext((("COMPLEX literal constant"_en_US )), ((parenthesized(construct<ComplexLiteralConstant>( Parser <ComplexPart>{} / ",", Parser<ComplexPart>{}))))) )))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(instrumented ((("COMPLEX literal constant"_en_US)), inContext((("COMPLEX literal constant"_en_US )), ((parenthesized(construct<ComplexLiteralConstant>( Parser <ComplexPart>{} / ",", Parser<ComplexPart>{}))))) ))}; return parser.Parse(state); } | |||
291 | Parser<ComplexPart>{} / ",", Parser<ComplexPart>{})))template <> auto Parser<typename decltype(attempt(instrumented ((("COMPLEX literal constant"_en_US)), inContext((("COMPLEX literal constant"_en_US )), ((parenthesized(construct<ComplexLiteralConstant>( Parser <ComplexPart>{} / ",", Parser<ComplexPart>{}))))) )))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(instrumented ((("COMPLEX literal constant"_en_US)), inContext((("COMPLEX literal constant"_en_US )), ((parenthesized(construct<ComplexLiteralConstant>( Parser <ComplexPart>{} / ",", Parser<ComplexPart>{}))))) ))}; return parser.Parse(state); } | |||
292 | ||||
293 | // PGI/Intel extension: signed complex literal constant | |||
294 | TYPE_PARSER(construct<SignedComplexLiteralConstant>(template <> auto Parser<typename decltype(attempt(construct <SignedComplexLiteralConstant>( sign, Parser<ComplexLiteralConstant >{})))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<SignedComplexLiteralConstant>( sign, Parser <ComplexLiteralConstant>{}))}; return parser.Parse(state ); } | |||
295 | sign, Parser<ComplexLiteralConstant>{}))template <> auto Parser<typename decltype(attempt(construct <SignedComplexLiteralConstant>( sign, Parser<ComplexLiteralConstant >{})))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<SignedComplexLiteralConstant>( sign, Parser <ComplexLiteralConstant>{}))}; return parser.Parse(state ); } | |||
296 | ||||
297 | // R719 real-part -> | |||
298 | // signed-int-literal-constant | signed-real-literal-constant | | |||
299 | // named-constant | |||
300 | // R720 imag-part -> | |||
301 | // signed-int-literal-constant | signed-real-literal-constant | | |||
302 | // named-constant | |||
303 | TYPE_PARSER(construct<ComplexPart>(signedRealLiteralConstant) ||template <> auto Parser<typename decltype(attempt(construct <ComplexPart>(signedRealLiteralConstant) || construct< ComplexPart>(signedIntLiteralConstant) || construct<ComplexPart >(namedConstant)))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<ComplexPart>(signedRealLiteralConstant ) || construct<ComplexPart>(signedIntLiteralConstant) || construct<ComplexPart>(namedConstant))}; return parser .Parse(state); } | |||
304 | construct<ComplexPart>(signedIntLiteralConstant) ||template <> auto Parser<typename decltype(attempt(construct <ComplexPart>(signedRealLiteralConstant) || construct< ComplexPart>(signedIntLiteralConstant) || construct<ComplexPart >(namedConstant)))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<ComplexPart>(signedRealLiteralConstant ) || construct<ComplexPart>(signedIntLiteralConstant) || construct<ComplexPart>(namedConstant))}; return parser .Parse(state); } | |||
305 | construct<ComplexPart>(namedConstant))template <> auto Parser<typename decltype(attempt(construct <ComplexPart>(signedRealLiteralConstant) || construct< ComplexPart>(signedIntLiteralConstant) || construct<ComplexPart >(namedConstant)))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<ComplexPart>(signedRealLiteralConstant ) || construct<ComplexPart>(signedIntLiteralConstant) || construct<ComplexPart>(namedConstant))}; return parser .Parse(state); } | |||
306 | ||||
307 | // R721 char-selector -> | |||
308 | // length-selector | | |||
309 | // ( LEN = type-param-value , KIND = scalar-int-constant-expr ) | | |||
310 | // ( type-param-value , [KIND =] scalar-int-constant-expr ) | | |||
311 | // ( KIND = scalar-int-constant-expr [, LEN = type-param-value] ) | |||
312 | TYPE_PARSER(construct<CharSelector>(Parser<LengthSelector>{}) ||template <> auto Parser<typename decltype(attempt(construct <CharSelector>(Parser<LengthSelector>{}) || parenthesized (construct<CharSelector>( "LEN =" >> typeParamValue , ", KIND =" >> scalarIntConstantExpr)) || parenthesized (construct<CharSelector>( typeParamValue / ",", maybe("KIND ="_tok ) >> scalarIntConstantExpr)) || parenthesized(construct <CharSelector>( "KIND =" >> scalarIntConstantExpr , maybe(", LEN =" >> typeParamValue)))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<CharSelector >(Parser<LengthSelector>{}) || parenthesized(construct <CharSelector>( "LEN =" >> typeParamValue, ", KIND =" >> scalarIntConstantExpr)) || parenthesized(construct< CharSelector>( typeParamValue / ",", maybe("KIND ="_tok) >> scalarIntConstantExpr)) || parenthesized(construct<CharSelector >( "KIND =" >> scalarIntConstantExpr, maybe(", LEN =" >> typeParamValue))))}; return parser.Parse(state); } | |||
313 | parenthesized(construct<CharSelector>(template <> auto Parser<typename decltype(attempt(construct <CharSelector>(Parser<LengthSelector>{}) || parenthesized (construct<CharSelector>( "LEN =" >> typeParamValue , ", KIND =" >> scalarIntConstantExpr)) || parenthesized (construct<CharSelector>( typeParamValue / ",", maybe("KIND ="_tok ) >> scalarIntConstantExpr)) || parenthesized(construct <CharSelector>( "KIND =" >> scalarIntConstantExpr , maybe(", LEN =" >> typeParamValue)))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<CharSelector >(Parser<LengthSelector>{}) || parenthesized(construct <CharSelector>( "LEN =" >> typeParamValue, ", KIND =" >> scalarIntConstantExpr)) || parenthesized(construct< CharSelector>( typeParamValue / ",", maybe("KIND ="_tok) >> scalarIntConstantExpr)) || parenthesized(construct<CharSelector >( "KIND =" >> scalarIntConstantExpr, maybe(", LEN =" >> typeParamValue))))}; return parser.Parse(state); } | |||
314 | "LEN =" >> typeParamValue, ", KIND =" >> scalarIntConstantExpr)) ||template <> auto Parser<typename decltype(attempt(construct <CharSelector>(Parser<LengthSelector>{}) || parenthesized (construct<CharSelector>( "LEN =" >> typeParamValue , ", KIND =" >> scalarIntConstantExpr)) || parenthesized (construct<CharSelector>( typeParamValue / ",", maybe("KIND ="_tok ) >> scalarIntConstantExpr)) || parenthesized(construct <CharSelector>( "KIND =" >> scalarIntConstantExpr , maybe(", LEN =" >> typeParamValue)))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<CharSelector >(Parser<LengthSelector>{}) || parenthesized(construct <CharSelector>( "LEN =" >> typeParamValue, ", KIND =" >> scalarIntConstantExpr)) || parenthesized(construct< CharSelector>( typeParamValue / ",", maybe("KIND ="_tok) >> scalarIntConstantExpr)) || parenthesized(construct<CharSelector >( "KIND =" >> scalarIntConstantExpr, maybe(", LEN =" >> typeParamValue))))}; return parser.Parse(state); } | |||
315 | parenthesized(construct<CharSelector>(template <> auto Parser<typename decltype(attempt(construct <CharSelector>(Parser<LengthSelector>{}) || parenthesized (construct<CharSelector>( "LEN =" >> typeParamValue , ", KIND =" >> scalarIntConstantExpr)) || parenthesized (construct<CharSelector>( typeParamValue / ",", maybe("KIND ="_tok ) >> scalarIntConstantExpr)) || parenthesized(construct <CharSelector>( "KIND =" >> scalarIntConstantExpr , maybe(", LEN =" >> typeParamValue)))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<CharSelector >(Parser<LengthSelector>{}) || parenthesized(construct <CharSelector>( "LEN =" >> typeParamValue, ", KIND =" >> scalarIntConstantExpr)) || parenthesized(construct< CharSelector>( typeParamValue / ",", maybe("KIND ="_tok) >> scalarIntConstantExpr)) || parenthesized(construct<CharSelector >( "KIND =" >> scalarIntConstantExpr, maybe(", LEN =" >> typeParamValue))))}; return parser.Parse(state); } | |||
316 | typeParamValue / ",", maybe("KIND ="_tok) >> scalarIntConstantExpr)) ||template <> auto Parser<typename decltype(attempt(construct <CharSelector>(Parser<LengthSelector>{}) || parenthesized (construct<CharSelector>( "LEN =" >> typeParamValue , ", KIND =" >> scalarIntConstantExpr)) || parenthesized (construct<CharSelector>( typeParamValue / ",", maybe("KIND ="_tok ) >> scalarIntConstantExpr)) || parenthesized(construct <CharSelector>( "KIND =" >> scalarIntConstantExpr , maybe(", LEN =" >> typeParamValue)))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<CharSelector >(Parser<LengthSelector>{}) || parenthesized(construct <CharSelector>( "LEN =" >> typeParamValue, ", KIND =" >> scalarIntConstantExpr)) || parenthesized(construct< CharSelector>( typeParamValue / ",", maybe("KIND ="_tok) >> scalarIntConstantExpr)) || parenthesized(construct<CharSelector >( "KIND =" >> scalarIntConstantExpr, maybe(", LEN =" >> typeParamValue))))}; return parser.Parse(state); } | |||
317 | parenthesized(construct<CharSelector>(template <> auto Parser<typename decltype(attempt(construct <CharSelector>(Parser<LengthSelector>{}) || parenthesized (construct<CharSelector>( "LEN =" >> typeParamValue , ", KIND =" >> scalarIntConstantExpr)) || parenthesized (construct<CharSelector>( typeParamValue / ",", maybe("KIND ="_tok ) >> scalarIntConstantExpr)) || parenthesized(construct <CharSelector>( "KIND =" >> scalarIntConstantExpr , maybe(", LEN =" >> typeParamValue)))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<CharSelector >(Parser<LengthSelector>{}) || parenthesized(construct <CharSelector>( "LEN =" >> typeParamValue, ", KIND =" >> scalarIntConstantExpr)) || parenthesized(construct< CharSelector>( typeParamValue / ",", maybe("KIND ="_tok) >> scalarIntConstantExpr)) || parenthesized(construct<CharSelector >( "KIND =" >> scalarIntConstantExpr, maybe(", LEN =" >> typeParamValue))))}; return parser.Parse(state); } | |||
318 | "KIND =" >> scalarIntConstantExpr, maybe(", LEN =" >> typeParamValue))))template <> auto Parser<typename decltype(attempt(construct <CharSelector>(Parser<LengthSelector>{}) || parenthesized (construct<CharSelector>( "LEN =" >> typeParamValue , ", KIND =" >> scalarIntConstantExpr)) || parenthesized (construct<CharSelector>( typeParamValue / ",", maybe("KIND ="_tok ) >> scalarIntConstantExpr)) || parenthesized(construct <CharSelector>( "KIND =" >> scalarIntConstantExpr , maybe(", LEN =" >> typeParamValue)))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<CharSelector >(Parser<LengthSelector>{}) || parenthesized(construct <CharSelector>( "LEN =" >> typeParamValue, ", KIND =" >> scalarIntConstantExpr)) || parenthesized(construct< CharSelector>( typeParamValue / ",", maybe("KIND ="_tok) >> scalarIntConstantExpr)) || parenthesized(construct<CharSelector >( "KIND =" >> scalarIntConstantExpr, maybe(", LEN =" >> typeParamValue))))}; return parser.Parse(state); } | |||
319 | ||||
320 | // R722 length-selector -> ( [LEN =] type-param-value ) | * char-length [,] | |||
321 | // N.B. The trailing [,] in the production is permitted by the Standard | |||
322 | // only in the context of a type-declaration-stmt, but even with that | |||
323 | // limitation, it would seem to be unnecessary and buggy to consume the comma | |||
324 | // here. | |||
325 | TYPE_PARSER(construct<LengthSelector>(template <> auto Parser<typename decltype(attempt(construct <LengthSelector>( parenthesized(maybe("LEN ="_tok) >> typeParamValue)) || construct<LengthSelector>("*" >> charLength )))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<LengthSelector>( parenthesized(maybe ("LEN ="_tok) >> typeParamValue)) || construct<LengthSelector >("*" >> charLength ))}; return parser.Parse(state); } | |||
326 | parenthesized(maybe("LEN ="_tok) >> typeParamValue)) ||template <> auto Parser<typename decltype(attempt(construct <LengthSelector>( parenthesized(maybe("LEN ="_tok) >> typeParamValue)) || construct<LengthSelector>("*" >> charLength )))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<LengthSelector>( parenthesized(maybe ("LEN ="_tok) >> typeParamValue)) || construct<LengthSelector >("*" >> charLength ))}; return parser.Parse(state); } | |||
327 | construct<LengthSelector>("*" >> charLength /* / maybe(","_tok) */))template <> auto Parser<typename decltype(attempt(construct <LengthSelector>( parenthesized(maybe("LEN ="_tok) >> typeParamValue)) || construct<LengthSelector>("*" >> charLength )))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<LengthSelector>( parenthesized(maybe ("LEN ="_tok) >> typeParamValue)) || construct<LengthSelector >("*" >> charLength ))}; return parser.Parse(state); } | |||
328 | ||||
329 | // R723 char-length -> ( type-param-value ) | digit-string | |||
330 | TYPE_PARSER(construct<CharLength>(parenthesized(typeParamValue)) ||template <> auto Parser<typename decltype(attempt(construct <CharLength>(parenthesized(typeParamValue)) || construct <CharLength>(space >> digitString64 / spaceCheck) ))::resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(construct< CharLength>(parenthesized(typeParamValue)) || construct< CharLength>(space >> digitString64 / spaceCheck))}; return parser.Parse(state); } | |||
331 | construct<CharLength>(space >> digitString64 / spaceCheck))template <> auto Parser<typename decltype(attempt(construct <CharLength>(parenthesized(typeParamValue)) || construct <CharLength>(space >> digitString64 / spaceCheck) ))::resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(construct< CharLength>(parenthesized(typeParamValue)) || construct< CharLength>(space >> digitString64 / spaceCheck))}; return parser.Parse(state); } | |||
332 | ||||
333 | // R724 char-literal-constant -> | |||
334 | // [kind-param _] ' [rep-char]... ' | | |||
335 | // [kind-param _] " [rep-char]... " | |||
336 | // "rep-char" is any non-control character. Doubled interior quotes are | |||
337 | // combined. Backslash escapes can be enabled. | |||
338 | // N.B. the parsing of "kind-param" takes care to not consume the '_'. | |||
339 | TYPE_CONTEXT_PARSER("CHARACTER literal constant"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("CHARACTER literal constant"_en_US)), inContext((("CHARACTER literal constant"_en_US )), ((construct<CharLiteralConstant>( kindParam / underscore , charLiteralConstantWithoutKind) || construct<CharLiteralConstant >(construct<std::optional<KindParam>>(), space >> charLiteralConstantWithoutKind)))))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("CHARACTER literal constant"_en_US )), inContext((("CHARACTER literal constant"_en_US)), ((construct <CharLiteralConstant>( kindParam / underscore, charLiteralConstantWithoutKind ) || construct<CharLiteralConstant>(construct<std::optional <KindParam>>(), space >> charLiteralConstantWithoutKind ))))))}; return parser.Parse(state); } | |||
340 | construct<CharLiteralConstant>(template <> auto Parser<typename decltype(attempt(instrumented ((("CHARACTER literal constant"_en_US)), inContext((("CHARACTER literal constant"_en_US )), ((construct<CharLiteralConstant>( kindParam / underscore , charLiteralConstantWithoutKind) || construct<CharLiteralConstant >(construct<std::optional<KindParam>>(), space >> charLiteralConstantWithoutKind)))))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("CHARACTER literal constant"_en_US )), inContext((("CHARACTER literal constant"_en_US)), ((construct <CharLiteralConstant>( kindParam / underscore, charLiteralConstantWithoutKind ) || construct<CharLiteralConstant>(construct<std::optional <KindParam>>(), space >> charLiteralConstantWithoutKind ))))))}; return parser.Parse(state); } | |||
341 | kindParam / underscore, charLiteralConstantWithoutKind) ||template <> auto Parser<typename decltype(attempt(instrumented ((("CHARACTER literal constant"_en_US)), inContext((("CHARACTER literal constant"_en_US )), ((construct<CharLiteralConstant>( kindParam / underscore , charLiteralConstantWithoutKind) || construct<CharLiteralConstant >(construct<std::optional<KindParam>>(), space >> charLiteralConstantWithoutKind)))))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("CHARACTER literal constant"_en_US )), inContext((("CHARACTER literal constant"_en_US)), ((construct <CharLiteralConstant>( kindParam / underscore, charLiteralConstantWithoutKind ) || construct<CharLiteralConstant>(construct<std::optional <KindParam>>(), space >> charLiteralConstantWithoutKind ))))))}; return parser.Parse(state); } | |||
342 | construct<CharLiteralConstant>(construct<std::optional<KindParam>>(),template <> auto Parser<typename decltype(attempt(instrumented ((("CHARACTER literal constant"_en_US)), inContext((("CHARACTER literal constant"_en_US )), ((construct<CharLiteralConstant>( kindParam / underscore , charLiteralConstantWithoutKind) || construct<CharLiteralConstant >(construct<std::optional<KindParam>>(), space >> charLiteralConstantWithoutKind)))))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("CHARACTER literal constant"_en_US )), inContext((("CHARACTER literal constant"_en_US)), ((construct <CharLiteralConstant>( kindParam / underscore, charLiteralConstantWithoutKind ) || construct<CharLiteralConstant>(construct<std::optional <KindParam>>(), space >> charLiteralConstantWithoutKind ))))))}; return parser.Parse(state); } | |||
343 | space >> charLiteralConstantWithoutKind))template <> auto Parser<typename decltype(attempt(instrumented ((("CHARACTER literal constant"_en_US)), inContext((("CHARACTER literal constant"_en_US )), ((construct<CharLiteralConstant>( kindParam / underscore , charLiteralConstantWithoutKind) || construct<CharLiteralConstant >(construct<std::optional<KindParam>>(), space >> charLiteralConstantWithoutKind)))))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("CHARACTER literal constant"_en_US )), inContext((("CHARACTER literal constant"_en_US)), ((construct <CharLiteralConstant>( kindParam / underscore, charLiteralConstantWithoutKind ) || construct<CharLiteralConstant>(construct<std::optional <KindParam>>(), space >> charLiteralConstantWithoutKind ))))))}; return parser.Parse(state); } | |||
344 | ||||
345 | TYPE_CONTEXT_PARSER(template <> auto Parser<typename decltype(attempt(instrumented ((("Hollerith"_en_US)), inContext((("Hollerith"_en_US)), ((construct <HollerithLiteralConstant>(rawHollerithLiteral))))))):: resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(instrumented ((("Hollerith"_en_US)), inContext((("Hollerith"_en_US)), ((construct <HollerithLiteralConstant>(rawHollerithLiteral))))))}; return parser.Parse(state); } | |||
346 | "Hollerith"_en_US, construct<HollerithLiteralConstant>(rawHollerithLiteral))template <> auto Parser<typename decltype(attempt(instrumented ((("Hollerith"_en_US)), inContext((("Hollerith"_en_US)), ((construct <HollerithLiteralConstant>(rawHollerithLiteral))))))):: resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(instrumented ((("Hollerith"_en_US)), inContext((("Hollerith"_en_US)), ((construct <HollerithLiteralConstant>(rawHollerithLiteral))))))}; return parser.Parse(state); } | |||
347 | ||||
348 | // R725 logical-literal-constant -> | |||
349 | // .TRUE. [_ kind-param] | .FALSE. [_ kind-param] | |||
350 | // Also accept .T. and .F. as extensions. | |||
351 | TYPE_PARSER(construct<LogicalLiteralConstant>(logicalTRUE,template <> auto Parser<typename decltype(attempt(construct <LogicalLiteralConstant>(logicalTRUE, maybe(noSpace >> underscore >> noSpace >> kindParam)) || construct <LogicalLiteralConstant>( logicalFALSE, maybe(noSpace >> underscore >> noSpace >> kindParam))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<LogicalLiteralConstant >(logicalTRUE, maybe(noSpace >> underscore >> noSpace >> kindParam)) || construct<LogicalLiteralConstant> ( logicalFALSE, maybe(noSpace >> underscore >> noSpace >> kindParam)))}; return parser.Parse(state); } | |||
352 | maybe(noSpace >> underscore >> noSpace >> kindParam)) ||template <> auto Parser<typename decltype(attempt(construct <LogicalLiteralConstant>(logicalTRUE, maybe(noSpace >> underscore >> noSpace >> kindParam)) || construct <LogicalLiteralConstant>( logicalFALSE, maybe(noSpace >> underscore >> noSpace >> kindParam))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<LogicalLiteralConstant >(logicalTRUE, maybe(noSpace >> underscore >> noSpace >> kindParam)) || construct<LogicalLiteralConstant> ( logicalFALSE, maybe(noSpace >> underscore >> noSpace >> kindParam)))}; return parser.Parse(state); } | |||
353 | construct<LogicalLiteralConstant>(template <> auto Parser<typename decltype(attempt(construct <LogicalLiteralConstant>(logicalTRUE, maybe(noSpace >> underscore >> noSpace >> kindParam)) || construct <LogicalLiteralConstant>( logicalFALSE, maybe(noSpace >> underscore >> noSpace >> kindParam))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<LogicalLiteralConstant >(logicalTRUE, maybe(noSpace >> underscore >> noSpace >> kindParam)) || construct<LogicalLiteralConstant> ( logicalFALSE, maybe(noSpace >> underscore >> noSpace >> kindParam)))}; return parser.Parse(state); } | |||
354 | logicalFALSE, maybe(noSpace >> underscore >> noSpace >> kindParam)))template <> auto Parser<typename decltype(attempt(construct <LogicalLiteralConstant>(logicalTRUE, maybe(noSpace >> underscore >> noSpace >> kindParam)) || construct <LogicalLiteralConstant>( logicalFALSE, maybe(noSpace >> underscore >> noSpace >> kindParam))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<LogicalLiteralConstant >(logicalTRUE, maybe(noSpace >> underscore >> noSpace >> kindParam)) || construct<LogicalLiteralConstant> ( logicalFALSE, maybe(noSpace >> underscore >> noSpace >> kindParam)))}; return parser.Parse(state); } | |||
355 | ||||
356 | // R726 derived-type-def -> | |||
357 | // derived-type-stmt [type-param-def-stmt]... | |||
358 | // [private-or-sequence]... [component-part] | |||
359 | // [type-bound-procedure-part] end-type-stmt | |||
360 | // R735 component-part -> [component-def-stmt]... | |||
361 | TYPE_CONTEXT_PARSER("derived type definition"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("derived type definition"_en_US)), inContext((("derived type definition"_en_US )), ((construct<DerivedTypeDef>(statement(Parser<DerivedTypeStmt >{}), many(unambiguousStatement(Parser<TypeParamDefStmt >{})), many(statement(Parser<PrivateOrSequence>{})), many(inContext("component"_en_US, unambiguousStatement(Parser <ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{}))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("derived type definition"_en_US )), inContext((("derived type definition"_en_US)), ((construct <DerivedTypeDef>(statement(Parser<DerivedTypeStmt> {}), many(unambiguousStatement(Parser<TypeParamDefStmt> {})), many(statement(Parser<PrivateOrSequence>{})), many (inContext("component"_en_US, unambiguousStatement(Parser< ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{})))))))}; return parser.Parse(state); } | |||
362 | construct<DerivedTypeDef>(statement(Parser<DerivedTypeStmt>{}),template <> auto Parser<typename decltype(attempt(instrumented ((("derived type definition"_en_US)), inContext((("derived type definition"_en_US )), ((construct<DerivedTypeDef>(statement(Parser<DerivedTypeStmt >{}), many(unambiguousStatement(Parser<TypeParamDefStmt >{})), many(statement(Parser<PrivateOrSequence>{})), many(inContext("component"_en_US, unambiguousStatement(Parser <ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{}))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("derived type definition"_en_US )), inContext((("derived type definition"_en_US)), ((construct <DerivedTypeDef>(statement(Parser<DerivedTypeStmt> {}), many(unambiguousStatement(Parser<TypeParamDefStmt> {})), many(statement(Parser<PrivateOrSequence>{})), many (inContext("component"_en_US, unambiguousStatement(Parser< ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{})))))))}; return parser.Parse(state); } | |||
363 | many(unambiguousStatement(Parser<TypeParamDefStmt>{})),template <> auto Parser<typename decltype(attempt(instrumented ((("derived type definition"_en_US)), inContext((("derived type definition"_en_US )), ((construct<DerivedTypeDef>(statement(Parser<DerivedTypeStmt >{}), many(unambiguousStatement(Parser<TypeParamDefStmt >{})), many(statement(Parser<PrivateOrSequence>{})), many(inContext("component"_en_US, unambiguousStatement(Parser <ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{}))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("derived type definition"_en_US )), inContext((("derived type definition"_en_US)), ((construct <DerivedTypeDef>(statement(Parser<DerivedTypeStmt> {}), many(unambiguousStatement(Parser<TypeParamDefStmt> {})), many(statement(Parser<PrivateOrSequence>{})), many (inContext("component"_en_US, unambiguousStatement(Parser< ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{})))))))}; return parser.Parse(state); } | |||
364 | many(statement(Parser<PrivateOrSequence>{})),template <> auto Parser<typename decltype(attempt(instrumented ((("derived type definition"_en_US)), inContext((("derived type definition"_en_US )), ((construct<DerivedTypeDef>(statement(Parser<DerivedTypeStmt >{}), many(unambiguousStatement(Parser<TypeParamDefStmt >{})), many(statement(Parser<PrivateOrSequence>{})), many(inContext("component"_en_US, unambiguousStatement(Parser <ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{}))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("derived type definition"_en_US )), inContext((("derived type definition"_en_US)), ((construct <DerivedTypeDef>(statement(Parser<DerivedTypeStmt> {}), many(unambiguousStatement(Parser<TypeParamDefStmt> {})), many(statement(Parser<PrivateOrSequence>{})), many (inContext("component"_en_US, unambiguousStatement(Parser< ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{})))))))}; return parser.Parse(state); } | |||
365 | many(inContext("component"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("derived type definition"_en_US)), inContext((("derived type definition"_en_US )), ((construct<DerivedTypeDef>(statement(Parser<DerivedTypeStmt >{}), many(unambiguousStatement(Parser<TypeParamDefStmt >{})), many(statement(Parser<PrivateOrSequence>{})), many(inContext("component"_en_US, unambiguousStatement(Parser <ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{}))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("derived type definition"_en_US )), inContext((("derived type definition"_en_US)), ((construct <DerivedTypeDef>(statement(Parser<DerivedTypeStmt> {}), many(unambiguousStatement(Parser<TypeParamDefStmt> {})), many(statement(Parser<PrivateOrSequence>{})), many (inContext("component"_en_US, unambiguousStatement(Parser< ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{})))))))}; return parser.Parse(state); } | |||
366 | unambiguousStatement(Parser<ComponentDefStmt>{}))),template <> auto Parser<typename decltype(attempt(instrumented ((("derived type definition"_en_US)), inContext((("derived type definition"_en_US )), ((construct<DerivedTypeDef>(statement(Parser<DerivedTypeStmt >{}), many(unambiguousStatement(Parser<TypeParamDefStmt >{})), many(statement(Parser<PrivateOrSequence>{})), many(inContext("component"_en_US, unambiguousStatement(Parser <ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{}))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("derived type definition"_en_US )), inContext((("derived type definition"_en_US)), ((construct <DerivedTypeDef>(statement(Parser<DerivedTypeStmt> {}), many(unambiguousStatement(Parser<TypeParamDefStmt> {})), many(statement(Parser<PrivateOrSequence>{})), many (inContext("component"_en_US, unambiguousStatement(Parser< ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{})))))))}; return parser.Parse(state); } | |||
367 | maybe(Parser<TypeBoundProcedurePart>{}),template <> auto Parser<typename decltype(attempt(instrumented ((("derived type definition"_en_US)), inContext((("derived type definition"_en_US )), ((construct<DerivedTypeDef>(statement(Parser<DerivedTypeStmt >{}), many(unambiguousStatement(Parser<TypeParamDefStmt >{})), many(statement(Parser<PrivateOrSequence>{})), many(inContext("component"_en_US, unambiguousStatement(Parser <ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{}))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("derived type definition"_en_US )), inContext((("derived type definition"_en_US)), ((construct <DerivedTypeDef>(statement(Parser<DerivedTypeStmt> {}), many(unambiguousStatement(Parser<TypeParamDefStmt> {})), many(statement(Parser<PrivateOrSequence>{})), many (inContext("component"_en_US, unambiguousStatement(Parser< ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{})))))))}; return parser.Parse(state); } | |||
368 | statement(Parser<EndTypeStmt>{})))template <> auto Parser<typename decltype(attempt(instrumented ((("derived type definition"_en_US)), inContext((("derived type definition"_en_US )), ((construct<DerivedTypeDef>(statement(Parser<DerivedTypeStmt >{}), many(unambiguousStatement(Parser<TypeParamDefStmt >{})), many(statement(Parser<PrivateOrSequence>{})), many(inContext("component"_en_US, unambiguousStatement(Parser <ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{}))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("derived type definition"_en_US )), inContext((("derived type definition"_en_US)), ((construct <DerivedTypeDef>(statement(Parser<DerivedTypeStmt> {}), many(unambiguousStatement(Parser<TypeParamDefStmt> {})), many(statement(Parser<PrivateOrSequence>{})), many (inContext("component"_en_US, unambiguousStatement(Parser< ComponentDefStmt>{}))), maybe(Parser<TypeBoundProcedurePart >{}), statement(Parser<EndTypeStmt>{})))))))}; return parser.Parse(state); } | |||
369 | ||||
370 | // R727 derived-type-stmt -> | |||
371 | // TYPE [[, type-attr-spec-list] ::] type-name [( | |||
372 | // type-param-name-list )] | |||
373 | TYPE_CONTEXT_PARSER("TYPE statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("TYPE statement"_en_US)), inContext((("TYPE statement"_en_US )), ((construct<DerivedTypeStmt>( "TYPE" >> optionalListBeforeColons (Parser<TypeAttrSpec>{}), name, defaulted(parenthesized (nonemptyList(name))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("TYPE statement"_en_US)), inContext ((("TYPE statement"_en_US)), ((construct<DerivedTypeStmt> ( "TYPE" >> optionalListBeforeColons(Parser<TypeAttrSpec >{}), name, defaulted(parenthesized(nonemptyList(name))))) ))))}; return parser.Parse(state); } | |||
374 | construct<DerivedTypeStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("TYPE statement"_en_US)), inContext((("TYPE statement"_en_US )), ((construct<DerivedTypeStmt>( "TYPE" >> optionalListBeforeColons (Parser<TypeAttrSpec>{}), name, defaulted(parenthesized (nonemptyList(name))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("TYPE statement"_en_US)), inContext ((("TYPE statement"_en_US)), ((construct<DerivedTypeStmt> ( "TYPE" >> optionalListBeforeColons(Parser<TypeAttrSpec >{}), name, defaulted(parenthesized(nonemptyList(name))))) ))))}; return parser.Parse(state); } | |||
375 | "TYPE" >> optionalListBeforeColons(Parser<TypeAttrSpec>{}), name,template <> auto Parser<typename decltype(attempt(instrumented ((("TYPE statement"_en_US)), inContext((("TYPE statement"_en_US )), ((construct<DerivedTypeStmt>( "TYPE" >> optionalListBeforeColons (Parser<TypeAttrSpec>{}), name, defaulted(parenthesized (nonemptyList(name))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("TYPE statement"_en_US)), inContext ((("TYPE statement"_en_US)), ((construct<DerivedTypeStmt> ( "TYPE" >> optionalListBeforeColons(Parser<TypeAttrSpec >{}), name, defaulted(parenthesized(nonemptyList(name))))) ))))}; return parser.Parse(state); } | |||
376 | defaulted(parenthesized(nonemptyList(name)))))template <> auto Parser<typename decltype(attempt(instrumented ((("TYPE statement"_en_US)), inContext((("TYPE statement"_en_US )), ((construct<DerivedTypeStmt>( "TYPE" >> optionalListBeforeColons (Parser<TypeAttrSpec>{}), name, defaulted(parenthesized (nonemptyList(name))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("TYPE statement"_en_US)), inContext ((("TYPE statement"_en_US)), ((construct<DerivedTypeStmt> ( "TYPE" >> optionalListBeforeColons(Parser<TypeAttrSpec >{}), name, defaulted(parenthesized(nonemptyList(name))))) ))))}; return parser.Parse(state); } | |||
377 | ||||
378 | // R728 type-attr-spec -> | |||
379 | // ABSTRACT | access-spec | BIND(C) | EXTENDS ( parent-type-name ) | |||
380 | TYPE_PARSER(construct<TypeAttrSpec>(construct<Abstract>("ABSTRACT"_tok)) ||template <> auto Parser<typename decltype(attempt(construct <TypeAttrSpec>(construct<Abstract>("ABSTRACT"_tok )) || construct<TypeAttrSpec>(construct<TypeAttrSpec ::BindC>("BIND ( C )"_tok)) || construct<TypeAttrSpec> ( construct<TypeAttrSpec::Extends>("EXTENDS" >> parenthesized (name))) || construct<TypeAttrSpec>(accessSpec)))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<TypeAttrSpec >(construct<Abstract>("ABSTRACT"_tok)) || construct< TypeAttrSpec>(construct<TypeAttrSpec::BindC>("BIND ( C )"_tok )) || construct<TypeAttrSpec>( construct<TypeAttrSpec ::Extends>("EXTENDS" >> parenthesized(name))) || construct <TypeAttrSpec>(accessSpec))}; return parser.Parse(state ); } | |||
381 | construct<TypeAttrSpec>(construct<TypeAttrSpec::BindC>("BIND ( C )"_tok)) ||template <> auto Parser<typename decltype(attempt(construct <TypeAttrSpec>(construct<Abstract>("ABSTRACT"_tok )) || construct<TypeAttrSpec>(construct<TypeAttrSpec ::BindC>("BIND ( C )"_tok)) || construct<TypeAttrSpec> ( construct<TypeAttrSpec::Extends>("EXTENDS" >> parenthesized (name))) || construct<TypeAttrSpec>(accessSpec)))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<TypeAttrSpec >(construct<Abstract>("ABSTRACT"_tok)) || construct< TypeAttrSpec>(construct<TypeAttrSpec::BindC>("BIND ( C )"_tok )) || construct<TypeAttrSpec>( construct<TypeAttrSpec ::Extends>("EXTENDS" >> parenthesized(name))) || construct <TypeAttrSpec>(accessSpec))}; return parser.Parse(state ); } | |||
382 | construct<TypeAttrSpec>(template <> auto Parser<typename decltype(attempt(construct <TypeAttrSpec>(construct<Abstract>("ABSTRACT"_tok )) || construct<TypeAttrSpec>(construct<TypeAttrSpec ::BindC>("BIND ( C )"_tok)) || construct<TypeAttrSpec> ( construct<TypeAttrSpec::Extends>("EXTENDS" >> parenthesized (name))) || construct<TypeAttrSpec>(accessSpec)))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<TypeAttrSpec >(construct<Abstract>("ABSTRACT"_tok)) || construct< TypeAttrSpec>(construct<TypeAttrSpec::BindC>("BIND ( C )"_tok )) || construct<TypeAttrSpec>( construct<TypeAttrSpec ::Extends>("EXTENDS" >> parenthesized(name))) || construct <TypeAttrSpec>(accessSpec))}; return parser.Parse(state ); } | |||
383 | construct<TypeAttrSpec::Extends>("EXTENDS" >> parenthesized(name))) ||template <> auto Parser<typename decltype(attempt(construct <TypeAttrSpec>(construct<Abstract>("ABSTRACT"_tok )) || construct<TypeAttrSpec>(construct<TypeAttrSpec ::BindC>("BIND ( C )"_tok)) || construct<TypeAttrSpec> ( construct<TypeAttrSpec::Extends>("EXTENDS" >> parenthesized (name))) || construct<TypeAttrSpec>(accessSpec)))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<TypeAttrSpec >(construct<Abstract>("ABSTRACT"_tok)) || construct< TypeAttrSpec>(construct<TypeAttrSpec::BindC>("BIND ( C )"_tok )) || construct<TypeAttrSpec>( construct<TypeAttrSpec ::Extends>("EXTENDS" >> parenthesized(name))) || construct <TypeAttrSpec>(accessSpec))}; return parser.Parse(state ); } | |||
384 | construct<TypeAttrSpec>(accessSpec))template <> auto Parser<typename decltype(attempt(construct <TypeAttrSpec>(construct<Abstract>("ABSTRACT"_tok )) || construct<TypeAttrSpec>(construct<TypeAttrSpec ::BindC>("BIND ( C )"_tok)) || construct<TypeAttrSpec> ( construct<TypeAttrSpec::Extends>("EXTENDS" >> parenthesized (name))) || construct<TypeAttrSpec>(accessSpec)))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<TypeAttrSpec >(construct<Abstract>("ABSTRACT"_tok)) || construct< TypeAttrSpec>(construct<TypeAttrSpec::BindC>("BIND ( C )"_tok )) || construct<TypeAttrSpec>( construct<TypeAttrSpec ::Extends>("EXTENDS" >> parenthesized(name))) || construct <TypeAttrSpec>(accessSpec))}; return parser.Parse(state ); } | |||
385 | ||||
386 | // R729 private-or-sequence -> private-components-stmt | sequence-stmt | |||
387 | TYPE_PARSER(construct<PrivateOrSequence>(Parser<PrivateStmt>{}) ||template <> auto Parser<typename decltype(attempt(construct <PrivateOrSequence>(Parser<PrivateStmt>{}) || construct <PrivateOrSequence>(Parser<SequenceStmt>{})))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<PrivateOrSequence >(Parser<PrivateStmt>{}) || construct<PrivateOrSequence >(Parser<SequenceStmt>{}))}; return parser.Parse(state ); } | |||
388 | construct<PrivateOrSequence>(Parser<SequenceStmt>{}))template <> auto Parser<typename decltype(attempt(construct <PrivateOrSequence>(Parser<PrivateStmt>{}) || construct <PrivateOrSequence>(Parser<SequenceStmt>{})))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<PrivateOrSequence >(Parser<PrivateStmt>{}) || construct<PrivateOrSequence >(Parser<SequenceStmt>{}))}; return parser.Parse(state ); } | |||
389 | ||||
390 | // R730 end-type-stmt -> END TYPE [type-name] | |||
391 | TYPE_PARSER(construct<EndTypeStmt>(template <> auto Parser<typename decltype(attempt(construct <EndTypeStmt>( recovery("END TYPE" >> maybe(name) , namedConstructEndStmtErrorRecovery))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<EndTypeStmt> ( recovery("END TYPE" >> maybe(name), namedConstructEndStmtErrorRecovery )))}; return parser.Parse(state); } | |||
392 | recovery("END TYPE" >> maybe(name), namedConstructEndStmtErrorRecovery)))template <> auto Parser<typename decltype(attempt(construct <EndTypeStmt>( recovery("END TYPE" >> maybe(name) , namedConstructEndStmtErrorRecovery))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<EndTypeStmt> ( recovery("END TYPE" >> maybe(name), namedConstructEndStmtErrorRecovery )))}; return parser.Parse(state); } | |||
393 | ||||
394 | // R731 sequence-stmt -> SEQUENCE | |||
395 | TYPE_PARSER(construct<SequenceStmt>("SEQUENCE"_tok))template <> auto Parser<typename decltype(attempt(construct <SequenceStmt>("SEQUENCE"_tok)))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<SequenceStmt> ("SEQUENCE"_tok))}; return parser.Parse(state); } | |||
396 | ||||
397 | // R732 type-param-def-stmt -> | |||
398 | // integer-type-spec , type-param-attr-spec :: type-param-decl-list | |||
399 | // R734 type-param-attr-spec -> KIND | LEN | |||
400 | constexpr auto kindOrLen{"KIND" >> pure(common::TypeParamAttr::Kind) || | |||
401 | "LEN" >> pure(common::TypeParamAttr::Len)}; | |||
402 | TYPE_PARSER(construct<TypeParamDefStmt>(integerTypeSpec / ",", kindOrLen,template <> auto Parser<typename decltype(attempt(construct <TypeParamDefStmt>(integerTypeSpec / ",", kindOrLen, "::" >> nonemptyList("expected type parameter declarations"_err_en_US , Parser<TypeParamDecl>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeParamDefStmt>(integerTypeSpec / ",", kindOrLen, "::" >> nonemptyList("expected type parameter declarations"_err_en_US , Parser<TypeParamDecl>{})))}; return parser.Parse(state ); } | |||
403 | "::" >> nonemptyList("expected type parameter declarations"_err_en_US,template <> auto Parser<typename decltype(attempt(construct <TypeParamDefStmt>(integerTypeSpec / ",", kindOrLen, "::" >> nonemptyList("expected type parameter declarations"_err_en_US , Parser<TypeParamDecl>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeParamDefStmt>(integerTypeSpec / ",", kindOrLen, "::" >> nonemptyList("expected type parameter declarations"_err_en_US , Parser<TypeParamDecl>{})))}; return parser.Parse(state ); } | |||
404 | Parser<TypeParamDecl>{})))template <> auto Parser<typename decltype(attempt(construct <TypeParamDefStmt>(integerTypeSpec / ",", kindOrLen, "::" >> nonemptyList("expected type parameter declarations"_err_en_US , Parser<TypeParamDecl>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeParamDefStmt>(integerTypeSpec / ",", kindOrLen, "::" >> nonemptyList("expected type parameter declarations"_err_en_US , Parser<TypeParamDecl>{})))}; return parser.Parse(state ); } | |||
405 | ||||
406 | // R733 type-param-decl -> type-param-name [= scalar-int-constant-expr] | |||
407 | TYPE_PARSER(construct<TypeParamDecl>(name, maybe("=" >> scalarIntConstantExpr)))template <> auto Parser<typename decltype(attempt(construct <TypeParamDecl>(name, maybe("=" >> scalarIntConstantExpr ))))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <TypeParamDecl>(name, maybe("=" >> scalarIntConstantExpr )))}; return parser.Parse(state); } | |||
408 | ||||
409 | // R736 component-def-stmt -> data-component-def-stmt | | |||
410 | // proc-component-def-stmt | |||
411 | // Accidental extension not enabled here: PGI accepts type-param-def-stmt in | |||
412 | // component-part of derived-type-def. | |||
413 | TYPE_PARSER(recovery(template <> auto Parser<typename decltype(attempt(recovery ( withMessage("expected component definition"_err_en_US, first (construct<ComponentDefStmt>(Parser<DataComponentDefStmt >{}), construct<ComponentDefStmt>(Parser<ProcComponentDefStmt >{}))), construct<ComponentDefStmt>(inStmtErrorRecovery ))))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(recovery ( withMessage("expected component definition"_err_en_US, first (construct<ComponentDefStmt>(Parser<DataComponentDefStmt >{}), construct<ComponentDefStmt>(Parser<ProcComponentDefStmt >{}))), construct<ComponentDefStmt>(inStmtErrorRecovery )))}; return parser.Parse(state); } | |||
414 | withMessage("expected component definition"_err_en_US,template <> auto Parser<typename decltype(attempt(recovery ( withMessage("expected component definition"_err_en_US, first (construct<ComponentDefStmt>(Parser<DataComponentDefStmt >{}), construct<ComponentDefStmt>(Parser<ProcComponentDefStmt >{}))), construct<ComponentDefStmt>(inStmtErrorRecovery ))))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(recovery ( withMessage("expected component definition"_err_en_US, first (construct<ComponentDefStmt>(Parser<DataComponentDefStmt >{}), construct<ComponentDefStmt>(Parser<ProcComponentDefStmt >{}))), construct<ComponentDefStmt>(inStmtErrorRecovery )))}; return parser.Parse(state); } | |||
415 | first(construct<ComponentDefStmt>(Parser<DataComponentDefStmt>{}),template <> auto Parser<typename decltype(attempt(recovery ( withMessage("expected component definition"_err_en_US, first (construct<ComponentDefStmt>(Parser<DataComponentDefStmt >{}), construct<ComponentDefStmt>(Parser<ProcComponentDefStmt >{}))), construct<ComponentDefStmt>(inStmtErrorRecovery ))))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(recovery ( withMessage("expected component definition"_err_en_US, first (construct<ComponentDefStmt>(Parser<DataComponentDefStmt >{}), construct<ComponentDefStmt>(Parser<ProcComponentDefStmt >{}))), construct<ComponentDefStmt>(inStmtErrorRecovery )))}; return parser.Parse(state); } | |||
416 | construct<ComponentDefStmt>(Parser<ProcComponentDefStmt>{}))),template <> auto Parser<typename decltype(attempt(recovery ( withMessage("expected component definition"_err_en_US, first (construct<ComponentDefStmt>(Parser<DataComponentDefStmt >{}), construct<ComponentDefStmt>(Parser<ProcComponentDefStmt >{}))), construct<ComponentDefStmt>(inStmtErrorRecovery ))))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(recovery ( withMessage("expected component definition"_err_en_US, first (construct<ComponentDefStmt>(Parser<DataComponentDefStmt >{}), construct<ComponentDefStmt>(Parser<ProcComponentDefStmt >{}))), construct<ComponentDefStmt>(inStmtErrorRecovery )))}; return parser.Parse(state); } | |||
417 | construct<ComponentDefStmt>(inStmtErrorRecovery)))template <> auto Parser<typename decltype(attempt(recovery ( withMessage("expected component definition"_err_en_US, first (construct<ComponentDefStmt>(Parser<DataComponentDefStmt >{}), construct<ComponentDefStmt>(Parser<ProcComponentDefStmt >{}))), construct<ComponentDefStmt>(inStmtErrorRecovery ))))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(recovery ( withMessage("expected component definition"_err_en_US, first (construct<ComponentDefStmt>(Parser<DataComponentDefStmt >{}), construct<ComponentDefStmt>(Parser<ProcComponentDefStmt >{}))), construct<ComponentDefStmt>(inStmtErrorRecovery )))}; return parser.Parse(state); } | |||
418 | ||||
419 | // R737 data-component-def-stmt -> | |||
420 | // declaration-type-spec [[, component-attr-spec-list] ::] | |||
421 | // component-decl-list | |||
422 | // N.B. The standard requires double colons if there's an initializer. | |||
423 | TYPE_PARSER(construct<DataComponentDefStmt>(declarationTypeSpec,template <> auto Parser<typename decltype(attempt(construct <DataComponentDefStmt>(declarationTypeSpec, optionalListBeforeColons (Parser<ComponentAttrSpec>{}), nonemptyList("expected component declarations"_err_en_US , Parser<ComponentOrFill>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataComponentDefStmt >(declarationTypeSpec, optionalListBeforeColons(Parser< ComponentAttrSpec>{}), nonemptyList("expected component declarations"_err_en_US , Parser<ComponentOrFill>{})))}; return parser.Parse(state ); } | |||
424 | optionalListBeforeColons(Parser<ComponentAttrSpec>{}),template <> auto Parser<typename decltype(attempt(construct <DataComponentDefStmt>(declarationTypeSpec, optionalListBeforeColons (Parser<ComponentAttrSpec>{}), nonemptyList("expected component declarations"_err_en_US , Parser<ComponentOrFill>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataComponentDefStmt >(declarationTypeSpec, optionalListBeforeColons(Parser< ComponentAttrSpec>{}), nonemptyList("expected component declarations"_err_en_US , Parser<ComponentOrFill>{})))}; return parser.Parse(state ); } | |||
425 | nonemptyList("expected component declarations"_err_en_US,template <> auto Parser<typename decltype(attempt(construct <DataComponentDefStmt>(declarationTypeSpec, optionalListBeforeColons (Parser<ComponentAttrSpec>{}), nonemptyList("expected component declarations"_err_en_US , Parser<ComponentOrFill>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataComponentDefStmt >(declarationTypeSpec, optionalListBeforeColons(Parser< ComponentAttrSpec>{}), nonemptyList("expected component declarations"_err_en_US , Parser<ComponentOrFill>{})))}; return parser.Parse(state ); } | |||
426 | Parser<ComponentOrFill>{})))template <> auto Parser<typename decltype(attempt(construct <DataComponentDefStmt>(declarationTypeSpec, optionalListBeforeColons (Parser<ComponentAttrSpec>{}), nonemptyList("expected component declarations"_err_en_US , Parser<ComponentOrFill>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataComponentDefStmt >(declarationTypeSpec, optionalListBeforeColons(Parser< ComponentAttrSpec>{}), nonemptyList("expected component declarations"_err_en_US , Parser<ComponentOrFill>{})))}; return parser.Parse(state ); } | |||
427 | ||||
428 | // R738 component-attr-spec -> | |||
429 | // access-spec | ALLOCATABLE | | |||
430 | // CODIMENSION lbracket coarray-spec rbracket | | |||
431 | // CONTIGUOUS | DIMENSION ( component-array-spec ) | POINTER | |||
432 | TYPE_PARSER(construct<ComponentAttrSpec>(accessSpec) ||template <> auto Parser<typename decltype(attempt(construct <ComponentAttrSpec>(accessSpec) || construct<ComponentAttrSpec >(allocatable) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>( contiguous) || construct<ComponentAttrSpec>("DIMENSION" >> Parser<ComponentArraySpec>{}) || construct< ComponentAttrSpec>(pointer) || construct<ComponentAttrSpec >(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>()))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ComponentAttrSpec >(accessSpec) || construct<ComponentAttrSpec>(allocatable ) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>(contiguous ) || construct<ComponentAttrSpec>("DIMENSION" >> Parser <ComponentArraySpec>{}) || construct<ComponentAttrSpec >(pointer) || construct<ComponentAttrSpec>(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>())))}; return parser.Parse(state); } | |||
433 | construct<ComponentAttrSpec>(allocatable) ||template <> auto Parser<typename decltype(attempt(construct <ComponentAttrSpec>(accessSpec) || construct<ComponentAttrSpec >(allocatable) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>( contiguous) || construct<ComponentAttrSpec>("DIMENSION" >> Parser<ComponentArraySpec>{}) || construct< ComponentAttrSpec>(pointer) || construct<ComponentAttrSpec >(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>()))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ComponentAttrSpec >(accessSpec) || construct<ComponentAttrSpec>(allocatable ) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>(contiguous ) || construct<ComponentAttrSpec>("DIMENSION" >> Parser <ComponentArraySpec>{}) || construct<ComponentAttrSpec >(pointer) || construct<ComponentAttrSpec>(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>())))}; return parser.Parse(state); } | |||
434 | construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) ||template <> auto Parser<typename decltype(attempt(construct <ComponentAttrSpec>(accessSpec) || construct<ComponentAttrSpec >(allocatable) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>( contiguous) || construct<ComponentAttrSpec>("DIMENSION" >> Parser<ComponentArraySpec>{}) || construct< ComponentAttrSpec>(pointer) || construct<ComponentAttrSpec >(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>()))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ComponentAttrSpec >(accessSpec) || construct<ComponentAttrSpec>(allocatable ) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>(contiguous ) || construct<ComponentAttrSpec>("DIMENSION" >> Parser <ComponentArraySpec>{}) || construct<ComponentAttrSpec >(pointer) || construct<ComponentAttrSpec>(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>())))}; return parser.Parse(state); } | |||
435 | construct<ComponentAttrSpec>(contiguous) ||template <> auto Parser<typename decltype(attempt(construct <ComponentAttrSpec>(accessSpec) || construct<ComponentAttrSpec >(allocatable) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>( contiguous) || construct<ComponentAttrSpec>("DIMENSION" >> Parser<ComponentArraySpec>{}) || construct< ComponentAttrSpec>(pointer) || construct<ComponentAttrSpec >(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>()))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ComponentAttrSpec >(accessSpec) || construct<ComponentAttrSpec>(allocatable ) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>(contiguous ) || construct<ComponentAttrSpec>("DIMENSION" >> Parser <ComponentArraySpec>{}) || construct<ComponentAttrSpec >(pointer) || construct<ComponentAttrSpec>(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>())))}; return parser.Parse(state); } | |||
436 | construct<ComponentAttrSpec>("DIMENSION" >> Parser<ComponentArraySpec>{}) ||template <> auto Parser<typename decltype(attempt(construct <ComponentAttrSpec>(accessSpec) || construct<ComponentAttrSpec >(allocatable) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>( contiguous) || construct<ComponentAttrSpec>("DIMENSION" >> Parser<ComponentArraySpec>{}) || construct< ComponentAttrSpec>(pointer) || construct<ComponentAttrSpec >(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>()))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ComponentAttrSpec >(accessSpec) || construct<ComponentAttrSpec>(allocatable ) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>(contiguous ) || construct<ComponentAttrSpec>("DIMENSION" >> Parser <ComponentArraySpec>{}) || construct<ComponentAttrSpec >(pointer) || construct<ComponentAttrSpec>(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>())))}; return parser.Parse(state); } | |||
437 | construct<ComponentAttrSpec>(pointer) ||template <> auto Parser<typename decltype(attempt(construct <ComponentAttrSpec>(accessSpec) || construct<ComponentAttrSpec >(allocatable) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>( contiguous) || construct<ComponentAttrSpec>("DIMENSION" >> Parser<ComponentArraySpec>{}) || construct< ComponentAttrSpec>(pointer) || construct<ComponentAttrSpec >(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>()))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ComponentAttrSpec >(accessSpec) || construct<ComponentAttrSpec>(allocatable ) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>(contiguous ) || construct<ComponentAttrSpec>("DIMENSION" >> Parser <ComponentArraySpec>{}) || construct<ComponentAttrSpec >(pointer) || construct<ComponentAttrSpec>(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>())))}; return parser.Parse(state); } | |||
438 | construct<ComponentAttrSpec>(recovery(template <> auto Parser<typename decltype(attempt(construct <ComponentAttrSpec>(accessSpec) || construct<ComponentAttrSpec >(allocatable) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>( contiguous) || construct<ComponentAttrSpec>("DIMENSION" >> Parser<ComponentArraySpec>{}) || construct< ComponentAttrSpec>(pointer) || construct<ComponentAttrSpec >(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>()))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ComponentAttrSpec >(accessSpec) || construct<ComponentAttrSpec>(allocatable ) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>(contiguous ) || construct<ComponentAttrSpec>("DIMENSION" >> Parser <ComponentArraySpec>{}) || construct<ComponentAttrSpec >(pointer) || construct<ComponentAttrSpec>(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>())))}; return parser.Parse(state); } | |||
439 | fail<ErrorRecovery>(template <> auto Parser<typename decltype(attempt(construct <ComponentAttrSpec>(accessSpec) || construct<ComponentAttrSpec >(allocatable) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>( contiguous) || construct<ComponentAttrSpec>("DIMENSION" >> Parser<ComponentArraySpec>{}) || construct< ComponentAttrSpec>(pointer) || construct<ComponentAttrSpec >(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>()))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ComponentAttrSpec >(accessSpec) || construct<ComponentAttrSpec>(allocatable ) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>(contiguous ) || construct<ComponentAttrSpec>("DIMENSION" >> Parser <ComponentArraySpec>{}) || construct<ComponentAttrSpec >(pointer) || construct<ComponentAttrSpec>(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>())))}; return parser.Parse(state); } | |||
440 | "type parameter definitions must appear before component declarations"_err_en_US),template <> auto Parser<typename decltype(attempt(construct <ComponentAttrSpec>(accessSpec) || construct<ComponentAttrSpec >(allocatable) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>( contiguous) || construct<ComponentAttrSpec>("DIMENSION" >> Parser<ComponentArraySpec>{}) || construct< ComponentAttrSpec>(pointer) || construct<ComponentAttrSpec >(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>()))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ComponentAttrSpec >(accessSpec) || construct<ComponentAttrSpec>(allocatable ) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>(contiguous ) || construct<ComponentAttrSpec>("DIMENSION" >> Parser <ComponentArraySpec>{}) || construct<ComponentAttrSpec >(pointer) || construct<ComponentAttrSpec>(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>())))}; return parser.Parse(state); } | |||
441 | kindOrLen >> construct<ErrorRecovery>())))template <> auto Parser<typename decltype(attempt(construct <ComponentAttrSpec>(accessSpec) || construct<ComponentAttrSpec >(allocatable) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>( contiguous) || construct<ComponentAttrSpec>("DIMENSION" >> Parser<ComponentArraySpec>{}) || construct< ComponentAttrSpec>(pointer) || construct<ComponentAttrSpec >(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>()))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ComponentAttrSpec >(accessSpec) || construct<ComponentAttrSpec>(allocatable ) || construct<ComponentAttrSpec>("CODIMENSION" >> coarraySpec) || construct<ComponentAttrSpec>(contiguous ) || construct<ComponentAttrSpec>("DIMENSION" >> Parser <ComponentArraySpec>{}) || construct<ComponentAttrSpec >(pointer) || construct<ComponentAttrSpec>(recovery( fail<ErrorRecovery>( "type parameter definitions must appear before component declarations"_err_en_US ), kindOrLen >> construct<ErrorRecovery>())))}; return parser.Parse(state); } | |||
442 | ||||
443 | // R739 component-decl -> | |||
444 | // component-name [( component-array-spec )] | |||
445 | // [lbracket coarray-spec rbracket] [* char-length] | |||
446 | // [component-initialization] | |||
447 | TYPE_CONTEXT_PARSER("component declaration"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("component declaration"_en_US)), inContext((("component declaration"_en_US )), ((construct<ComponentDecl>(name, maybe(Parser<ComponentArraySpec >{}), maybe(coarraySpec), maybe("*" >> charLength), maybe (initialization))))))))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("component declaration"_en_US)), inContext((("component declaration"_en_US)), ((construct< ComponentDecl>(name, maybe(Parser<ComponentArraySpec> {}), maybe(coarraySpec), maybe("*" >> charLength), maybe (initialization)))))))}; return parser.Parse(state); } | |||
448 | construct<ComponentDecl>(name, maybe(Parser<ComponentArraySpec>{}),template <> auto Parser<typename decltype(attempt(instrumented ((("component declaration"_en_US)), inContext((("component declaration"_en_US )), ((construct<ComponentDecl>(name, maybe(Parser<ComponentArraySpec >{}), maybe(coarraySpec), maybe("*" >> charLength), maybe (initialization))))))))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("component declaration"_en_US)), inContext((("component declaration"_en_US)), ((construct< ComponentDecl>(name, maybe(Parser<ComponentArraySpec> {}), maybe(coarraySpec), maybe("*" >> charLength), maybe (initialization)))))))}; return parser.Parse(state); } | |||
449 | maybe(coarraySpec), maybe("*" >> charLength), maybe(initialization)))template <> auto Parser<typename decltype(attempt(instrumented ((("component declaration"_en_US)), inContext((("component declaration"_en_US )), ((construct<ComponentDecl>(name, maybe(Parser<ComponentArraySpec >{}), maybe(coarraySpec), maybe("*" >> charLength), maybe (initialization))))))))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("component declaration"_en_US)), inContext((("component declaration"_en_US)), ((construct< ComponentDecl>(name, maybe(Parser<ComponentArraySpec> {}), maybe(coarraySpec), maybe("*" >> charLength), maybe (initialization)))))))}; return parser.Parse(state); } | |||
450 | // The source field of the Name will be replaced with a distinct generated name. | |||
451 | TYPE_CONTEXT_PARSER("%FILL item"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("%FILL item"_en_US)), inContext((("%FILL item"_en_US)), (( extension<LanguageFeature::DECStructures>( "nonstandard usage: %FILL"_port_en_US , construct<FillDecl>(space >> sourced("%FILL" >> construct<Name>()), maybe(Parser<ComponentArraySpec >{}), maybe("*" >> charLength)))))))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("%FILL item"_en_US )), inContext((("%FILL item"_en_US)), ((extension<LanguageFeature ::DECStructures>( "nonstandard usage: %FILL"_port_en_US, construct <FillDecl>(space >> sourced("%FILL" >> construct <Name>()), maybe(Parser<ComponentArraySpec>{}), maybe ("*" >> charLength))))))))}; return parser.Parse(state) ; } | |||
452 | extension<LanguageFeature::DECStructures>(template <> auto Parser<typename decltype(attempt(instrumented ((("%FILL item"_en_US)), inContext((("%FILL item"_en_US)), (( extension<LanguageFeature::DECStructures>( "nonstandard usage: %FILL"_port_en_US , construct<FillDecl>(space >> sourced("%FILL" >> construct<Name>()), maybe(Parser<ComponentArraySpec >{}), maybe("*" >> charLength)))))))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("%FILL item"_en_US )), inContext((("%FILL item"_en_US)), ((extension<LanguageFeature ::DECStructures>( "nonstandard usage: %FILL"_port_en_US, construct <FillDecl>(space >> sourced("%FILL" >> construct <Name>()), maybe(Parser<ComponentArraySpec>{}), maybe ("*" >> charLength))))))))}; return parser.Parse(state) ; } | |||
453 | "nonstandard usage: %FILL"_port_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("%FILL item"_en_US)), inContext((("%FILL item"_en_US)), (( extension<LanguageFeature::DECStructures>( "nonstandard usage: %FILL"_port_en_US , construct<FillDecl>(space >> sourced("%FILL" >> construct<Name>()), maybe(Parser<ComponentArraySpec >{}), maybe("*" >> charLength)))))))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("%FILL item"_en_US )), inContext((("%FILL item"_en_US)), ((extension<LanguageFeature ::DECStructures>( "nonstandard usage: %FILL"_port_en_US, construct <FillDecl>(space >> sourced("%FILL" >> construct <Name>()), maybe(Parser<ComponentArraySpec>{}), maybe ("*" >> charLength))))))))}; return parser.Parse(state) ; } | |||
454 | construct<FillDecl>(space >> sourced("%FILL" >> construct<Name>()),template <> auto Parser<typename decltype(attempt(instrumented ((("%FILL item"_en_US)), inContext((("%FILL item"_en_US)), (( extension<LanguageFeature::DECStructures>( "nonstandard usage: %FILL"_port_en_US , construct<FillDecl>(space >> sourced("%FILL" >> construct<Name>()), maybe(Parser<ComponentArraySpec >{}), maybe("*" >> charLength)))))))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("%FILL item"_en_US )), inContext((("%FILL item"_en_US)), ((extension<LanguageFeature ::DECStructures>( "nonstandard usage: %FILL"_port_en_US, construct <FillDecl>(space >> sourced("%FILL" >> construct <Name>()), maybe(Parser<ComponentArraySpec>{}), maybe ("*" >> charLength))))))))}; return parser.Parse(state) ; } | |||
455 | maybe(Parser<ComponentArraySpec>{}), maybe("*" >> charLength))))template <> auto Parser<typename decltype(attempt(instrumented ((("%FILL item"_en_US)), inContext((("%FILL item"_en_US)), (( extension<LanguageFeature::DECStructures>( "nonstandard usage: %FILL"_port_en_US , construct<FillDecl>(space >> sourced("%FILL" >> construct<Name>()), maybe(Parser<ComponentArraySpec >{}), maybe("*" >> charLength)))))))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("%FILL item"_en_US )), inContext((("%FILL item"_en_US)), ((extension<LanguageFeature ::DECStructures>( "nonstandard usage: %FILL"_port_en_US, construct <FillDecl>(space >> sourced("%FILL" >> construct <Name>()), maybe(Parser<ComponentArraySpec>{}), maybe ("*" >> charLength))))))))}; return parser.Parse(state) ; } | |||
456 | TYPE_PARSER(construct<ComponentOrFill>(Parser<ComponentDecl>{}) ||template <> auto Parser<typename decltype(attempt(construct <ComponentOrFill>(Parser<ComponentDecl>{}) || construct <ComponentOrFill>(Parser<FillDecl>{})))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ComponentOrFill >(Parser<ComponentDecl>{}) || construct<ComponentOrFill >(Parser<FillDecl>{}))}; return parser.Parse(state); } | |||
457 | construct<ComponentOrFill>(Parser<FillDecl>{}))template <> auto Parser<typename decltype(attempt(construct <ComponentOrFill>(Parser<ComponentDecl>{}) || construct <ComponentOrFill>(Parser<FillDecl>{})))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ComponentOrFill >(Parser<ComponentDecl>{}) || construct<ComponentOrFill >(Parser<FillDecl>{}))}; return parser.Parse(state); } | |||
458 | ||||
459 | // R740 component-array-spec -> | |||
460 | // explicit-shape-spec-list | deferred-shape-spec-list | |||
461 | // N.B. Parenthesized here rather than around references to this production. | |||
462 | TYPE_PARSER(construct<ComponentArraySpec>(parenthesized(template <> auto Parser<typename decltype(attempt(construct <ComponentArraySpec>(parenthesized( nonemptyList("expected explicit shape specifications"_err_en_US , explicitShapeSpec))) || construct<ComponentArraySpec> (parenthesized(deferredShapeSpecList))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<ComponentArraySpec >(parenthesized( nonemptyList("expected explicit shape specifications"_err_en_US , explicitShapeSpec))) || construct<ComponentArraySpec> (parenthesized(deferredShapeSpecList)))}; return parser.Parse (state); } | |||
463 | nonemptyList("expected explicit shape specifications"_err_en_US,template <> auto Parser<typename decltype(attempt(construct <ComponentArraySpec>(parenthesized( nonemptyList("expected explicit shape specifications"_err_en_US , explicitShapeSpec))) || construct<ComponentArraySpec> (parenthesized(deferredShapeSpecList))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<ComponentArraySpec >(parenthesized( nonemptyList("expected explicit shape specifications"_err_en_US , explicitShapeSpec))) || construct<ComponentArraySpec> (parenthesized(deferredShapeSpecList)))}; return parser.Parse (state); } | |||
464 | explicitShapeSpec))) ||template <> auto Parser<typename decltype(attempt(construct <ComponentArraySpec>(parenthesized( nonemptyList("expected explicit shape specifications"_err_en_US , explicitShapeSpec))) || construct<ComponentArraySpec> (parenthesized(deferredShapeSpecList))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<ComponentArraySpec >(parenthesized( nonemptyList("expected explicit shape specifications"_err_en_US , explicitShapeSpec))) || construct<ComponentArraySpec> (parenthesized(deferredShapeSpecList)))}; return parser.Parse (state); } | |||
465 | construct<ComponentArraySpec>(parenthesized(deferredShapeSpecList)))template <> auto Parser<typename decltype(attempt(construct <ComponentArraySpec>(parenthesized( nonemptyList("expected explicit shape specifications"_err_en_US , explicitShapeSpec))) || construct<ComponentArraySpec> (parenthesized(deferredShapeSpecList))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<ComponentArraySpec >(parenthesized( nonemptyList("expected explicit shape specifications"_err_en_US , explicitShapeSpec))) || construct<ComponentArraySpec> (parenthesized(deferredShapeSpecList)))}; return parser.Parse (state); } | |||
466 | ||||
467 | // R741 proc-component-def-stmt -> | |||
468 | // PROCEDURE ( [proc-interface] ) , proc-component-attr-spec-list | |||
469 | // :: proc-decl-list | |||
470 | TYPE_CONTEXT_PARSER("PROCEDURE component definition statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("PROCEDURE component definition statement"_en_US)), inContext ((("PROCEDURE component definition statement"_en_US)), ((construct <ProcComponentDefStmt>( "PROCEDURE" >> parenthesized (maybe(procInterface)), localRecovery("expected PROCEDURE component attributes"_err_en_US , "," >> nonemptyList(Parser<ProcComponentAttrSpec> {}), ok), localRecovery("expected PROCEDURE declarations"_err_en_US , "::" >> nonemptyList(procDecl), SkipTo<'\n'>{}) )))))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( instrumented((("PROCEDURE component definition statement"_en_US )), inContext((("PROCEDURE component definition statement"_en_US )), ((construct<ProcComponentDefStmt>( "PROCEDURE" >> parenthesized(maybe(procInterface)), localRecovery("expected PROCEDURE component attributes"_err_en_US , "," >> nonemptyList(Parser<ProcComponentAttrSpec> {}), ok), localRecovery("expected PROCEDURE declarations"_err_en_US , "::" >> nonemptyList(procDecl), SkipTo<'\n'>{}) ))))))}; return parser.Parse(state); } | |||
471 | construct<ProcComponentDefStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("PROCEDURE component definition statement"_en_US)), inContext ((("PROCEDURE component definition statement"_en_US)), ((construct <ProcComponentDefStmt>( "PROCEDURE" >> parenthesized (maybe(procInterface)), localRecovery("expected PROCEDURE component attributes"_err_en_US , "," >> nonemptyList(Parser<ProcComponentAttrSpec> {}), ok), localRecovery("expected PROCEDURE declarations"_err_en_US , "::" >> nonemptyList(procDecl), SkipTo<'\n'>{}) )))))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( instrumented((("PROCEDURE component definition statement"_en_US )), inContext((("PROCEDURE component definition statement"_en_US )), ((construct<ProcComponentDefStmt>( "PROCEDURE" >> parenthesized(maybe(procInterface)), localRecovery("expected PROCEDURE component attributes"_err_en_US , "," >> nonemptyList(Parser<ProcComponentAttrSpec> {}), ok), localRecovery("expected PROCEDURE declarations"_err_en_US , "::" >> nonemptyList(procDecl), SkipTo<'\n'>{}) ))))))}; return parser.Parse(state); } | |||
472 | "PROCEDURE" >> parenthesized(maybe(procInterface)),template <> auto Parser<typename decltype(attempt(instrumented ((("PROCEDURE component definition statement"_en_US)), inContext ((("PROCEDURE component definition statement"_en_US)), ((construct <ProcComponentDefStmt>( "PROCEDURE" >> parenthesized (maybe(procInterface)), localRecovery("expected PROCEDURE component attributes"_err_en_US , "," >> nonemptyList(Parser<ProcComponentAttrSpec> {}), ok), localRecovery("expected PROCEDURE declarations"_err_en_US , "::" >> nonemptyList(procDecl), SkipTo<'\n'>{}) )))))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( instrumented((("PROCEDURE component definition statement"_en_US )), inContext((("PROCEDURE component definition statement"_en_US )), ((construct<ProcComponentDefStmt>( "PROCEDURE" >> parenthesized(maybe(procInterface)), localRecovery("expected PROCEDURE component attributes"_err_en_US , "," >> nonemptyList(Parser<ProcComponentAttrSpec> {}), ok), localRecovery("expected PROCEDURE declarations"_err_en_US , "::" >> nonemptyList(procDecl), SkipTo<'\n'>{}) ))))))}; return parser.Parse(state); } | |||
473 | localRecovery("expected PROCEDURE component attributes"_err_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("PROCEDURE component definition statement"_en_US)), inContext ((("PROCEDURE component definition statement"_en_US)), ((construct <ProcComponentDefStmt>( "PROCEDURE" >> parenthesized (maybe(procInterface)), localRecovery("expected PROCEDURE component attributes"_err_en_US , "," >> nonemptyList(Parser<ProcComponentAttrSpec> {}), ok), localRecovery("expected PROCEDURE declarations"_err_en_US , "::" >> nonemptyList(procDecl), SkipTo<'\n'>{}) )))))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( instrumented((("PROCEDURE component definition statement"_en_US )), inContext((("PROCEDURE component definition statement"_en_US )), ((construct<ProcComponentDefStmt>( "PROCEDURE" >> parenthesized(maybe(procInterface)), localRecovery("expected PROCEDURE component attributes"_err_en_US , "," >> nonemptyList(Parser<ProcComponentAttrSpec> {}), ok), localRecovery("expected PROCEDURE declarations"_err_en_US , "::" >> nonemptyList(procDecl), SkipTo<'\n'>{}) ))))))}; return parser.Parse(state); } | |||
474 | "," >> nonemptyList(Parser<ProcComponentAttrSpec>{}), ok),template <> auto Parser<typename decltype(attempt(instrumented ((("PROCEDURE component definition statement"_en_US)), inContext ((("PROCEDURE component definition statement"_en_US)), ((construct <ProcComponentDefStmt>( "PROCEDURE" >> parenthesized (maybe(procInterface)), localRecovery("expected PROCEDURE component attributes"_err_en_US , "," >> nonemptyList(Parser<ProcComponentAttrSpec> {}), ok), localRecovery("expected PROCEDURE declarations"_err_en_US , "::" >> nonemptyList(procDecl), SkipTo<'\n'>{}) )))))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( instrumented((("PROCEDURE component definition statement"_en_US )), inContext((("PROCEDURE component definition statement"_en_US )), ((construct<ProcComponentDefStmt>( "PROCEDURE" >> parenthesized(maybe(procInterface)), localRecovery("expected PROCEDURE component attributes"_err_en_US , "," >> nonemptyList(Parser<ProcComponentAttrSpec> {}), ok), localRecovery("expected PROCEDURE declarations"_err_en_US , "::" >> nonemptyList(procDecl), SkipTo<'\n'>{}) ))))))}; return parser.Parse(state); } | |||
475 | localRecovery("expected PROCEDURE declarations"_err_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("PROCEDURE component definition statement"_en_US)), inContext ((("PROCEDURE component definition statement"_en_US)), ((construct <ProcComponentDefStmt>( "PROCEDURE" >> parenthesized (maybe(procInterface)), localRecovery("expected PROCEDURE component attributes"_err_en_US , "," >> nonemptyList(Parser<ProcComponentAttrSpec> {}), ok), localRecovery("expected PROCEDURE declarations"_err_en_US , "::" >> nonemptyList(procDecl), SkipTo<'\n'>{}) )))))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( instrumented((("PROCEDURE component definition statement"_en_US )), inContext((("PROCEDURE component definition statement"_en_US )), ((construct<ProcComponentDefStmt>( "PROCEDURE" >> parenthesized(maybe(procInterface)), localRecovery("expected PROCEDURE component attributes"_err_en_US , "," >> nonemptyList(Parser<ProcComponentAttrSpec> {}), ok), localRecovery("expected PROCEDURE declarations"_err_en_US , "::" >> nonemptyList(procDecl), SkipTo<'\n'>{}) ))))))}; return parser.Parse(state); } | |||
476 | "::" >> nonemptyList(procDecl), SkipTo<'\n'>{})))template <> auto Parser<typename decltype(attempt(instrumented ((("PROCEDURE component definition statement"_en_US)), inContext ((("PROCEDURE component definition statement"_en_US)), ((construct <ProcComponentDefStmt>( "PROCEDURE" >> parenthesized (maybe(procInterface)), localRecovery("expected PROCEDURE component attributes"_err_en_US , "," >> nonemptyList(Parser<ProcComponentAttrSpec> {}), ok), localRecovery("expected PROCEDURE declarations"_err_en_US , "::" >> nonemptyList(procDecl), SkipTo<'\n'>{}) )))))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( instrumented((("PROCEDURE component definition statement"_en_US )), inContext((("PROCEDURE component definition statement"_en_US )), ((construct<ProcComponentDefStmt>( "PROCEDURE" >> parenthesized(maybe(procInterface)), localRecovery("expected PROCEDURE component attributes"_err_en_US , "," >> nonemptyList(Parser<ProcComponentAttrSpec> {}), ok), localRecovery("expected PROCEDURE declarations"_err_en_US , "::" >> nonemptyList(procDecl), SkipTo<'\n'>{}) ))))))}; return parser.Parse(state); } | |||
477 | ||||
478 | // R742 proc-component-attr-spec -> | |||
479 | // access-spec | NOPASS | PASS [(arg-name)] | POINTER | |||
480 | constexpr auto noPass{construct<NoPass>("NOPASS"_tok)}; | |||
481 | constexpr auto pass{construct<Pass>("PASS" >> maybe(parenthesized(name)))}; | |||
482 | TYPE_PARSER(construct<ProcComponentAttrSpec>(accessSpec) ||template <> auto Parser<typename decltype(attempt(construct <ProcComponentAttrSpec>(accessSpec) || construct<ProcComponentAttrSpec >(noPass) || construct<ProcComponentAttrSpec>(pass) || construct<ProcComponentAttrSpec>(pointer)))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ProcComponentAttrSpec >(accessSpec) || construct<ProcComponentAttrSpec>(noPass ) || construct<ProcComponentAttrSpec>(pass) || construct <ProcComponentAttrSpec>(pointer))}; return parser.Parse (state); } | |||
483 | construct<ProcComponentAttrSpec>(noPass) ||template <> auto Parser<typename decltype(attempt(construct <ProcComponentAttrSpec>(accessSpec) || construct<ProcComponentAttrSpec >(noPass) || construct<ProcComponentAttrSpec>(pass) || construct<ProcComponentAttrSpec>(pointer)))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ProcComponentAttrSpec >(accessSpec) || construct<ProcComponentAttrSpec>(noPass ) || construct<ProcComponentAttrSpec>(pass) || construct <ProcComponentAttrSpec>(pointer))}; return parser.Parse (state); } | |||
484 | construct<ProcComponentAttrSpec>(pass) ||template <> auto Parser<typename decltype(attempt(construct <ProcComponentAttrSpec>(accessSpec) || construct<ProcComponentAttrSpec >(noPass) || construct<ProcComponentAttrSpec>(pass) || construct<ProcComponentAttrSpec>(pointer)))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ProcComponentAttrSpec >(accessSpec) || construct<ProcComponentAttrSpec>(noPass ) || construct<ProcComponentAttrSpec>(pass) || construct <ProcComponentAttrSpec>(pointer))}; return parser.Parse (state); } | |||
485 | construct<ProcComponentAttrSpec>(pointer))template <> auto Parser<typename decltype(attempt(construct <ProcComponentAttrSpec>(accessSpec) || construct<ProcComponentAttrSpec >(noPass) || construct<ProcComponentAttrSpec>(pass) || construct<ProcComponentAttrSpec>(pointer)))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ProcComponentAttrSpec >(accessSpec) || construct<ProcComponentAttrSpec>(noPass ) || construct<ProcComponentAttrSpec>(pass) || construct <ProcComponentAttrSpec>(pointer))}; return parser.Parse (state); } | |||
486 | ||||
487 | // R744 initial-data-target -> designator | |||
488 | constexpr auto initialDataTarget{indirect(designator)}; | |||
489 | ||||
490 | // R743 component-initialization -> | |||
491 | // = constant-expr | => null-init | => initial-data-target | |||
492 | // R805 initialization -> | |||
493 | // = constant-expr | => null-init | => initial-data-target | |||
494 | // Universal extension: initialization -> / data-stmt-value-list / | |||
495 | TYPE_PARSER(construct<Initialization>("=>" >> nullInit) ||template <> auto Parser<typename decltype(attempt(construct <Initialization>("=>" >> nullInit) || construct <Initialization>("=>" >> initialDataTarget) || construct<Initialization>("=" >> constantExpr) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/"))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<Initialization>("=>" >> nullInit ) || construct<Initialization>("=>" >> initialDataTarget ) || construct<Initialization>("=" >> constantExpr ) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/")))}; return parser.Parse(state); } | |||
496 | construct<Initialization>("=>" >> initialDataTarget) ||template <> auto Parser<typename decltype(attempt(construct <Initialization>("=>" >> nullInit) || construct <Initialization>("=>" >> initialDataTarget) || construct<Initialization>("=" >> constantExpr) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/"))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<Initialization>("=>" >> nullInit ) || construct<Initialization>("=>" >> initialDataTarget ) || construct<Initialization>("=" >> constantExpr ) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/")))}; return parser.Parse(state); } | |||
497 | construct<Initialization>("=" >> constantExpr) ||template <> auto Parser<typename decltype(attempt(construct <Initialization>("=>" >> nullInit) || construct <Initialization>("=>" >> initialDataTarget) || construct<Initialization>("=" >> constantExpr) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/"))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<Initialization>("=>" >> nullInit ) || construct<Initialization>("=>" >> initialDataTarget ) || construct<Initialization>("=" >> constantExpr ) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/")))}; return parser.Parse(state); } | |||
498 | extension<LanguageFeature::SlashInitialization>(template <> auto Parser<typename decltype(attempt(construct <Initialization>("=>" >> nullInit) || construct <Initialization>("=>" >> initialDataTarget) || construct<Initialization>("=" >> constantExpr) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/"))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<Initialization>("=>" >> nullInit ) || construct<Initialization>("=>" >> initialDataTarget ) || construct<Initialization>("=" >> constantExpr ) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/")))}; return parser.Parse(state); } | |||
499 | "nonstandard usage: /initialization/"_port_en_US,template <> auto Parser<typename decltype(attempt(construct <Initialization>("=>" >> nullInit) || construct <Initialization>("=>" >> initialDataTarget) || construct<Initialization>("=" >> constantExpr) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/"))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<Initialization>("=>" >> nullInit ) || construct<Initialization>("=>" >> initialDataTarget ) || construct<Initialization>("=" >> constantExpr ) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/")))}; return parser.Parse(state); } | |||
500 | construct<Initialization>(template <> auto Parser<typename decltype(attempt(construct <Initialization>("=>" >> nullInit) || construct <Initialization>("=>" >> initialDataTarget) || construct<Initialization>("=" >> constantExpr) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/"))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<Initialization>("=>" >> nullInit ) || construct<Initialization>("=>" >> initialDataTarget ) || construct<Initialization>("=" >> constantExpr ) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/")))}; return parser.Parse(state); } | |||
501 | "/" >> nonemptyList("expected values"_err_en_US,template <> auto Parser<typename decltype(attempt(construct <Initialization>("=>" >> nullInit) || construct <Initialization>("=>" >> initialDataTarget) || construct<Initialization>("=" >> constantExpr) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/"))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<Initialization>("=>" >> nullInit ) || construct<Initialization>("=>" >> initialDataTarget ) || construct<Initialization>("=" >> constantExpr ) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/")))}; return parser.Parse(state); } | |||
502 | indirect(Parser<DataStmtValue>{})) /template <> auto Parser<typename decltype(attempt(construct <Initialization>("=>" >> nullInit) || construct <Initialization>("=>" >> initialDataTarget) || construct<Initialization>("=" >> constantExpr) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/"))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<Initialization>("=>" >> nullInit ) || construct<Initialization>("=>" >> initialDataTarget ) || construct<Initialization>("=" >> constantExpr ) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/")))}; return parser.Parse(state); } | |||
503 | "/")))template <> auto Parser<typename decltype(attempt(construct <Initialization>("=>" >> nullInit) || construct <Initialization>("=>" >> initialDataTarget) || construct<Initialization>("=" >> constantExpr) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/"))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<Initialization>("=>" >> nullInit ) || construct<Initialization>("=>" >> initialDataTarget ) || construct<Initialization>("=" >> constantExpr ) || extension<LanguageFeature::SlashInitialization>( "nonstandard usage: /initialization/"_port_en_US , construct<Initialization>( "/" >> nonemptyList( "expected values"_err_en_US, indirect(Parser<DataStmtValue >{})) / "/")))}; return parser.Parse(state); } | |||
504 | ||||
505 | // R745 private-components-stmt -> PRIVATE | |||
506 | // R747 binding-private-stmt -> PRIVATE | |||
507 | TYPE_PARSER(construct<PrivateStmt>("PRIVATE"_tok))template <> auto Parser<typename decltype(attempt(construct <PrivateStmt>("PRIVATE"_tok)))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<PrivateStmt>("PRIVATE"_tok))}; return parser.Parse(state); } | |||
508 | ||||
509 | // R746 type-bound-procedure-part -> | |||
510 | // contains-stmt [binding-private-stmt] [type-bound-proc-binding]... | |||
511 | TYPE_CONTEXT_PARSER("type bound procedure part"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("type bound procedure part"_en_US)), inContext((("type bound procedure part"_en_US )), ((construct<TypeBoundProcedurePart>(statement(containsStmt ), maybe(statement(Parser<PrivateStmt>{})), many(statement (Parser<TypeBoundProcBinding>{})))))))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("type bound procedure part"_en_US )), inContext((("type bound procedure part"_en_US)), ((construct <TypeBoundProcedurePart>(statement(containsStmt), maybe (statement(Parser<PrivateStmt>{})), many(statement(Parser <TypeBoundProcBinding>{}))))))))}; return parser.Parse( state); } | |||
512 | construct<TypeBoundProcedurePart>(statement(containsStmt),template <> auto Parser<typename decltype(attempt(instrumented ((("type bound procedure part"_en_US)), inContext((("type bound procedure part"_en_US )), ((construct<TypeBoundProcedurePart>(statement(containsStmt ), maybe(statement(Parser<PrivateStmt>{})), many(statement (Parser<TypeBoundProcBinding>{})))))))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("type bound procedure part"_en_US )), inContext((("type bound procedure part"_en_US)), ((construct <TypeBoundProcedurePart>(statement(containsStmt), maybe (statement(Parser<PrivateStmt>{})), many(statement(Parser <TypeBoundProcBinding>{}))))))))}; return parser.Parse( state); } | |||
513 | maybe(statement(Parser<PrivateStmt>{})),template <> auto Parser<typename decltype(attempt(instrumented ((("type bound procedure part"_en_US)), inContext((("type bound procedure part"_en_US )), ((construct<TypeBoundProcedurePart>(statement(containsStmt ), maybe(statement(Parser<PrivateStmt>{})), many(statement (Parser<TypeBoundProcBinding>{})))))))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("type bound procedure part"_en_US )), inContext((("type bound procedure part"_en_US)), ((construct <TypeBoundProcedurePart>(statement(containsStmt), maybe (statement(Parser<PrivateStmt>{})), many(statement(Parser <TypeBoundProcBinding>{}))))))))}; return parser.Parse( state); } | |||
514 | many(statement(Parser<TypeBoundProcBinding>{}))))template <> auto Parser<typename decltype(attempt(instrumented ((("type bound procedure part"_en_US)), inContext((("type bound procedure part"_en_US )), ((construct<TypeBoundProcedurePart>(statement(containsStmt ), maybe(statement(Parser<PrivateStmt>{})), many(statement (Parser<TypeBoundProcBinding>{})))))))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("type bound procedure part"_en_US )), inContext((("type bound procedure part"_en_US)), ((construct <TypeBoundProcedurePart>(statement(containsStmt), maybe (statement(Parser<PrivateStmt>{})), many(statement(Parser <TypeBoundProcBinding>{}))))))))}; return parser.Parse( state); } | |||
515 | ||||
516 | // R748 type-bound-proc-binding -> | |||
517 | // type-bound-procedure-stmt | type-bound-generic-stmt | | |||
518 | // final-procedure-stmt | |||
519 | TYPE_CONTEXT_PARSER("type bound procedure binding"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("type bound procedure binding"_en_US)), inContext((("type bound procedure binding"_en_US )), ((recovery( first(construct<TypeBoundProcBinding>(Parser <TypeBoundProcedureStmt>{}), construct<TypeBoundProcBinding >(Parser<TypeBoundGenericStmt>{}), construct<TypeBoundProcBinding >(Parser<FinalProcedureStmt>{})), construct<TypeBoundProcBinding >( !"END"_tok >> SkipTo<'\n'>{} >> construct <ErrorRecovery>()))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound procedure binding"_en_US )), inContext((("type bound procedure binding"_en_US)), ((recovery ( first(construct<TypeBoundProcBinding>(Parser<TypeBoundProcedureStmt >{}), construct<TypeBoundProcBinding>(Parser<TypeBoundGenericStmt >{}), construct<TypeBoundProcBinding>(Parser<FinalProcedureStmt >{})), construct<TypeBoundProcBinding>( !"END"_tok >> SkipTo<'\n'>{} >> construct<ErrorRecovery> ())))))))}; return parser.Parse(state); } | |||
520 | recovery(template <> auto Parser<typename decltype(attempt(instrumented ((("type bound procedure binding"_en_US)), inContext((("type bound procedure binding"_en_US )), ((recovery( first(construct<TypeBoundProcBinding>(Parser <TypeBoundProcedureStmt>{}), construct<TypeBoundProcBinding >(Parser<TypeBoundGenericStmt>{}), construct<TypeBoundProcBinding >(Parser<FinalProcedureStmt>{})), construct<TypeBoundProcBinding >( !"END"_tok >> SkipTo<'\n'>{} >> construct <ErrorRecovery>()))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound procedure binding"_en_US )), inContext((("type bound procedure binding"_en_US)), ((recovery ( first(construct<TypeBoundProcBinding>(Parser<TypeBoundProcedureStmt >{}), construct<TypeBoundProcBinding>(Parser<TypeBoundGenericStmt >{}), construct<TypeBoundProcBinding>(Parser<FinalProcedureStmt >{})), construct<TypeBoundProcBinding>( !"END"_tok >> SkipTo<'\n'>{} >> construct<ErrorRecovery> ())))))))}; return parser.Parse(state); } | |||
521 | first(construct<TypeBoundProcBinding>(Parser<TypeBoundProcedureStmt>{}),template <> auto Parser<typename decltype(attempt(instrumented ((("type bound procedure binding"_en_US)), inContext((("type bound procedure binding"_en_US )), ((recovery( first(construct<TypeBoundProcBinding>(Parser <TypeBoundProcedureStmt>{}), construct<TypeBoundProcBinding >(Parser<TypeBoundGenericStmt>{}), construct<TypeBoundProcBinding >(Parser<FinalProcedureStmt>{})), construct<TypeBoundProcBinding >( !"END"_tok >> SkipTo<'\n'>{} >> construct <ErrorRecovery>()))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound procedure binding"_en_US )), inContext((("type bound procedure binding"_en_US)), ((recovery ( first(construct<TypeBoundProcBinding>(Parser<TypeBoundProcedureStmt >{}), construct<TypeBoundProcBinding>(Parser<TypeBoundGenericStmt >{}), construct<TypeBoundProcBinding>(Parser<FinalProcedureStmt >{})), construct<TypeBoundProcBinding>( !"END"_tok >> SkipTo<'\n'>{} >> construct<ErrorRecovery> ())))))))}; return parser.Parse(state); } | |||
522 | construct<TypeBoundProcBinding>(Parser<TypeBoundGenericStmt>{}),template <> auto Parser<typename decltype(attempt(instrumented ((("type bound procedure binding"_en_US)), inContext((("type bound procedure binding"_en_US )), ((recovery( first(construct<TypeBoundProcBinding>(Parser <TypeBoundProcedureStmt>{}), construct<TypeBoundProcBinding >(Parser<TypeBoundGenericStmt>{}), construct<TypeBoundProcBinding >(Parser<FinalProcedureStmt>{})), construct<TypeBoundProcBinding >( !"END"_tok >> SkipTo<'\n'>{} >> construct <ErrorRecovery>()))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound procedure binding"_en_US )), inContext((("type bound procedure binding"_en_US)), ((recovery ( first(construct<TypeBoundProcBinding>(Parser<TypeBoundProcedureStmt >{}), construct<TypeBoundProcBinding>(Parser<TypeBoundGenericStmt >{}), construct<TypeBoundProcBinding>(Parser<FinalProcedureStmt >{})), construct<TypeBoundProcBinding>( !"END"_tok >> SkipTo<'\n'>{} >> construct<ErrorRecovery> ())))))))}; return parser.Parse(state); } | |||
523 | construct<TypeBoundProcBinding>(Parser<FinalProcedureStmt>{})),template <> auto Parser<typename decltype(attempt(instrumented ((("type bound procedure binding"_en_US)), inContext((("type bound procedure binding"_en_US )), ((recovery( first(construct<TypeBoundProcBinding>(Parser <TypeBoundProcedureStmt>{}), construct<TypeBoundProcBinding >(Parser<TypeBoundGenericStmt>{}), construct<TypeBoundProcBinding >(Parser<FinalProcedureStmt>{})), construct<TypeBoundProcBinding >( !"END"_tok >> SkipTo<'\n'>{} >> construct <ErrorRecovery>()))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound procedure binding"_en_US )), inContext((("type bound procedure binding"_en_US)), ((recovery ( first(construct<TypeBoundProcBinding>(Parser<TypeBoundProcedureStmt >{}), construct<TypeBoundProcBinding>(Parser<TypeBoundGenericStmt >{}), construct<TypeBoundProcBinding>(Parser<FinalProcedureStmt >{})), construct<TypeBoundProcBinding>( !"END"_tok >> SkipTo<'\n'>{} >> construct<ErrorRecovery> ())))))))}; return parser.Parse(state); } | |||
524 | construct<TypeBoundProcBinding>(template <> auto Parser<typename decltype(attempt(instrumented ((("type bound procedure binding"_en_US)), inContext((("type bound procedure binding"_en_US )), ((recovery( first(construct<TypeBoundProcBinding>(Parser <TypeBoundProcedureStmt>{}), construct<TypeBoundProcBinding >(Parser<TypeBoundGenericStmt>{}), construct<TypeBoundProcBinding >(Parser<FinalProcedureStmt>{})), construct<TypeBoundProcBinding >( !"END"_tok >> SkipTo<'\n'>{} >> construct <ErrorRecovery>()))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound procedure binding"_en_US )), inContext((("type bound procedure binding"_en_US)), ((recovery ( first(construct<TypeBoundProcBinding>(Parser<TypeBoundProcedureStmt >{}), construct<TypeBoundProcBinding>(Parser<TypeBoundGenericStmt >{}), construct<TypeBoundProcBinding>(Parser<FinalProcedureStmt >{})), construct<TypeBoundProcBinding>( !"END"_tok >> SkipTo<'\n'>{} >> construct<ErrorRecovery> ())))))))}; return parser.Parse(state); } | |||
525 | !"END"_tok >> SkipTo<'\n'>{} >> construct<ErrorRecovery>())))template <> auto Parser<typename decltype(attempt(instrumented ((("type bound procedure binding"_en_US)), inContext((("type bound procedure binding"_en_US )), ((recovery( first(construct<TypeBoundProcBinding>(Parser <TypeBoundProcedureStmt>{}), construct<TypeBoundProcBinding >(Parser<TypeBoundGenericStmt>{}), construct<TypeBoundProcBinding >(Parser<FinalProcedureStmt>{})), construct<TypeBoundProcBinding >( !"END"_tok >> SkipTo<'\n'>{} >> construct <ErrorRecovery>()))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound procedure binding"_en_US )), inContext((("type bound procedure binding"_en_US)), ((recovery ( first(construct<TypeBoundProcBinding>(Parser<TypeBoundProcedureStmt >{}), construct<TypeBoundProcBinding>(Parser<TypeBoundGenericStmt >{}), construct<TypeBoundProcBinding>(Parser<FinalProcedureStmt >{})), construct<TypeBoundProcBinding>( !"END"_tok >> SkipTo<'\n'>{} >> construct<ErrorRecovery> ())))))))}; return parser.Parse(state); } | |||
526 | ||||
527 | // R749 type-bound-procedure-stmt -> | |||
528 | // PROCEDURE [[, bind-attr-list] ::] type-bound-proc-decl-list | | |||
529 | // PROCEDURE ( interface-name ) , bind-attr-list :: binding-name-list | |||
530 | // The "::" is required by the standard (C768) in the first production if | |||
531 | // any type-bound-proc-decl has a "=>', but it's not strictly necessary to | |||
532 | // avoid a bad parse. | |||
533 | TYPE_CONTEXT_PARSER("type bound PROCEDURE statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
534 | "PROCEDURE" >>template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
535 | (construct<TypeBoundProcedureStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
536 | construct<TypeBoundProcedureStmt::WithInterface>(template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
537 | parenthesized(name),template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
538 | localRecovery("expected list of binding attributes"_err_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
539 | "," >> nonemptyList(Parser<BindAttr>{}), ok),template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
540 | localRecovery("expected list of binding names"_err_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
541 | "::" >> listOfNames, SkipTo<'\n'>{}))) ||template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
542 | construct<TypeBoundProcedureStmt>(construct<template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
543 | TypeBoundProcedureStmt::WithoutInterface>(template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
544 | pure<std::list<BindAttr>>(),template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
545 | nonemptyList(template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
546 | "expected type bound procedure declarations"_err_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
547 | construct<TypeBoundProcDecl>(name,template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
548 | maybe(extension<LanguageFeature::MissingColons>(template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
549 | "type-bound procedure statement should have '::' if it has '=>'"_port_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
550 | "=>" >> name)))))) ||template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
551 | construct<TypeBoundProcedureStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
552 | construct<TypeBoundProcedureStmt::WithoutInterface>(template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
553 | optionalListBeforeColons(Parser<BindAttr>{}),template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
554 | nonemptyList(template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
555 | "expected type bound procedure declarations"_err_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
556 | Parser<TypeBoundProcDecl>{})))))template <> auto Parser<typename decltype(attempt(instrumented ((("type bound PROCEDURE statement"_en_US)), inContext((("type bound PROCEDURE statement"_en_US )), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithInterface>( parenthesized(name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{}))))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound PROCEDURE statement"_en_US )), inContext((("type bound PROCEDURE statement"_en_US)), (("PROCEDURE" >> (construct<TypeBoundProcedureStmt>( construct <TypeBoundProcedureStmt::WithInterface>( parenthesized( name), localRecovery("expected list of binding attributes"_err_en_US , "," >> nonemptyList(Parser<BindAttr>{}), ok), localRecovery ("expected list of binding names"_err_en_US, "::" >> listOfNames , SkipTo<'\n'>{}))) || construct<TypeBoundProcedureStmt >(construct< TypeBoundProcedureStmt::WithoutInterface> ( pure<std::list<BindAttr>>(), nonemptyList( "expected type bound procedure declarations"_err_en_US , construct<TypeBoundProcDecl>(name, maybe(extension< LanguageFeature::MissingColons>( "type-bound procedure statement should have '::' if it has '=>'"_port_en_US , "=>" >> name)))))) || construct<TypeBoundProcedureStmt >( construct<TypeBoundProcedureStmt::WithoutInterface> ( optionalListBeforeColons(Parser<BindAttr>{}), nonemptyList ( "expected type bound procedure declarations"_err_en_US, Parser <TypeBoundProcDecl>{})))))))))}; return parser.Parse(state ); } | |||
557 | ||||
558 | // R750 type-bound-proc-decl -> binding-name [=> procedure-name] | |||
559 | TYPE_PARSER(construct<TypeBoundProcDecl>(name, maybe("=>" >> name)))template <> auto Parser<typename decltype(attempt(construct <TypeBoundProcDecl>(name, maybe("=>" >> name)) ))::resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(construct< TypeBoundProcDecl>(name, maybe("=>" >> name)))}; return parser.Parse(state); } | |||
560 | ||||
561 | // R751 type-bound-generic-stmt -> | |||
562 | // GENERIC [, access-spec] :: generic-spec => binding-name-list | |||
563 | TYPE_CONTEXT_PARSER("type bound GENERIC statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("type bound GENERIC statement"_en_US)), inContext((("type bound GENERIC statement"_en_US )), ((construct<TypeBoundGenericStmt>("GENERIC" >> maybe("," >> accessSpec), "::" >> indirect(genericSpec ), "=>" >> listOfNames)))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound GENERIC statement"_en_US )), inContext((("type bound GENERIC statement"_en_US)), ((construct <TypeBoundGenericStmt>("GENERIC" >> maybe("," >> accessSpec), "::" >> indirect(genericSpec), "=>" >> listOfNames))))))}; return parser.Parse(state); } | |||
564 | construct<TypeBoundGenericStmt>("GENERIC" >> maybe("," >> accessSpec),template <> auto Parser<typename decltype(attempt(instrumented ((("type bound GENERIC statement"_en_US)), inContext((("type bound GENERIC statement"_en_US )), ((construct<TypeBoundGenericStmt>("GENERIC" >> maybe("," >> accessSpec), "::" >> indirect(genericSpec ), "=>" >> listOfNames)))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound GENERIC statement"_en_US )), inContext((("type bound GENERIC statement"_en_US)), ((construct <TypeBoundGenericStmt>("GENERIC" >> maybe("," >> accessSpec), "::" >> indirect(genericSpec), "=>" >> listOfNames))))))}; return parser.Parse(state); } | |||
565 | "::" >> indirect(genericSpec), "=>" >> listOfNames))template <> auto Parser<typename decltype(attempt(instrumented ((("type bound GENERIC statement"_en_US)), inContext((("type bound GENERIC statement"_en_US )), ((construct<TypeBoundGenericStmt>("GENERIC" >> maybe("," >> accessSpec), "::" >> indirect(genericSpec ), "=>" >> listOfNames)))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("type bound GENERIC statement"_en_US )), inContext((("type bound GENERIC statement"_en_US)), ((construct <TypeBoundGenericStmt>("GENERIC" >> maybe("," >> accessSpec), "::" >> indirect(genericSpec), "=>" >> listOfNames))))))}; return parser.Parse(state); } | |||
566 | ||||
567 | // R752 bind-attr -> | |||
568 | // access-spec | DEFERRED | NON_OVERRIDABLE | NOPASS | PASS [(arg-name)] | |||
569 | TYPE_PARSER(construct<BindAttr>(accessSpec) ||template <> auto Parser<typename decltype(attempt(construct <BindAttr>(accessSpec) || construct<BindAttr>(construct <BindAttr::Deferred>("DEFERRED"_tok)) || construct<BindAttr >( construct<BindAttr::Non_Overridable>("NON_OVERRIDABLE"_tok )) || construct<BindAttr>(noPass) || construct<BindAttr >(pass)))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<BindAttr>(accessSpec) || construct<BindAttr >(construct<BindAttr::Deferred>("DEFERRED"_tok)) || construct <BindAttr>( construct<BindAttr::Non_Overridable>( "NON_OVERRIDABLE"_tok)) || construct<BindAttr>(noPass) || construct<BindAttr>(pass))}; return parser.Parse(state ); } | |||
570 | construct<BindAttr>(construct<BindAttr::Deferred>("DEFERRED"_tok)) ||template <> auto Parser<typename decltype(attempt(construct <BindAttr>(accessSpec) || construct<BindAttr>(construct <BindAttr::Deferred>("DEFERRED"_tok)) || construct<BindAttr >( construct<BindAttr::Non_Overridable>("NON_OVERRIDABLE"_tok )) || construct<BindAttr>(noPass) || construct<BindAttr >(pass)))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<BindAttr>(accessSpec) || construct<BindAttr >(construct<BindAttr::Deferred>("DEFERRED"_tok)) || construct <BindAttr>( construct<BindAttr::Non_Overridable>( "NON_OVERRIDABLE"_tok)) || construct<BindAttr>(noPass) || construct<BindAttr>(pass))}; return parser.Parse(state ); } | |||
571 | construct<BindAttr>(template <> auto Parser<typename decltype(attempt(construct <BindAttr>(accessSpec) || construct<BindAttr>(construct <BindAttr::Deferred>("DEFERRED"_tok)) || construct<BindAttr >( construct<BindAttr::Non_Overridable>("NON_OVERRIDABLE"_tok )) || construct<BindAttr>(noPass) || construct<BindAttr >(pass)))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<BindAttr>(accessSpec) || construct<BindAttr >(construct<BindAttr::Deferred>("DEFERRED"_tok)) || construct <BindAttr>( construct<BindAttr::Non_Overridable>( "NON_OVERRIDABLE"_tok)) || construct<BindAttr>(noPass) || construct<BindAttr>(pass))}; return parser.Parse(state ); } | |||
572 | construct<BindAttr::Non_Overridable>("NON_OVERRIDABLE"_tok)) ||template <> auto Parser<typename decltype(attempt(construct <BindAttr>(accessSpec) || construct<BindAttr>(construct <BindAttr::Deferred>("DEFERRED"_tok)) || construct<BindAttr >( construct<BindAttr::Non_Overridable>("NON_OVERRIDABLE"_tok )) || construct<BindAttr>(noPass) || construct<BindAttr >(pass)))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<BindAttr>(accessSpec) || construct<BindAttr >(construct<BindAttr::Deferred>("DEFERRED"_tok)) || construct <BindAttr>( construct<BindAttr::Non_Overridable>( "NON_OVERRIDABLE"_tok)) || construct<BindAttr>(noPass) || construct<BindAttr>(pass))}; return parser.Parse(state ); } | |||
573 | construct<BindAttr>(noPass) || construct<BindAttr>(pass))template <> auto Parser<typename decltype(attempt(construct <BindAttr>(accessSpec) || construct<BindAttr>(construct <BindAttr::Deferred>("DEFERRED"_tok)) || construct<BindAttr >( construct<BindAttr::Non_Overridable>("NON_OVERRIDABLE"_tok )) || construct<BindAttr>(noPass) || construct<BindAttr >(pass)))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<BindAttr>(accessSpec) || construct<BindAttr >(construct<BindAttr::Deferred>("DEFERRED"_tok)) || construct <BindAttr>( construct<BindAttr::Non_Overridable>( "NON_OVERRIDABLE"_tok)) || construct<BindAttr>(noPass) || construct<BindAttr>(pass))}; return parser.Parse(state ); } | |||
574 | ||||
575 | // R753 final-procedure-stmt -> FINAL [::] final-subroutine-name-list | |||
576 | TYPE_CONTEXT_PARSER("FINAL statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("FINAL statement"_en_US)), inContext((("FINAL statement"_en_US )), ((construct<FinalProcedureStmt>("FINAL" >> maybe ("::"_tok) >> listOfNames)))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("FINAL statement"_en_US )), inContext((("FINAL statement"_en_US)), ((construct<FinalProcedureStmt >("FINAL" >> maybe("::"_tok) >> listOfNames))) )))}; return parser.Parse(state); } | |||
577 | construct<FinalProcedureStmt>("FINAL" >> maybe("::"_tok) >> listOfNames))template <> auto Parser<typename decltype(attempt(instrumented ((("FINAL statement"_en_US)), inContext((("FINAL statement"_en_US )), ((construct<FinalProcedureStmt>("FINAL" >> maybe ("::"_tok) >> listOfNames)))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("FINAL statement"_en_US )), inContext((("FINAL statement"_en_US)), ((construct<FinalProcedureStmt >("FINAL" >> maybe("::"_tok) >> listOfNames))) )))}; return parser.Parse(state); } | |||
578 | ||||
579 | // R754 derived-type-spec -> type-name [(type-param-spec-list)] | |||
580 | TYPE_PARSER(construct<DerivedTypeSpec>(name,template <> auto Parser<typename decltype(attempt(construct <DerivedTypeSpec>(name, defaulted(parenthesized(nonemptyList ( "expected type parameters"_err_en_US, Parser<TypeParamSpec >{}))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<DerivedTypeSpec>(name, defaulted(parenthesized (nonemptyList( "expected type parameters"_err_en_US, Parser< TypeParamSpec>{})))))}; return parser.Parse(state); } | |||
581 | defaulted(parenthesized(nonemptyList(template <> auto Parser<typename decltype(attempt(construct <DerivedTypeSpec>(name, defaulted(parenthesized(nonemptyList ( "expected type parameters"_err_en_US, Parser<TypeParamSpec >{}))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<DerivedTypeSpec>(name, defaulted(parenthesized (nonemptyList( "expected type parameters"_err_en_US, Parser< TypeParamSpec>{})))))}; return parser.Parse(state); } | |||
582 | "expected type parameters"_err_en_US, Parser<TypeParamSpec>{})))))template <> auto Parser<typename decltype(attempt(construct <DerivedTypeSpec>(name, defaulted(parenthesized(nonemptyList ( "expected type parameters"_err_en_US, Parser<TypeParamSpec >{}))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<DerivedTypeSpec>(name, defaulted(parenthesized (nonemptyList( "expected type parameters"_err_en_US, Parser< TypeParamSpec>{})))))}; return parser.Parse(state); } | |||
583 | ||||
584 | // R755 type-param-spec -> [keyword =] type-param-value | |||
585 | TYPE_PARSER(construct<TypeParamSpec>(maybe(keyword / "="), typeParamValue))template <> auto Parser<typename decltype(attempt(construct <TypeParamSpec>(maybe(keyword / "="), typeParamValue))) ::resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(construct< TypeParamSpec>(maybe(keyword / "="), typeParamValue))}; return parser.Parse(state); } | |||
586 | ||||
587 | // R756 structure-constructor -> derived-type-spec ( [component-spec-list] ) | |||
588 | TYPE_PARSER((construct<StructureConstructor>(derivedTypeSpec,template <> auto Parser<typename decltype(attempt((construct <StructureConstructor>(derivedTypeSpec, parenthesized(optionalList (Parser<ComponentSpec>{}))) || construct<StructureConstructor >( construct<DerivedTypeSpec>( name, construct<std ::list<TypeParamSpec>>()), parenthesized(optionalList (Parser<ComponentSpec>{})))) / !"("_tok))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{((construct<StructureConstructor >(derivedTypeSpec, parenthesized(optionalList(Parser<ComponentSpec >{}))) || construct<StructureConstructor>( construct <DerivedTypeSpec>( name, construct<std::list<TypeParamSpec >>()), parenthesized(optionalList(Parser<ComponentSpec >{})))) / !"("_tok)}; return parser.Parse(state); } | |||
589 | parenthesized(optionalList(Parser<ComponentSpec>{}))) ||template <> auto Parser<typename decltype(attempt((construct <StructureConstructor>(derivedTypeSpec, parenthesized(optionalList (Parser<ComponentSpec>{}))) || construct<StructureConstructor >( construct<DerivedTypeSpec>( name, construct<std ::list<TypeParamSpec>>()), parenthesized(optionalList (Parser<ComponentSpec>{})))) / !"("_tok))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{((construct<StructureConstructor >(derivedTypeSpec, parenthesized(optionalList(Parser<ComponentSpec >{}))) || construct<StructureConstructor>( construct <DerivedTypeSpec>( name, construct<std::list<TypeParamSpec >>()), parenthesized(optionalList(Parser<ComponentSpec >{})))) / !"("_tok)}; return parser.Parse(state); } | |||
590 | // This alternative corrects misrecognition of thetemplate <> auto Parser<typename decltype(attempt((construct <StructureConstructor>(derivedTypeSpec, parenthesized(optionalList (Parser<ComponentSpec>{}))) || construct<StructureConstructor >( construct<DerivedTypeSpec>( name, construct<std ::list<TypeParamSpec>>()), parenthesized(optionalList (Parser<ComponentSpec>{})))) / !"("_tok))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{((construct<StructureConstructor >(derivedTypeSpec, parenthesized(optionalList(Parser<ComponentSpec >{}))) || construct<StructureConstructor>( construct <DerivedTypeSpec>( name, construct<std::list<TypeParamSpec >>()), parenthesized(optionalList(Parser<ComponentSpec >{})))) / !"("_tok)}; return parser.Parse(state); } | |||
591 | // component-spec-list as the type-param-spec-list intemplate <> auto Parser<typename decltype(attempt((construct <StructureConstructor>(derivedTypeSpec, parenthesized(optionalList (Parser<ComponentSpec>{}))) || construct<StructureConstructor >( construct<DerivedTypeSpec>( name, construct<std ::list<TypeParamSpec>>()), parenthesized(optionalList (Parser<ComponentSpec>{})))) / !"("_tok))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{((construct<StructureConstructor >(derivedTypeSpec, parenthesized(optionalList(Parser<ComponentSpec >{}))) || construct<StructureConstructor>( construct <DerivedTypeSpec>( name, construct<std::list<TypeParamSpec >>()), parenthesized(optionalList(Parser<ComponentSpec >{})))) / !"("_tok)}; return parser.Parse(state); } | |||
592 | // derived-type-spec.template <> auto Parser<typename decltype(attempt((construct <StructureConstructor>(derivedTypeSpec, parenthesized(optionalList (Parser<ComponentSpec>{}))) || construct<StructureConstructor >( construct<DerivedTypeSpec>( name, construct<std ::list<TypeParamSpec>>()), parenthesized(optionalList (Parser<ComponentSpec>{})))) / !"("_tok))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{((construct<StructureConstructor >(derivedTypeSpec, parenthesized(optionalList(Parser<ComponentSpec >{}))) || construct<StructureConstructor>( construct <DerivedTypeSpec>( name, construct<std::list<TypeParamSpec >>()), parenthesized(optionalList(Parser<ComponentSpec >{})))) / !"("_tok)}; return parser.Parse(state); } | |||
593 | construct<StructureConstructor>(template <> auto Parser<typename decltype(attempt((construct <StructureConstructor>(derivedTypeSpec, parenthesized(optionalList (Parser<ComponentSpec>{}))) || construct<StructureConstructor >( construct<DerivedTypeSpec>( name, construct<std ::list<TypeParamSpec>>()), parenthesized(optionalList (Parser<ComponentSpec>{})))) / !"("_tok))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{((construct<StructureConstructor >(derivedTypeSpec, parenthesized(optionalList(Parser<ComponentSpec >{}))) || construct<StructureConstructor>( construct <DerivedTypeSpec>( name, construct<std::list<TypeParamSpec >>()), parenthesized(optionalList(Parser<ComponentSpec >{})))) / !"("_tok)}; return parser.Parse(state); } | |||
594 | construct<DerivedTypeSpec>(template <> auto Parser<typename decltype(attempt((construct <StructureConstructor>(derivedTypeSpec, parenthesized(optionalList (Parser<ComponentSpec>{}))) || construct<StructureConstructor >( construct<DerivedTypeSpec>( name, construct<std ::list<TypeParamSpec>>()), parenthesized(optionalList (Parser<ComponentSpec>{})))) / !"("_tok))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{((construct<StructureConstructor >(derivedTypeSpec, parenthesized(optionalList(Parser<ComponentSpec >{}))) || construct<StructureConstructor>( construct <DerivedTypeSpec>( name, construct<std::list<TypeParamSpec >>()), parenthesized(optionalList(Parser<ComponentSpec >{})))) / !"("_tok)}; return parser.Parse(state); } | |||
595 | name, construct<std::list<TypeParamSpec>>()),template <> auto Parser<typename decltype(attempt((construct <StructureConstructor>(derivedTypeSpec, parenthesized(optionalList (Parser<ComponentSpec>{}))) || construct<StructureConstructor >( construct<DerivedTypeSpec>( name, construct<std ::list<TypeParamSpec>>()), parenthesized(optionalList (Parser<ComponentSpec>{})))) / !"("_tok))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{((construct<StructureConstructor >(derivedTypeSpec, parenthesized(optionalList(Parser<ComponentSpec >{}))) || construct<StructureConstructor>( construct <DerivedTypeSpec>( name, construct<std::list<TypeParamSpec >>()), parenthesized(optionalList(Parser<ComponentSpec >{})))) / !"("_tok)}; return parser.Parse(state); } | |||
596 | parenthesized(optionalList(Parser<ComponentSpec>{})))) /template <> auto Parser<typename decltype(attempt((construct <StructureConstructor>(derivedTypeSpec, parenthesized(optionalList (Parser<ComponentSpec>{}))) || construct<StructureConstructor >( construct<DerivedTypeSpec>( name, construct<std ::list<TypeParamSpec>>()), parenthesized(optionalList (Parser<ComponentSpec>{})))) / !"("_tok))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{((construct<StructureConstructor >(derivedTypeSpec, parenthesized(optionalList(Parser<ComponentSpec >{}))) || construct<StructureConstructor>( construct <DerivedTypeSpec>( name, construct<std::list<TypeParamSpec >>()), parenthesized(optionalList(Parser<ComponentSpec >{})))) / !"("_tok)}; return parser.Parse(state); } | |||
597 | !"("_tok)template <> auto Parser<typename decltype(attempt((construct <StructureConstructor>(derivedTypeSpec, parenthesized(optionalList (Parser<ComponentSpec>{}))) || construct<StructureConstructor >( construct<DerivedTypeSpec>( name, construct<std ::list<TypeParamSpec>>()), parenthesized(optionalList (Parser<ComponentSpec>{})))) / !"("_tok))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{((construct<StructureConstructor >(derivedTypeSpec, parenthesized(optionalList(Parser<ComponentSpec >{}))) || construct<StructureConstructor>( construct <DerivedTypeSpec>( name, construct<std::list<TypeParamSpec >>()), parenthesized(optionalList(Parser<ComponentSpec >{})))) / !"("_tok)}; return parser.Parse(state); } | |||
598 | ||||
599 | // R757 component-spec -> [keyword =] component-data-source | |||
600 | TYPE_PARSER(construct<ComponentSpec>(template <> auto Parser<typename decltype(attempt(construct <ComponentSpec>( maybe(keyword / "="), Parser<ComponentDataSource >{})))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<ComponentSpec>( maybe(keyword / "="), Parser <ComponentDataSource>{}))}; return parser.Parse(state); } | |||
601 | maybe(keyword / "="), Parser<ComponentDataSource>{}))template <> auto Parser<typename decltype(attempt(construct <ComponentSpec>( maybe(keyword / "="), Parser<ComponentDataSource >{})))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<ComponentSpec>( maybe(keyword / "="), Parser <ComponentDataSource>{}))}; return parser.Parse(state); } | |||
602 | ||||
603 | // R758 component-data-source -> expr | data-target | proc-target | |||
604 | TYPE_PARSER(construct<ComponentDataSource>(indirect(expr)))template <> auto Parser<typename decltype(attempt(construct <ComponentDataSource>(indirect(expr))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<ComponentDataSource >(indirect(expr)))}; return parser.Parse(state); } | |||
605 | ||||
606 | // R759 enum-def -> | |||
607 | // enum-def-stmt enumerator-def-stmt [enumerator-def-stmt]... | |||
608 | // end-enum-stmt | |||
609 | TYPE_CONTEXT_PARSER("enum definition"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("enum definition"_en_US)), inContext((("enum definition"_en_US )), ((construct<EnumDef>(statement(Parser<EnumDefStmt >{}), some(unambiguousStatement(Parser<EnumeratorDefStmt >{})), statement(Parser<EndEnumStmt>{}))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("enum definition"_en_US )), inContext((("enum definition"_en_US)), ((construct<EnumDef >(statement(Parser<EnumDefStmt>{}), some(unambiguousStatement (Parser<EnumeratorDefStmt>{})), statement(Parser<EndEnumStmt >{})))))))}; return parser.Parse(state); } | |||
610 | construct<EnumDef>(statement(Parser<EnumDefStmt>{}),template <> auto Parser<typename decltype(attempt(instrumented ((("enum definition"_en_US)), inContext((("enum definition"_en_US )), ((construct<EnumDef>(statement(Parser<EnumDefStmt >{}), some(unambiguousStatement(Parser<EnumeratorDefStmt >{})), statement(Parser<EndEnumStmt>{}))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("enum definition"_en_US )), inContext((("enum definition"_en_US)), ((construct<EnumDef >(statement(Parser<EnumDefStmt>{}), some(unambiguousStatement (Parser<EnumeratorDefStmt>{})), statement(Parser<EndEnumStmt >{})))))))}; return parser.Parse(state); } | |||
611 | some(unambiguousStatement(Parser<EnumeratorDefStmt>{})),template <> auto Parser<typename decltype(attempt(instrumented ((("enum definition"_en_US)), inContext((("enum definition"_en_US )), ((construct<EnumDef>(statement(Parser<EnumDefStmt >{}), some(unambiguousStatement(Parser<EnumeratorDefStmt >{})), statement(Parser<EndEnumStmt>{}))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("enum definition"_en_US )), inContext((("enum definition"_en_US)), ((construct<EnumDef >(statement(Parser<EnumDefStmt>{}), some(unambiguousStatement (Parser<EnumeratorDefStmt>{})), statement(Parser<EndEnumStmt >{})))))))}; return parser.Parse(state); } | |||
612 | statement(Parser<EndEnumStmt>{})))template <> auto Parser<typename decltype(attempt(instrumented ((("enum definition"_en_US)), inContext((("enum definition"_en_US )), ((construct<EnumDef>(statement(Parser<EnumDefStmt >{}), some(unambiguousStatement(Parser<EnumeratorDefStmt >{})), statement(Parser<EndEnumStmt>{}))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("enum definition"_en_US )), inContext((("enum definition"_en_US)), ((construct<EnumDef >(statement(Parser<EnumDefStmt>{}), some(unambiguousStatement (Parser<EnumeratorDefStmt>{})), statement(Parser<EndEnumStmt >{})))))))}; return parser.Parse(state); } | |||
613 | ||||
614 | // R760 enum-def-stmt -> ENUM, BIND(C) | |||
615 | TYPE_PARSER(construct<EnumDefStmt>("ENUM , BIND ( C )"_tok))template <> auto Parser<typename decltype(attempt(construct <EnumDefStmt>("ENUM , BIND ( C )"_tok)))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<EnumDefStmt >("ENUM , BIND ( C )"_tok))}; return parser.Parse(state); } | |||
616 | ||||
617 | // R761 enumerator-def-stmt -> ENUMERATOR [::] enumerator-list | |||
618 | TYPE_CONTEXT_PARSER("ENUMERATOR statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("ENUMERATOR statement"_en_US)), inContext((("ENUMERATOR statement"_en_US )), ((construct<EnumeratorDefStmt>("ENUMERATOR" >> maybe("::"_tok) >> nonemptyList("expected enumerators"_err_en_US , Parser<Enumerator>{}))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("ENUMERATOR statement"_en_US)), inContext ((("ENUMERATOR statement"_en_US)), ((construct<EnumeratorDefStmt >("ENUMERATOR" >> maybe("::"_tok) >> nonemptyList ("expected enumerators"_err_en_US, Parser<Enumerator>{} )))))))}; return parser.Parse(state); } | |||
619 | construct<EnumeratorDefStmt>("ENUMERATOR" >> maybe("::"_tok) >>template <> auto Parser<typename decltype(attempt(instrumented ((("ENUMERATOR statement"_en_US)), inContext((("ENUMERATOR statement"_en_US )), ((construct<EnumeratorDefStmt>("ENUMERATOR" >> maybe("::"_tok) >> nonemptyList("expected enumerators"_err_en_US , Parser<Enumerator>{}))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("ENUMERATOR statement"_en_US)), inContext ((("ENUMERATOR statement"_en_US)), ((construct<EnumeratorDefStmt >("ENUMERATOR" >> maybe("::"_tok) >> nonemptyList ("expected enumerators"_err_en_US, Parser<Enumerator>{} )))))))}; return parser.Parse(state); } | |||
620 | nonemptyList("expected enumerators"_err_en_US, Parser<Enumerator>{})))template <> auto Parser<typename decltype(attempt(instrumented ((("ENUMERATOR statement"_en_US)), inContext((("ENUMERATOR statement"_en_US )), ((construct<EnumeratorDefStmt>("ENUMERATOR" >> maybe("::"_tok) >> nonemptyList("expected enumerators"_err_en_US , Parser<Enumerator>{}))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("ENUMERATOR statement"_en_US)), inContext ((("ENUMERATOR statement"_en_US)), ((construct<EnumeratorDefStmt >("ENUMERATOR" >> maybe("::"_tok) >> nonemptyList ("expected enumerators"_err_en_US, Parser<Enumerator>{} )))))))}; return parser.Parse(state); } | |||
621 | ||||
622 | // R762 enumerator -> named-constant [= scalar-int-constant-expr] | |||
623 | TYPE_PARSER(template <> auto Parser<typename decltype(attempt(construct <Enumerator>(namedConstant, maybe("=" >> scalarIntConstantExpr ))))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <Enumerator>(namedConstant, maybe("=" >> scalarIntConstantExpr )))}; return parser.Parse(state); } | |||
624 | construct<Enumerator>(namedConstant, maybe("=" >> scalarIntConstantExpr)))template <> auto Parser<typename decltype(attempt(construct <Enumerator>(namedConstant, maybe("=" >> scalarIntConstantExpr ))))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <Enumerator>(namedConstant, maybe("=" >> scalarIntConstantExpr )))}; return parser.Parse(state); } | |||
625 | ||||
626 | // R763 end-enum-stmt -> END ENUM | |||
627 | TYPE_PARSER(recovery("END ENUM"_tok, constructEndStmtErrorRecovery) >>template <> auto Parser<typename decltype(attempt(recovery ("END ENUM"_tok, constructEndStmtErrorRecovery) >> construct <EndEnumStmt>()))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(recovery("END ENUM"_tok, constructEndStmtErrorRecovery ) >> construct<EndEnumStmt>())}; return parser.Parse (state); } | |||
628 | construct<EndEnumStmt>())template <> auto Parser<typename decltype(attempt(recovery ("END ENUM"_tok, constructEndStmtErrorRecovery) >> construct <EndEnumStmt>()))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(recovery("END ENUM"_tok, constructEndStmtErrorRecovery ) >> construct<EndEnumStmt>())}; return parser.Parse (state); } | |||
629 | ||||
630 | // R801 type-declaration-stmt -> | |||
631 | // declaration-type-spec [[, attr-spec]... ::] entity-decl-list | |||
632 | constexpr auto entityDeclWithoutEqInit{construct<EntityDecl>(name, | |||
633 | maybe(arraySpec), maybe(coarraySpec), maybe("*" >> charLength), | |||
634 | !"="_tok >> maybe(initialization))}; // old-style REAL A/0/ still works | |||
635 | TYPE_PARSER(template <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
636 | construct<TypeDeclarationStmt>(declarationTypeSpec,template <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
637 | defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::",template <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
638 | nonemptyList("expected entity declarations"_err_en_US, entityDecl)) ||template <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
639 | // C806: no initializers allowed without colons ("REALA=1" is ambiguous)template <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
640 | construct<TypeDeclarationStmt>(declarationTypeSpec,template <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
641 | construct<std::list<AttrSpec>>(),template <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
642 | nonemptyList("expected entity declarations"_err_en_US,template <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
643 | entityDeclWithoutEqInit)) ||template <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
644 | // PGI-only extension: comma in place of doubled colonstemplate <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
645 | extension<LanguageFeature::MissingColons>(template <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
646 | "nonstandard usage: ',' in place of '::'"_port_en_US,template <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
647 | construct<TypeDeclarationStmt>(declarationTypeSpec,template <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
648 | defaulted("," >> nonemptyList(Parser<AttrSpec>{})),template <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
649 | withMessage("expected entity declarations"_err_en_US,template <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
650 | "," >> nonemptyList(entityDecl)))))template <> auto Parser<typename decltype(attempt(construct <TypeDeclarationStmt>(declarationTypeSpec, defaulted("," >> nonemptyList(Parser<AttrSpec>{})) / "::", nonemptyList ("expected entity declarations"_err_en_US, entityDecl)) || construct <TypeDeclarationStmt>(declarationTypeSpec, construct< std::list<AttrSpec>>(), nonemptyList("expected entity declarations"_err_en_US , entityDeclWithoutEqInit)) || extension<LanguageFeature:: MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<TypeDeclarationStmt>(declarationTypeSpec , defaulted("," >> nonemptyList(Parser<AttrSpec>{ })) / "::", nonemptyList("expected entity declarations"_err_en_US , entityDecl)) || construct<TypeDeclarationStmt>(declarationTypeSpec , construct<std::list<AttrSpec>>(), nonemptyList( "expected entity declarations"_err_en_US, entityDeclWithoutEqInit )) || extension<LanguageFeature::MissingColons>( "nonstandard usage: ',' in place of '::'"_port_en_US , construct<TypeDeclarationStmt>(declarationTypeSpec, defaulted ("," >> nonemptyList(Parser<AttrSpec>{})), withMessage ("expected entity declarations"_err_en_US, "," >> nonemptyList (entityDecl)))))}; return parser.Parse(state); } | |||
651 | ||||
652 | // R802 attr-spec -> | |||
653 | // access-spec | ALLOCATABLE | ASYNCHRONOUS | | |||
654 | // CODIMENSION lbracket coarray-spec rbracket | CONTIGUOUS | | |||
655 | // DIMENSION ( array-spec ) | EXTERNAL | INTENT ( intent-spec ) | | |||
656 | // INTRINSIC | language-binding-spec | OPTIONAL | PARAMETER | POINTER | | |||
657 | // PROTECTED | SAVE | TARGET | VALUE | VOLATILE | |||
658 | TYPE_PARSER(construct<AttrSpec>(accessSpec) ||template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
659 | construct<AttrSpec>(allocatable) ||template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
660 | construct<AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok)) ||template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
661 | construct<AttrSpec>("CODIMENSION" >> coarraySpec) ||template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
662 | construct<AttrSpec>(contiguous) ||template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
663 | construct<AttrSpec>("DIMENSION" >> arraySpec) ||template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
664 | construct<AttrSpec>(construct<External>("EXTERNAL"_tok)) ||template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
665 | construct<AttrSpec>("INTENT" >> parenthesized(intentSpec)) ||template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
666 | construct<AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) ||template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
667 | construct<AttrSpec>(languageBindingSpec) || construct<AttrSpec>(optional) ||template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
668 | construct<AttrSpec>(construct<Parameter>("PARAMETER"_tok)) ||template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
669 | construct<AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr) ||template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
670 | construct<AttrSpec>(save) ||template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
671 | construct<AttrSpec>(construct<Target>("TARGET"_tok)) ||template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
672 | construct<AttrSpec>(construct<Value>("VALUE"_tok)) ||template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
673 | construct<AttrSpec>(construct<Volatile>("VOLATILE"_tok)))template <> auto Parser<typename decltype(attempt(construct <AttrSpec>(accessSpec) || construct<AttrSpec>(allocatable ) || construct<AttrSpec>(construct<Asynchronous>( "ASYNCHRONOUS"_tok)) || construct<AttrSpec>("CODIMENSION" >> coarraySpec) || construct<AttrSpec>(contiguous ) || construct<AttrSpec>("DIMENSION" >> arraySpec ) || construct<AttrSpec>(construct<External>("EXTERNAL"_tok )) || construct<AttrSpec>("INTENT" >> parenthesized (intentSpec)) || construct<AttrSpec>(construct<Intrinsic >("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec ) || construct<AttrSpec>(optional) || construct<AttrSpec >(construct<Parameter>("PARAMETER"_tok)) || construct <AttrSpec>(pointer) || construct<AttrSpec>(protectedAttr ) || construct<AttrSpec>(save) || construct<AttrSpec >(construct<Target>("TARGET"_tok)) || construct<AttrSpec >(construct<Value>("VALUE"_tok)) || construct<AttrSpec >(construct<Volatile>("VOLATILE"_tok))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AttrSpec> (accessSpec) || construct<AttrSpec>(allocatable) || construct <AttrSpec>(construct<Asynchronous>("ASYNCHRONOUS"_tok )) || construct<AttrSpec>("CODIMENSION" >> coarraySpec ) || construct<AttrSpec>(contiguous) || construct<AttrSpec >("DIMENSION" >> arraySpec) || construct<AttrSpec >(construct<External>("EXTERNAL"_tok)) || construct< AttrSpec>("INTENT" >> parenthesized(intentSpec)) || construct <AttrSpec>(construct<Intrinsic>("INTRINSIC"_tok)) || construct<AttrSpec>(languageBindingSpec) || construct <AttrSpec>(optional) || construct<AttrSpec>(construct <Parameter>("PARAMETER"_tok)) || construct<AttrSpec> (pointer) || construct<AttrSpec>(protectedAttr) || construct <AttrSpec>(save) || construct<AttrSpec>(construct <Target>("TARGET"_tok)) || construct<AttrSpec>(construct <Value>("VALUE"_tok)) || construct<AttrSpec>(construct <Volatile>("VOLATILE"_tok)))}; return parser.Parse(state ); } | |||
674 | ||||
675 | // R804 object-name -> name | |||
676 | constexpr auto objectName{name}; | |||
677 | ||||
678 | // R803 entity-decl -> | |||
679 | // object-name [( array-spec )] [lbracket coarray-spec rbracket] | |||
680 | // [* char-length] [initialization] | | |||
681 | // function-name [* char-length] | |||
682 | TYPE_PARSER(construct<EntityDecl>(objectName, maybe(arraySpec),template <> auto Parser<typename decltype(attempt(construct <EntityDecl>(objectName, maybe(arraySpec), maybe(coarraySpec ), maybe("*" >> charLength), maybe(initialization)))):: resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(construct< EntityDecl>(objectName, maybe(arraySpec), maybe(coarraySpec ), maybe("*" >> charLength), maybe(initialization)))}; return parser.Parse(state); } | |||
683 | maybe(coarraySpec), maybe("*" >> charLength), maybe(initialization)))template <> auto Parser<typename decltype(attempt(construct <EntityDecl>(objectName, maybe(arraySpec), maybe(coarraySpec ), maybe("*" >> charLength), maybe(initialization)))):: resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(construct< EntityDecl>(objectName, maybe(arraySpec), maybe(coarraySpec ), maybe("*" >> charLength), maybe(initialization)))}; return parser.Parse(state); } | |||
684 | ||||
685 | // R806 null-init -> function-reference ... which must resolve to NULL() | |||
686 | TYPE_PARSER(lookAhead(name / "( )") >> construct<NullInit>(expr))template <> auto Parser<typename decltype(attempt(lookAhead (name / "( )") >> construct<NullInit>(expr)))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(lookAhead(name / "( )") >> construct<NullInit>(expr))}; return parser.Parse(state ); } | |||
687 | ||||
688 | // R807 access-spec -> PUBLIC | PRIVATE | |||
689 | TYPE_PARSER(construct<AccessSpec>("PUBLIC" >> pure(AccessSpec::Kind::Public)) ||template <> auto Parser<typename decltype(attempt(construct <AccessSpec>("PUBLIC" >> pure(AccessSpec::Kind::Public )) || construct<AccessSpec>("PRIVATE" >> pure(AccessSpec ::Kind::Private))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<AccessSpec>("PUBLIC" >> pure(AccessSpec ::Kind::Public)) || construct<AccessSpec>("PRIVATE" >> pure(AccessSpec::Kind::Private)))}; return parser.Parse(state ); } | |||
690 | construct<AccessSpec>("PRIVATE" >> pure(AccessSpec::Kind::Private)))template <> auto Parser<typename decltype(attempt(construct <AccessSpec>("PUBLIC" >> pure(AccessSpec::Kind::Public )) || construct<AccessSpec>("PRIVATE" >> pure(AccessSpec ::Kind::Private))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<AccessSpec>("PUBLIC" >> pure(AccessSpec ::Kind::Public)) || construct<AccessSpec>("PRIVATE" >> pure(AccessSpec::Kind::Private)))}; return parser.Parse(state ); } | |||
691 | ||||
692 | // R808 language-binding-spec -> | |||
693 | // BIND ( C [, NAME = scalar-default-char-constant-expr] ) | |||
694 | // R1528 proc-language-binding-spec -> language-binding-spec | |||
695 | TYPE_PARSER(construct<LanguageBindingSpec>(template <> auto Parser<typename decltype(attempt(construct <LanguageBindingSpec>( "BIND ( C" >> maybe(", NAME =" >> scalarDefaultCharConstantExpr) / ")")))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<LanguageBindingSpec >( "BIND ( C" >> maybe(", NAME =" >> scalarDefaultCharConstantExpr ) / ")"))}; return parser.Parse(state); } | |||
696 | "BIND ( C" >> maybe(", NAME =" >> scalarDefaultCharConstantExpr) / ")"))template <> auto Parser<typename decltype(attempt(construct <LanguageBindingSpec>( "BIND ( C" >> maybe(", NAME =" >> scalarDefaultCharConstantExpr) / ")")))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<LanguageBindingSpec >( "BIND ( C" >> maybe(", NAME =" >> scalarDefaultCharConstantExpr ) / ")"))}; return parser.Parse(state); } | |||
697 | ||||
698 | // R809 coarray-spec -> deferred-coshape-spec-list | explicit-coshape-spec | |||
699 | // N.B. Bracketed here rather than around references, for consistency with | |||
700 | // array-spec. | |||
701 | TYPE_PARSER(template <> auto Parser<typename decltype(attempt(construct <CoarraySpec>(bracketed(Parser<DeferredCoshapeSpecList >{})) || construct<CoarraySpec>(bracketed(Parser< ExplicitCoshapeSpec>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CoarraySpec>(bracketed(Parser< DeferredCoshapeSpecList>{})) || construct<CoarraySpec> (bracketed(Parser<ExplicitCoshapeSpec>{})))}; return parser .Parse(state); } | |||
702 | construct<CoarraySpec>(bracketed(Parser<DeferredCoshapeSpecList>{})) ||template <> auto Parser<typename decltype(attempt(construct <CoarraySpec>(bracketed(Parser<DeferredCoshapeSpecList >{})) || construct<CoarraySpec>(bracketed(Parser< ExplicitCoshapeSpec>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CoarraySpec>(bracketed(Parser< DeferredCoshapeSpecList>{})) || construct<CoarraySpec> (bracketed(Parser<ExplicitCoshapeSpec>{})))}; return parser .Parse(state); } | |||
703 | construct<CoarraySpec>(bracketed(Parser<ExplicitCoshapeSpec>{})))template <> auto Parser<typename decltype(attempt(construct <CoarraySpec>(bracketed(Parser<DeferredCoshapeSpecList >{})) || construct<CoarraySpec>(bracketed(Parser< ExplicitCoshapeSpec>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CoarraySpec>(bracketed(Parser< DeferredCoshapeSpecList>{})) || construct<CoarraySpec> (bracketed(Parser<ExplicitCoshapeSpec>{})))}; return parser .Parse(state); } | |||
704 | ||||
705 | // R810 deferred-coshape-spec -> : | |||
706 | // deferred-coshape-spec-list - just a list of colons | |||
707 | inline int listLength(std::list<Success> &&xs) { return xs.size(); } | |||
708 | ||||
709 | TYPE_PARSER(construct<DeferredCoshapeSpecList>(template <> auto Parser<typename decltype(attempt(construct <DeferredCoshapeSpecList>( applyFunction(listLength, nonemptyList (":"_tok)))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<DeferredCoshapeSpecList>( applyFunction(listLength , nonemptyList(":"_tok))))}; return parser.Parse(state); } | |||
710 | applyFunction(listLength, nonemptyList(":"_tok))))template <> auto Parser<typename decltype(attempt(construct <DeferredCoshapeSpecList>( applyFunction(listLength, nonemptyList (":"_tok)))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<DeferredCoshapeSpecList>( applyFunction(listLength , nonemptyList(":"_tok))))}; return parser.Parse(state); } | |||
711 | ||||
712 | // R811 explicit-coshape-spec -> | |||
713 | // [[lower-cobound :] upper-cobound ,]... [lower-cobound :] * | |||
714 | // R812 lower-cobound -> specification-expr | |||
715 | // R813 upper-cobound -> specification-expr | |||
716 | TYPE_PARSER(construct<ExplicitCoshapeSpec>(template <> auto Parser<typename decltype(attempt(construct <ExplicitCoshapeSpec>( many(explicitShapeSpec / ","), maybe (specificationExpr / ":") / "*")))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<ExplicitCoshapeSpec>( many(explicitShapeSpec / ","), maybe(specificationExpr / ":") / "*"))}; return parser .Parse(state); } | |||
717 | many(explicitShapeSpec / ","), maybe(specificationExpr / ":") / "*"))template <> auto Parser<typename decltype(attempt(construct <ExplicitCoshapeSpec>( many(explicitShapeSpec / ","), maybe (specificationExpr / ":") / "*")))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<ExplicitCoshapeSpec>( many(explicitShapeSpec / ","), maybe(specificationExpr / ":") / "*"))}; return parser .Parse(state); } | |||
718 | ||||
719 | // R815 array-spec -> | |||
720 | // explicit-shape-spec-list | assumed-shape-spec-list | | |||
721 | // deferred-shape-spec-list | assumed-size-spec | implied-shape-spec | | |||
722 | // implied-shape-or-assumed-size-spec | assumed-rank-spec | |||
723 | // N.B. Parenthesized here rather than around references to avoid | |||
724 | // a need for forced look-ahead. | |||
725 | // Shape specs that could be deferred-shape-spec or assumed-shape-spec | |||
726 | // (e.g. '(:,:)') are parsed as the former. | |||
727 | TYPE_PARSER(template <> auto Parser<typename decltype(attempt(construct <ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{})))}; return parser.Parse(state); } | |||
728 | construct<ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec))) ||template <> auto Parser<typename decltype(attempt(construct <ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{})))}; return parser.Parse(state); } | |||
729 | construct<ArraySpec>(parenthesized(deferredShapeSpecList)) ||template <> auto Parser<typename decltype(attempt(construct <ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{})))}; return parser.Parse(state); } | |||
730 | construct<ArraySpec>(template <> auto Parser<typename decltype(attempt(construct <ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{})))}; return parser.Parse(state); } | |||
731 | parenthesized(nonemptyList(Parser<AssumedShapeSpec>{}))) ||template <> auto Parser<typename decltype(attempt(construct <ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{})))}; return parser.Parse(state); } | |||
732 | construct<ArraySpec>(parenthesized(Parser<AssumedSizeSpec>{})) ||template <> auto Parser<typename decltype(attempt(construct <ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{})))}; return parser.Parse(state); } | |||
733 | construct<ArraySpec>(parenthesized(Parser<ImpliedShapeSpec>{})) ||template <> auto Parser<typename decltype(attempt(construct <ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{})))}; return parser.Parse(state); } | |||
734 | construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec>{})))template <> auto Parser<typename decltype(attempt(construct <ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<ArraySpec>(parenthesized(nonemptyList(explicitShapeSpec ))) || construct<ArraySpec>(parenthesized(deferredShapeSpecList )) || construct<ArraySpec>( parenthesized(nonemptyList( Parser<AssumedShapeSpec>{}))) || construct<ArraySpec >(parenthesized(Parser<AssumedSizeSpec>{})) || construct <ArraySpec>(parenthesized(Parser<ImpliedShapeSpec> {})) || construct<ArraySpec>(parenthesized(Parser<AssumedRankSpec >{})))}; return parser.Parse(state); } | |||
735 | ||||
736 | // R816 explicit-shape-spec -> [lower-bound :] upper-bound | |||
737 | // R817 lower-bound -> specification-expr | |||
738 | // R818 upper-bound -> specification-expr | |||
739 | TYPE_PARSER(construct<ExplicitShapeSpec>(template <> auto Parser<typename decltype(attempt(construct <ExplicitShapeSpec>( maybe(specificationExpr / ":"), specificationExpr )))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <ExplicitShapeSpec>( maybe(specificationExpr / ":"), specificationExpr ))}; return parser.Parse(state); } | |||
740 | maybe(specificationExpr / ":"), specificationExpr))template <> auto Parser<typename decltype(attempt(construct <ExplicitShapeSpec>( maybe(specificationExpr / ":"), specificationExpr )))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <ExplicitShapeSpec>( maybe(specificationExpr / ":"), specificationExpr ))}; return parser.Parse(state); } | |||
741 | ||||
742 | // R819 assumed-shape-spec -> [lower-bound] : | |||
743 | TYPE_PARSER(construct<AssumedShapeSpec>(maybe(specificationExpr) / ":"))template <> auto Parser<typename decltype(attempt(construct <AssumedShapeSpec>(maybe(specificationExpr) / ":")))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<AssumedShapeSpec >(maybe(specificationExpr) / ":"))}; return parser.Parse(state ); } | |||
744 | ||||
745 | // R820 deferred-shape-spec -> : | |||
746 | // deferred-shape-spec-list - just a list of colons | |||
747 | TYPE_PARSER(construct<DeferredShapeSpecList>(template <> auto Parser<typename decltype(attempt(construct <DeferredShapeSpecList>( applyFunction(listLength, nonemptyList (":"_tok)))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<DeferredShapeSpecList>( applyFunction(listLength , nonemptyList(":"_tok))))}; return parser.Parse(state); } | |||
748 | applyFunction(listLength, nonemptyList(":"_tok))))template <> auto Parser<typename decltype(attempt(construct <DeferredShapeSpecList>( applyFunction(listLength, nonemptyList (":"_tok)))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<DeferredShapeSpecList>( applyFunction(listLength , nonemptyList(":"_tok))))}; return parser.Parse(state); } | |||
749 | ||||
750 | // R821 assumed-implied-spec -> [lower-bound :] * | |||
751 | TYPE_PARSER(construct<AssumedImpliedSpec>(maybe(specificationExpr / ":") / "*"))template <> auto Parser<typename decltype(attempt(construct <AssumedImpliedSpec>(maybe(specificationExpr / ":") / "*" )))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <AssumedImpliedSpec>(maybe(specificationExpr / ":") / "*" ))}; return parser.Parse(state); } | |||
752 | ||||
753 | // R822 assumed-size-spec -> explicit-shape-spec-list , assumed-implied-spec | |||
754 | TYPE_PARSER(construct<AssumedSizeSpec>(template <> auto Parser<typename decltype(attempt(construct <AssumedSizeSpec>( nonemptyList(explicitShapeSpec) / "," , assumedImpliedSpec)))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<AssumedSizeSpec>( nonemptyList( explicitShapeSpec) / ",", assumedImpliedSpec))}; return parser .Parse(state); } | |||
755 | nonemptyList(explicitShapeSpec) / ",", assumedImpliedSpec))template <> auto Parser<typename decltype(attempt(construct <AssumedSizeSpec>( nonemptyList(explicitShapeSpec) / "," , assumedImpliedSpec)))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<AssumedSizeSpec>( nonemptyList( explicitShapeSpec) / ",", assumedImpliedSpec))}; return parser .Parse(state); } | |||
756 | ||||
757 | // R823 implied-shape-or-assumed-size-spec -> assumed-implied-spec | |||
758 | // R824 implied-shape-spec -> assumed-implied-spec , assumed-implied-spec-list | |||
759 | // I.e., when the assumed-implied-spec-list has a single item, it constitutes an | |||
760 | // implied-shape-or-assumed-size-spec; otherwise, an implied-shape-spec. | |||
761 | TYPE_PARSER(construct<ImpliedShapeSpec>(nonemptyList(assumedImpliedSpec)))template <> auto Parser<typename decltype(attempt(construct <ImpliedShapeSpec>(nonemptyList(assumedImpliedSpec)))):: resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(construct< ImpliedShapeSpec>(nonemptyList(assumedImpliedSpec)))}; return parser.Parse(state); } | |||
762 | ||||
763 | // R825 assumed-rank-spec -> .. | |||
764 | TYPE_PARSER(construct<AssumedRankSpec>(".."_tok))template <> auto Parser<typename decltype(attempt(construct <AssumedRankSpec>(".."_tok)))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<AssumedRankSpec>(".."_tok))}; return parser.Parse(state); } | |||
765 | ||||
766 | // R826 intent-spec -> IN | OUT | INOUT | |||
767 | TYPE_PARSER(construct<IntentSpec>("IN OUT" >> pure(IntentSpec::Intent::InOut) ||template <> auto Parser<typename decltype(attempt(construct <IntentSpec>("IN OUT" >> pure(IntentSpec::Intent:: InOut) || "IN" >> pure(IntentSpec::Intent::In) || "OUT" >> pure(IntentSpec::Intent::Out))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<IntentSpec>( "IN OUT" >> pure(IntentSpec::Intent::InOut) || "IN" >> pure(IntentSpec::Intent::In) || "OUT" >> pure(IntentSpec ::Intent::Out)))}; return parser.Parse(state); } | |||
768 | "IN" >> pure(IntentSpec::Intent::In) ||template <> auto Parser<typename decltype(attempt(construct <IntentSpec>("IN OUT" >> pure(IntentSpec::Intent:: InOut) || "IN" >> pure(IntentSpec::Intent::In) || "OUT" >> pure(IntentSpec::Intent::Out))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<IntentSpec>( "IN OUT" >> pure(IntentSpec::Intent::InOut) || "IN" >> pure(IntentSpec::Intent::In) || "OUT" >> pure(IntentSpec ::Intent::Out)))}; return parser.Parse(state); } | |||
769 | "OUT" >> pure(IntentSpec::Intent::Out)))template <> auto Parser<typename decltype(attempt(construct <IntentSpec>("IN OUT" >> pure(IntentSpec::Intent:: InOut) || "IN" >> pure(IntentSpec::Intent::In) || "OUT" >> pure(IntentSpec::Intent::Out))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<IntentSpec>( "IN OUT" >> pure(IntentSpec::Intent::InOut) || "IN" >> pure(IntentSpec::Intent::In) || "OUT" >> pure(IntentSpec ::Intent::Out)))}; return parser.Parse(state); } | |||
770 | ||||
771 | // R827 access-stmt -> access-spec [[::] access-id-list] | |||
772 | TYPE_PARSER(construct<AccessStmt>(accessSpec,template <> auto Parser<typename decltype(attempt(construct <AccessStmt>(accessSpec, defaulted(maybe("::"_tok) >> nonemptyList("expected names and generic specifications"_err_en_US , Parser<AccessId>{})))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<AccessStmt>(accessSpec, defaulted (maybe("::"_tok) >> nonemptyList("expected names and generic specifications"_err_en_US , Parser<AccessId>{}))))}; return parser.Parse(state); } | |||
773 | defaulted(maybe("::"_tok) >>template <> auto Parser<typename decltype(attempt(construct <AccessStmt>(accessSpec, defaulted(maybe("::"_tok) >> nonemptyList("expected names and generic specifications"_err_en_US , Parser<AccessId>{})))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<AccessStmt>(accessSpec, defaulted (maybe("::"_tok) >> nonemptyList("expected names and generic specifications"_err_en_US , Parser<AccessId>{}))))}; return parser.Parse(state); } | |||
774 | nonemptyList("expected names and generic specifications"_err_en_US,template <> auto Parser<typename decltype(attempt(construct <AccessStmt>(accessSpec, defaulted(maybe("::"_tok) >> nonemptyList("expected names and generic specifications"_err_en_US , Parser<AccessId>{})))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<AccessStmt>(accessSpec, defaulted (maybe("::"_tok) >> nonemptyList("expected names and generic specifications"_err_en_US , Parser<AccessId>{}))))}; return parser.Parse(state); } | |||
775 | Parser<AccessId>{}))))template <> auto Parser<typename decltype(attempt(construct <AccessStmt>(accessSpec, defaulted(maybe("::"_tok) >> nonemptyList("expected names and generic specifications"_err_en_US , Parser<AccessId>{})))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<AccessStmt>(accessSpec, defaulted (maybe("::"_tok) >> nonemptyList("expected names and generic specifications"_err_en_US , Parser<AccessId>{}))))}; return parser.Parse(state); } | |||
776 | ||||
777 | // R828 access-id -> access-name | generic-spec | |||
778 | // "access-name" is ambiguous with "generic-spec" | |||
779 | TYPE_PARSER(construct<AccessId>(indirect(genericSpec)))template <> auto Parser<typename decltype(attempt(construct <AccessId>(indirect(genericSpec))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<AccessId>(indirect (genericSpec)))}; return parser.Parse(state); } | |||
780 | ||||
781 | // R829 allocatable-stmt -> ALLOCATABLE [::] allocatable-decl-list | |||
782 | TYPE_PARSER(construct<AllocatableStmt>("ALLOCATABLE" >> maybe("::"_tok) >>template <> auto Parser<typename decltype(attempt(construct <AllocatableStmt>("ALLOCATABLE" >> maybe("::"_tok ) >> nonemptyList( "expected object declarations"_err_en_US , Parser<ObjectDecl>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<AllocatableStmt>("ALLOCATABLE" >> maybe("::"_tok) >> nonemptyList( "expected object declarations"_err_en_US , Parser<ObjectDecl>{})))}; return parser.Parse(state); } | |||
783 | nonemptyList(template <> auto Parser<typename decltype(attempt(construct <AllocatableStmt>("ALLOCATABLE" >> maybe("::"_tok ) >> nonemptyList( "expected object declarations"_err_en_US , Parser<ObjectDecl>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<AllocatableStmt>("ALLOCATABLE" >> maybe("::"_tok) >> nonemptyList( "expected object declarations"_err_en_US , Parser<ObjectDecl>{})))}; return parser.Parse(state); } | |||
784 | "expected object declarations"_err_en_US, Parser<ObjectDecl>{})))template <> auto Parser<typename decltype(attempt(construct <AllocatableStmt>("ALLOCATABLE" >> maybe("::"_tok ) >> nonemptyList( "expected object declarations"_err_en_US , Parser<ObjectDecl>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<AllocatableStmt>("ALLOCATABLE" >> maybe("::"_tok) >> nonemptyList( "expected object declarations"_err_en_US , Parser<ObjectDecl>{})))}; return parser.Parse(state); } | |||
785 | ||||
786 | // R830 allocatable-decl -> | |||
787 | // object-name [( array-spec )] [lbracket coarray-spec rbracket] | |||
788 | // R860 target-decl -> | |||
789 | // object-name [( array-spec )] [lbracket coarray-spec rbracket] | |||
790 | TYPE_PARSER(template <> auto Parser<typename decltype(attempt(construct <ObjectDecl>(objectName, maybe(arraySpec), maybe(coarraySpec ))))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <ObjectDecl>(objectName, maybe(arraySpec), maybe(coarraySpec )))}; return parser.Parse(state); } | |||
791 | construct<ObjectDecl>(objectName, maybe(arraySpec), maybe(coarraySpec)))template <> auto Parser<typename decltype(attempt(construct <ObjectDecl>(objectName, maybe(arraySpec), maybe(coarraySpec ))))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <ObjectDecl>(objectName, maybe(arraySpec), maybe(coarraySpec )))}; return parser.Parse(state); } | |||
792 | ||||
793 | // R831 asynchronous-stmt -> ASYNCHRONOUS [::] object-name-list | |||
794 | TYPE_PARSER(construct<AsynchronousStmt>("ASYNCHRONOUS" >> maybe("::"_tok) >>template <> auto Parser<typename decltype(attempt(construct <AsynchronousStmt>("ASYNCHRONOUS" >> maybe("::"_tok ) >> nonemptyList("expected object names"_err_en_US, objectName ))))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <AsynchronousStmt>("ASYNCHRONOUS" >> maybe("::"_tok ) >> nonemptyList("expected object names"_err_en_US, objectName )))}; return parser.Parse(state); } | |||
795 | nonemptyList("expected object names"_err_en_US, objectName)))template <> auto Parser<typename decltype(attempt(construct <AsynchronousStmt>("ASYNCHRONOUS" >> maybe("::"_tok ) >> nonemptyList("expected object names"_err_en_US, objectName ))))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <AsynchronousStmt>("ASYNCHRONOUS" >> maybe("::"_tok ) >> nonemptyList("expected object names"_err_en_US, objectName )))}; return parser.Parse(state); } | |||
796 | ||||
797 | // R832 bind-stmt -> language-binding-spec [::] bind-entity-list | |||
798 | TYPE_PARSER(construct<BindStmt>(languageBindingSpec / maybe("::"_tok),template <> auto Parser<typename decltype(attempt(construct <BindStmt>(languageBindingSpec / maybe("::"_tok), nonemptyList ("expected bind entities"_err_en_US, Parser<BindEntity> {}))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( construct<BindStmt>(languageBindingSpec / maybe("::"_tok ), nonemptyList("expected bind entities"_err_en_US, Parser< BindEntity>{})))}; return parser.Parse(state); } | |||
799 | nonemptyList("expected bind entities"_err_en_US, Parser<BindEntity>{})))template <> auto Parser<typename decltype(attempt(construct <BindStmt>(languageBindingSpec / maybe("::"_tok), nonemptyList ("expected bind entities"_err_en_US, Parser<BindEntity> {}))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( construct<BindStmt>(languageBindingSpec / maybe("::"_tok ), nonemptyList("expected bind entities"_err_en_US, Parser< BindEntity>{})))}; return parser.Parse(state); } | |||
800 | ||||
801 | // R833 bind-entity -> entity-name | / common-block-name / | |||
802 | TYPE_PARSER(construct<BindEntity>(pure(BindEntity::Kind::Object), name) ||template <> auto Parser<typename decltype(attempt(construct <BindEntity>(pure(BindEntity::Kind::Object), name) || construct <BindEntity>("/" >> pure(BindEntity::Kind::Common ), name / "/")))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<BindEntity>(pure(BindEntity::Kind::Object ), name) || construct<BindEntity>("/" >> pure(BindEntity ::Kind::Common), name / "/"))}; return parser.Parse(state); } | |||
803 | construct<BindEntity>("/" >> pure(BindEntity::Kind::Common), name / "/"))template <> auto Parser<typename decltype(attempt(construct <BindEntity>(pure(BindEntity::Kind::Object), name) || construct <BindEntity>("/" >> pure(BindEntity::Kind::Common ), name / "/")))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<BindEntity>(pure(BindEntity::Kind::Object ), name) || construct<BindEntity>("/" >> pure(BindEntity ::Kind::Common), name / "/"))}; return parser.Parse(state); } | |||
804 | ||||
805 | // R834 codimension-stmt -> CODIMENSION [::] codimension-decl-list | |||
806 | TYPE_PARSER(construct<CodimensionStmt>("CODIMENSION" >> maybe("::"_tok) >>template <> auto Parser<typename decltype(attempt(construct <CodimensionStmt>("CODIMENSION" >> maybe("::"_tok ) >> nonemptyList("expected codimension declarations"_err_en_US , Parser<CodimensionDecl>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CodimensionStmt> ("CODIMENSION" >> maybe("::"_tok) >> nonemptyList ("expected codimension declarations"_err_en_US, Parser<CodimensionDecl >{})))}; return parser.Parse(state); } | |||
807 | nonemptyList("expected codimension declarations"_err_en_US,template <> auto Parser<typename decltype(attempt(construct <CodimensionStmt>("CODIMENSION" >> maybe("::"_tok ) >> nonemptyList("expected codimension declarations"_err_en_US , Parser<CodimensionDecl>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CodimensionStmt> ("CODIMENSION" >> maybe("::"_tok) >> nonemptyList ("expected codimension declarations"_err_en_US, Parser<CodimensionDecl >{})))}; return parser.Parse(state); } | |||
808 | Parser<CodimensionDecl>{})))template <> auto Parser<typename decltype(attempt(construct <CodimensionStmt>("CODIMENSION" >> maybe("::"_tok ) >> nonemptyList("expected codimension declarations"_err_en_US , Parser<CodimensionDecl>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CodimensionStmt> ("CODIMENSION" >> maybe("::"_tok) >> nonemptyList ("expected codimension declarations"_err_en_US, Parser<CodimensionDecl >{})))}; return parser.Parse(state); } | |||
809 | ||||
810 | // R835 codimension-decl -> coarray-name lbracket coarray-spec rbracket | |||
811 | TYPE_PARSER(construct<CodimensionDecl>(name, coarraySpec))template <> auto Parser<typename decltype(attempt(construct <CodimensionDecl>(name, coarraySpec)))::resultType>:: Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<CodimensionDecl >(name, coarraySpec))}; return parser.Parse(state); } | |||
812 | ||||
813 | // R836 contiguous-stmt -> CONTIGUOUS [::] object-name-list | |||
814 | TYPE_PARSER(construct<ContiguousStmt>("CONTIGUOUS" >> maybe("::"_tok) >>template <> auto Parser<typename decltype(attempt(construct <ContiguousStmt>("CONTIGUOUS" >> maybe("::"_tok) >> nonemptyList("expected object names"_err_en_US, objectName)) ))::resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(construct< ContiguousStmt>("CONTIGUOUS" >> maybe("::"_tok) >> nonemptyList("expected object names"_err_en_US, objectName)) )}; return parser.Parse(state); } | |||
815 | nonemptyList("expected object names"_err_en_US, objectName)))template <> auto Parser<typename decltype(attempt(construct <ContiguousStmt>("CONTIGUOUS" >> maybe("::"_tok) >> nonemptyList("expected object names"_err_en_US, objectName)) ))::resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(construct< ContiguousStmt>("CONTIGUOUS" >> maybe("::"_tok) >> nonemptyList("expected object names"_err_en_US, objectName)) )}; return parser.Parse(state); } | |||
816 | ||||
817 | // R837 data-stmt -> DATA data-stmt-set [[,] data-stmt-set]... | |||
818 | TYPE_CONTEXT_PARSER("DATA statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("DATA statement"_en_US)), inContext((("DATA statement"_en_US )), ((construct<DataStmt>( "DATA" >> nonemptySeparated (Parser<DataStmtSet>{}, maybe(","_tok)))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("DATA statement"_en_US )), inContext((("DATA statement"_en_US)), ((construct<DataStmt >( "DATA" >> nonemptySeparated(Parser<DataStmtSet >{}, maybe(","_tok))))))))}; return parser.Parse(state); } | |||
819 | construct<DataStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("DATA statement"_en_US)), inContext((("DATA statement"_en_US )), ((construct<DataStmt>( "DATA" >> nonemptySeparated (Parser<DataStmtSet>{}, maybe(","_tok)))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("DATA statement"_en_US )), inContext((("DATA statement"_en_US)), ((construct<DataStmt >( "DATA" >> nonemptySeparated(Parser<DataStmtSet >{}, maybe(","_tok))))))))}; return parser.Parse(state); } | |||
820 | "DATA" >> nonemptySeparated(Parser<DataStmtSet>{}, maybe(","_tok))))template <> auto Parser<typename decltype(attempt(instrumented ((("DATA statement"_en_US)), inContext((("DATA statement"_en_US )), ((construct<DataStmt>( "DATA" >> nonemptySeparated (Parser<DataStmtSet>{}, maybe(","_tok)))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("DATA statement"_en_US )), inContext((("DATA statement"_en_US)), ((construct<DataStmt >( "DATA" >> nonemptySeparated(Parser<DataStmtSet >{}, maybe(","_tok))))))))}; return parser.Parse(state); } | |||
821 | ||||
822 | // R838 data-stmt-set -> data-stmt-object-list / data-stmt-value-list / | |||
823 | TYPE_PARSER(construct<DataStmtSet>(template <> auto Parser<typename decltype(attempt(construct <DataStmtSet>( nonemptyList( "expected DATA statement objects"_err_en_US , Parser<DataStmtObject>{}), withMessage("expected DATA statement value list"_err_en_US , "/"_tok >> nonemptyList("expected DATA statement values"_err_en_US , Parser<DataStmtValue>{})) / "/")))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataStmtSet> ( nonemptyList( "expected DATA statement objects"_err_en_US, Parser <DataStmtObject>{}), withMessage("expected DATA statement value list"_err_en_US , "/"_tok >> nonemptyList("expected DATA statement values"_err_en_US , Parser<DataStmtValue>{})) / "/"))}; return parser.Parse (state); } | |||
824 | nonemptyList(template <> auto Parser<typename decltype(attempt(construct <DataStmtSet>( nonemptyList( "expected DATA statement objects"_err_en_US , Parser<DataStmtObject>{}), withMessage("expected DATA statement value list"_err_en_US , "/"_tok >> nonemptyList("expected DATA statement values"_err_en_US , Parser<DataStmtValue>{})) / "/")))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataStmtSet> ( nonemptyList( "expected DATA statement objects"_err_en_US, Parser <DataStmtObject>{}), withMessage("expected DATA statement value list"_err_en_US , "/"_tok >> nonemptyList("expected DATA statement values"_err_en_US , Parser<DataStmtValue>{})) / "/"))}; return parser.Parse (state); } | |||
825 | "expected DATA statement objects"_err_en_US, Parser<DataStmtObject>{}),template <> auto Parser<typename decltype(attempt(construct <DataStmtSet>( nonemptyList( "expected DATA statement objects"_err_en_US , Parser<DataStmtObject>{}), withMessage("expected DATA statement value list"_err_en_US , "/"_tok >> nonemptyList("expected DATA statement values"_err_en_US , Parser<DataStmtValue>{})) / "/")))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataStmtSet> ( nonemptyList( "expected DATA statement objects"_err_en_US, Parser <DataStmtObject>{}), withMessage("expected DATA statement value list"_err_en_US , "/"_tok >> nonemptyList("expected DATA statement values"_err_en_US , Parser<DataStmtValue>{})) / "/"))}; return parser.Parse (state); } | |||
826 | withMessage("expected DATA statement value list"_err_en_US,template <> auto Parser<typename decltype(attempt(construct <DataStmtSet>( nonemptyList( "expected DATA statement objects"_err_en_US , Parser<DataStmtObject>{}), withMessage("expected DATA statement value list"_err_en_US , "/"_tok >> nonemptyList("expected DATA statement values"_err_en_US , Parser<DataStmtValue>{})) / "/")))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataStmtSet> ( nonemptyList( "expected DATA statement objects"_err_en_US, Parser <DataStmtObject>{}), withMessage("expected DATA statement value list"_err_en_US , "/"_tok >> nonemptyList("expected DATA statement values"_err_en_US , Parser<DataStmtValue>{})) / "/"))}; return parser.Parse (state); } | |||
827 | "/"_tok >> nonemptyList("expected DATA statement values"_err_en_US,template <> auto Parser<typename decltype(attempt(construct <DataStmtSet>( nonemptyList( "expected DATA statement objects"_err_en_US , Parser<DataStmtObject>{}), withMessage("expected DATA statement value list"_err_en_US , "/"_tok >> nonemptyList("expected DATA statement values"_err_en_US , Parser<DataStmtValue>{})) / "/")))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataStmtSet> ( nonemptyList( "expected DATA statement objects"_err_en_US, Parser <DataStmtObject>{}), withMessage("expected DATA statement value list"_err_en_US , "/"_tok >> nonemptyList("expected DATA statement values"_err_en_US , Parser<DataStmtValue>{})) / "/"))}; return parser.Parse (state); } | |||
828 | Parser<DataStmtValue>{})) /template <> auto Parser<typename decltype(attempt(construct <DataStmtSet>( nonemptyList( "expected DATA statement objects"_err_en_US , Parser<DataStmtObject>{}), withMessage("expected DATA statement value list"_err_en_US , "/"_tok >> nonemptyList("expected DATA statement values"_err_en_US , Parser<DataStmtValue>{})) / "/")))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataStmtSet> ( nonemptyList( "expected DATA statement objects"_err_en_US, Parser <DataStmtObject>{}), withMessage("expected DATA statement value list"_err_en_US , "/"_tok >> nonemptyList("expected DATA statement values"_err_en_US , Parser<DataStmtValue>{})) / "/"))}; return parser.Parse (state); } | |||
829 | "/"))template <> auto Parser<typename decltype(attempt(construct <DataStmtSet>( nonemptyList( "expected DATA statement objects"_err_en_US , Parser<DataStmtObject>{}), withMessage("expected DATA statement value list"_err_en_US , "/"_tok >> nonemptyList("expected DATA statement values"_err_en_US , Parser<DataStmtValue>{})) / "/")))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataStmtSet> ( nonemptyList( "expected DATA statement objects"_err_en_US, Parser <DataStmtObject>{}), withMessage("expected DATA statement value list"_err_en_US , "/"_tok >> nonemptyList("expected DATA statement values"_err_en_US , Parser<DataStmtValue>{})) / "/"))}; return parser.Parse (state); } | |||
830 | ||||
831 | // R839 data-stmt-object -> variable | data-implied-do | |||
832 | TYPE_PARSER(construct<DataStmtObject>(indirect(variable)) ||template <> auto Parser<typename decltype(attempt(construct <DataStmtObject>(indirect(variable)) || construct<DataStmtObject >(dataImpliedDo)))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataStmtObject>(indirect(variable )) || construct<DataStmtObject>(dataImpliedDo))}; return parser.Parse(state); } | |||
833 | construct<DataStmtObject>(dataImpliedDo))template <> auto Parser<typename decltype(attempt(construct <DataStmtObject>(indirect(variable)) || construct<DataStmtObject >(dataImpliedDo)))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataStmtObject>(indirect(variable )) || construct<DataStmtObject>(dataImpliedDo))}; return parser.Parse(state); } | |||
834 | ||||
835 | // R840 data-implied-do -> | |||
836 | // ( data-i-do-object-list , [integer-type-spec ::] data-i-do-variable | |||
837 | // = scalar-int-constant-expr , scalar-int-constant-expr | |||
838 | // [, scalar-int-constant-expr] ) | |||
839 | // R842 data-i-do-variable -> do-variable | |||
840 | TYPE_PARSER(parenthesized(construct<DataImpliedDo>(template <> auto Parser<typename decltype(attempt(parenthesized (construct<DataImpliedDo>( nonemptyList(Parser<DataIDoObject >{} / lookAhead(","_tok)) / ",", maybe(integerTypeSpec / "::" ), loopBounds(scalarIntConstantExpr)))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(parenthesized(construct<DataImpliedDo >( nonemptyList(Parser<DataIDoObject>{} / lookAhead( ","_tok)) / ",", maybe(integerTypeSpec / "::"), loopBounds(scalarIntConstantExpr ))))}; return parser.Parse(state); } | |||
841 | nonemptyList(Parser<DataIDoObject>{} / lookAhead(","_tok)) / ",",template <> auto Parser<typename decltype(attempt(parenthesized (construct<DataImpliedDo>( nonemptyList(Parser<DataIDoObject >{} / lookAhead(","_tok)) / ",", maybe(integerTypeSpec / "::" ), loopBounds(scalarIntConstantExpr)))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(parenthesized(construct<DataImpliedDo >( nonemptyList(Parser<DataIDoObject>{} / lookAhead( ","_tok)) / ",", maybe(integerTypeSpec / "::"), loopBounds(scalarIntConstantExpr ))))}; return parser.Parse(state); } | |||
842 | maybe(integerTypeSpec / "::"), loopBounds(scalarIntConstantExpr))))template <> auto Parser<typename decltype(attempt(parenthesized (construct<DataImpliedDo>( nonemptyList(Parser<DataIDoObject >{} / lookAhead(","_tok)) / ",", maybe(integerTypeSpec / "::" ), loopBounds(scalarIntConstantExpr)))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(parenthesized(construct<DataImpliedDo >( nonemptyList(Parser<DataIDoObject>{} / lookAhead( ","_tok)) / ",", maybe(integerTypeSpec / "::"), loopBounds(scalarIntConstantExpr ))))}; return parser.Parse(state); } | |||
843 | ||||
844 | // R841 data-i-do-object -> | |||
845 | // array-element | scalar-structure-component | data-implied-do | |||
846 | TYPE_PARSER(construct<DataIDoObject>(scalar(indirect(designator))) ||template <> auto Parser<typename decltype(attempt(construct <DataIDoObject>(scalar(indirect(designator))) || construct <DataIDoObject>(indirect(dataImpliedDo))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<DataIDoObject >(scalar(indirect(designator))) || construct<DataIDoObject >(indirect(dataImpliedDo)))}; return parser.Parse(state); } | |||
847 | construct<DataIDoObject>(indirect(dataImpliedDo)))template <> auto Parser<typename decltype(attempt(construct <DataIDoObject>(scalar(indirect(designator))) || construct <DataIDoObject>(indirect(dataImpliedDo))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<DataIDoObject >(scalar(indirect(designator))) || construct<DataIDoObject >(indirect(dataImpliedDo)))}; return parser.Parse(state); } | |||
848 | ||||
849 | // R843 data-stmt-value -> [data-stmt-repeat *] data-stmt-constant | |||
850 | TYPE_PARSER(construct<DataStmtValue>(template <> auto Parser<typename decltype(attempt(construct <DataStmtValue>( maybe(Parser<DataStmtRepeat>{} / "*"), Parser<DataStmtConstant>{})))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataStmtValue> ( maybe(Parser<DataStmtRepeat>{} / "*"), Parser<DataStmtConstant >{}))}; return parser.Parse(state); } | |||
851 | maybe(Parser<DataStmtRepeat>{} / "*"), Parser<DataStmtConstant>{}))template <> auto Parser<typename decltype(attempt(construct <DataStmtValue>( maybe(Parser<DataStmtRepeat>{} / "*"), Parser<DataStmtConstant>{})))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataStmtValue> ( maybe(Parser<DataStmtRepeat>{} / "*"), Parser<DataStmtConstant >{}))}; return parser.Parse(state); } | |||
852 | ||||
853 | // R847 constant-subobject -> designator | |||
854 | // R846 int-constant-subobject -> constant-subobject | |||
855 | constexpr auto constantSubobject{constant(indirect(designator))}; | |||
856 | ||||
857 | // R844 data-stmt-repeat -> scalar-int-constant | scalar-int-constant-subobject | |||
858 | // R607 int-constant -> constant | |||
859 | // Factored into: constant -> literal-constant -> int-literal-constant | |||
860 | // The named-constant alternative of constant is subsumed by constant-subobject | |||
861 | TYPE_PARSER(construct<DataStmtRepeat>(intLiteralConstant) ||template <> auto Parser<typename decltype(attempt(construct <DataStmtRepeat>(intLiteralConstant) || construct<DataStmtRepeat >(scalar(integer(constantSubobject)))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataStmtRepeat> (intLiteralConstant) || construct<DataStmtRepeat>(scalar (integer(constantSubobject))))}; return parser.Parse(state); } | |||
862 | construct<DataStmtRepeat>(scalar(integer(constantSubobject))))template <> auto Parser<typename decltype(attempt(construct <DataStmtRepeat>(intLiteralConstant) || construct<DataStmtRepeat >(scalar(integer(constantSubobject)))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<DataStmtRepeat> (intLiteralConstant) || construct<DataStmtRepeat>(scalar (integer(constantSubobject))))}; return parser.Parse(state); } | |||
863 | ||||
864 | // R845 data-stmt-constant -> | |||
865 | // scalar-constant | scalar-constant-subobject | | |||
866 | // signed-int-literal-constant | signed-real-literal-constant | | |||
867 | // null-init | initial-data-target | | |||
868 | // constant-structure-constructor | |||
869 | // N.B. scalar-constant and scalar-constant-subobject are ambiguous with | |||
870 | // initial-data-target; null-init and structure-constructor are ambiguous | |||
871 | // in the absence of parameters and components; structure-constructor with | |||
872 | // components can be ambiguous with a scalar-constant-subobject. | |||
873 | // So we parse literal constants, designator, null-init, and | |||
874 | // structure-constructor, so that semantics can figure things out later | |||
875 | // with the symbol table. | |||
876 | TYPE_PARSER(sourced(first(construct<DataStmtConstant>(literalConstant),template <> auto Parser<typename decltype(attempt(sourced (first(construct<DataStmtConstant>(literalConstant), construct <DataStmtConstant>(signedRealLiteralConstant), construct <DataStmtConstant>(signedIntLiteralConstant), extension <LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( sourced(first(construct<DataStmtConstant>(literalConstant ), construct<DataStmtConstant>(signedRealLiteralConstant ), construct<DataStmtConstant>(signedIntLiteralConstant ), extension<LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} ))))}; return parser.Parse(state); } | |||
877 | construct<DataStmtConstant>(signedRealLiteralConstant),template <> auto Parser<typename decltype(attempt(sourced (first(construct<DataStmtConstant>(literalConstant), construct <DataStmtConstant>(signedRealLiteralConstant), construct <DataStmtConstant>(signedIntLiteralConstant), extension <LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( sourced(first(construct<DataStmtConstant>(literalConstant ), construct<DataStmtConstant>(signedRealLiteralConstant ), construct<DataStmtConstant>(signedIntLiteralConstant ), extension<LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} ))))}; return parser.Parse(state); } | |||
878 | construct<DataStmtConstant>(signedIntLiteralConstant),template <> auto Parser<typename decltype(attempt(sourced (first(construct<DataStmtConstant>(literalConstant), construct <DataStmtConstant>(signedRealLiteralConstant), construct <DataStmtConstant>(signedIntLiteralConstant), extension <LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( sourced(first(construct<DataStmtConstant>(literalConstant ), construct<DataStmtConstant>(signedRealLiteralConstant ), construct<DataStmtConstant>(signedIntLiteralConstant ), extension<LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} ))))}; return parser.Parse(state); } | |||
879 | extension<LanguageFeature::SignedComplexLiteral>(template <> auto Parser<typename decltype(attempt(sourced (first(construct<DataStmtConstant>(literalConstant), construct <DataStmtConstant>(signedRealLiteralConstant), construct <DataStmtConstant>(signedIntLiteralConstant), extension <LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( sourced(first(construct<DataStmtConstant>(literalConstant ), construct<DataStmtConstant>(signedRealLiteralConstant ), construct<DataStmtConstant>(signedIntLiteralConstant ), extension<LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} ))))}; return parser.Parse(state); } | |||
880 | "nonstandard usage: signed COMPLEX literal"_port_en_US,template <> auto Parser<typename decltype(attempt(sourced (first(construct<DataStmtConstant>(literalConstant), construct <DataStmtConstant>(signedRealLiteralConstant), construct <DataStmtConstant>(signedIntLiteralConstant), extension <LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( sourced(first(construct<DataStmtConstant>(literalConstant ), construct<DataStmtConstant>(signedRealLiteralConstant ), construct<DataStmtConstant>(signedIntLiteralConstant ), extension<LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} ))))}; return parser.Parse(state); } | |||
881 | construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant>{})),template <> auto Parser<typename decltype(attempt(sourced (first(construct<DataStmtConstant>(literalConstant), construct <DataStmtConstant>(signedRealLiteralConstant), construct <DataStmtConstant>(signedIntLiteralConstant), extension <LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( sourced(first(construct<DataStmtConstant>(literalConstant ), construct<DataStmtConstant>(signedRealLiteralConstant ), construct<DataStmtConstant>(signedIntLiteralConstant ), extension<LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} ))))}; return parser.Parse(state); } | |||
882 | construct<DataStmtConstant>(nullInit),template <> auto Parser<typename decltype(attempt(sourced (first(construct<DataStmtConstant>(literalConstant), construct <DataStmtConstant>(signedRealLiteralConstant), construct <DataStmtConstant>(signedIntLiteralConstant), extension <LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( sourced(first(construct<DataStmtConstant>(literalConstant ), construct<DataStmtConstant>(signedRealLiteralConstant ), construct<DataStmtConstant>(signedIntLiteralConstant ), extension<LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} ))))}; return parser.Parse(state); } | |||
883 | construct<DataStmtConstant>(indirect(designator) / !"("_tok),template <> auto Parser<typename decltype(attempt(sourced (first(construct<DataStmtConstant>(literalConstant), construct <DataStmtConstant>(signedRealLiteralConstant), construct <DataStmtConstant>(signedIntLiteralConstant), extension <LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( sourced(first(construct<DataStmtConstant>(literalConstant ), construct<DataStmtConstant>(signedRealLiteralConstant ), construct<DataStmtConstant>(signedIntLiteralConstant ), extension<LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} ))))}; return parser.Parse(state); } | |||
884 | construct<DataStmtConstant>(Parser<StructureConstructor>{}))))template <> auto Parser<typename decltype(attempt(sourced (first(construct<DataStmtConstant>(literalConstant), construct <DataStmtConstant>(signedRealLiteralConstant), construct <DataStmtConstant>(signedIntLiteralConstant), extension <LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( sourced(first(construct<DataStmtConstant>(literalConstant ), construct<DataStmtConstant>(signedRealLiteralConstant ), construct<DataStmtConstant>(signedIntLiteralConstant ), extension<LanguageFeature::SignedComplexLiteral>( "nonstandard usage: signed COMPLEX literal"_port_en_US , construct<DataStmtConstant>(Parser<SignedComplexLiteralConstant >{})), construct<DataStmtConstant>(nullInit), construct <DataStmtConstant>(indirect(designator) / !"("_tok), construct <DataStmtConstant>(Parser<StructureConstructor>{} ))))}; return parser.Parse(state); } | |||
885 | ||||
886 | // R848 dimension-stmt -> | |||
887 | // DIMENSION [::] array-name ( array-spec ) | |||
888 | // [, array-name ( array-spec )]... | |||
889 | TYPE_CONTEXT_PARSER("DIMENSION statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("DIMENSION statement"_en_US)), inContext((("DIMENSION statement"_en_US )), ((construct<DimensionStmt>("DIMENSION" >> maybe ("::"_tok) >> nonemptyList("expected array specifications"_err_en_US , construct<DimensionStmt::Declaration>(name, arraySpec )))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("DIMENSION statement"_en_US)), inContext((("DIMENSION statement"_en_US )), ((construct<DimensionStmt>("DIMENSION" >> maybe ("::"_tok) >> nonemptyList("expected array specifications"_err_en_US , construct<DimensionStmt::Declaration>(name, arraySpec ))))))))}; return parser.Parse(state); } | |||
890 | construct<DimensionStmt>("DIMENSION" >> maybe("::"_tok) >>template <> auto Parser<typename decltype(attempt(instrumented ((("DIMENSION statement"_en_US)), inContext((("DIMENSION statement"_en_US )), ((construct<DimensionStmt>("DIMENSION" >> maybe ("::"_tok) >> nonemptyList("expected array specifications"_err_en_US , construct<DimensionStmt::Declaration>(name, arraySpec )))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("DIMENSION statement"_en_US)), inContext((("DIMENSION statement"_en_US )), ((construct<DimensionStmt>("DIMENSION" >> maybe ("::"_tok) >> nonemptyList("expected array specifications"_err_en_US , construct<DimensionStmt::Declaration>(name, arraySpec ))))))))}; return parser.Parse(state); } | |||
891 | nonemptyList("expected array specifications"_err_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("DIMENSION statement"_en_US)), inContext((("DIMENSION statement"_en_US )), ((construct<DimensionStmt>("DIMENSION" >> maybe ("::"_tok) >> nonemptyList("expected array specifications"_err_en_US , construct<DimensionStmt::Declaration>(name, arraySpec )))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("DIMENSION statement"_en_US)), inContext((("DIMENSION statement"_en_US )), ((construct<DimensionStmt>("DIMENSION" >> maybe ("::"_tok) >> nonemptyList("expected array specifications"_err_en_US , construct<DimensionStmt::Declaration>(name, arraySpec ))))))))}; return parser.Parse(state); } | |||
892 | construct<DimensionStmt::Declaration>(name, arraySpec))))template <> auto Parser<typename decltype(attempt(instrumented ((("DIMENSION statement"_en_US)), inContext((("DIMENSION statement"_en_US )), ((construct<DimensionStmt>("DIMENSION" >> maybe ("::"_tok) >> nonemptyList("expected array specifications"_err_en_US , construct<DimensionStmt::Declaration>(name, arraySpec )))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("DIMENSION statement"_en_US)), inContext((("DIMENSION statement"_en_US )), ((construct<DimensionStmt>("DIMENSION" >> maybe ("::"_tok) >> nonemptyList("expected array specifications"_err_en_US , construct<DimensionStmt::Declaration>(name, arraySpec ))))))))}; return parser.Parse(state); } | |||
893 | ||||
894 | // R849 intent-stmt -> INTENT ( intent-spec ) [::] dummy-arg-name-list | |||
895 | TYPE_CONTEXT_PARSER("INTENT statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("INTENT statement"_en_US)), inContext((("INTENT statement"_en_US )), ((construct<IntentStmt>( "INTENT" >> parenthesized (intentSpec) / maybe("::"_tok), listOfNames)))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("INTENT statement"_en_US )), inContext((("INTENT statement"_en_US)), ((construct<IntentStmt >( "INTENT" >> parenthesized(intentSpec) / maybe("::"_tok ), listOfNames))))))}; return parser.Parse(state); } | |||
896 | construct<IntentStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("INTENT statement"_en_US)), inContext((("INTENT statement"_en_US )), ((construct<IntentStmt>( "INTENT" >> parenthesized (intentSpec) / maybe("::"_tok), listOfNames)))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("INTENT statement"_en_US )), inContext((("INTENT statement"_en_US)), ((construct<IntentStmt >( "INTENT" >> parenthesized(intentSpec) / maybe("::"_tok ), listOfNames))))))}; return parser.Parse(state); } | |||
897 | "INTENT" >> parenthesized(intentSpec) / maybe("::"_tok), listOfNames))template <> auto Parser<typename decltype(attempt(instrumented ((("INTENT statement"_en_US)), inContext((("INTENT statement"_en_US )), ((construct<IntentStmt>( "INTENT" >> parenthesized (intentSpec) / maybe("::"_tok), listOfNames)))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("INTENT statement"_en_US )), inContext((("INTENT statement"_en_US)), ((construct<IntentStmt >( "INTENT" >> parenthesized(intentSpec) / maybe("::"_tok ), listOfNames))))))}; return parser.Parse(state); } | |||
898 | ||||
899 | // R850 optional-stmt -> OPTIONAL [::] dummy-arg-name-list | |||
900 | TYPE_PARSER(template <> auto Parser<typename decltype(attempt(construct <OptionalStmt>("OPTIONAL" >> maybe("::"_tok) >> listOfNames)))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<OptionalStmt>("OPTIONAL" >> maybe ("::"_tok) >> listOfNames))}; return parser.Parse(state ); } | |||
901 | construct<OptionalStmt>("OPTIONAL" >> maybe("::"_tok) >> listOfNames))template <> auto Parser<typename decltype(attempt(construct <OptionalStmt>("OPTIONAL" >> maybe("::"_tok) >> listOfNames)))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<OptionalStmt>("OPTIONAL" >> maybe ("::"_tok) >> listOfNames))}; return parser.Parse(state ); } | |||
902 | ||||
903 | // R851 parameter-stmt -> PARAMETER ( named-constant-def-list ) | |||
904 | // Legacy extension: omitted parentheses, no implicit typing from names | |||
905 | TYPE_CONTEXT_PARSER("PARAMETER statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("PARAMETER statement"_en_US)), inContext((("PARAMETER statement"_en_US )), ((construct<ParameterStmt>( "PARAMETER" >> parenthesized (nonemptyList(Parser<NamedConstantDef>{})))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("PARAMETER statement"_en_US )), inContext((("PARAMETER statement"_en_US)), ((construct< ParameterStmt>( "PARAMETER" >> parenthesized(nonemptyList (Parser<NamedConstantDef>{}))))))))}; return parser.Parse (state); } | |||
906 | construct<ParameterStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("PARAMETER statement"_en_US)), inContext((("PARAMETER statement"_en_US )), ((construct<ParameterStmt>( "PARAMETER" >> parenthesized (nonemptyList(Parser<NamedConstantDef>{})))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("PARAMETER statement"_en_US )), inContext((("PARAMETER statement"_en_US)), ((construct< ParameterStmt>( "PARAMETER" >> parenthesized(nonemptyList (Parser<NamedConstantDef>{}))))))))}; return parser.Parse (state); } | |||
907 | "PARAMETER" >> parenthesized(nonemptyList(Parser<NamedConstantDef>{}))))template <> auto Parser<typename decltype(attempt(instrumented ((("PARAMETER statement"_en_US)), inContext((("PARAMETER statement"_en_US )), ((construct<ParameterStmt>( "PARAMETER" >> parenthesized (nonemptyList(Parser<NamedConstantDef>{})))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("PARAMETER statement"_en_US )), inContext((("PARAMETER statement"_en_US)), ((construct< ParameterStmt>( "PARAMETER" >> parenthesized(nonemptyList (Parser<NamedConstantDef>{}))))))))}; return parser.Parse (state); } | |||
908 | TYPE_CONTEXT_PARSER("old style PARAMETER statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("old style PARAMETER statement"_en_US)), inContext((("old style PARAMETER statement"_en_US )), ((extension<LanguageFeature::OldStyleParameter>( "nonstandard usage: PARAMETER without parentheses"_port_en_US , construct<OldParameterStmt>( "PARAMETER" >> nonemptyList (Parser<NamedConstantDef>{})))))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("old style PARAMETER statement"_en_US )), inContext((("old style PARAMETER statement"_en_US)), ((extension <LanguageFeature::OldStyleParameter>( "nonstandard usage: PARAMETER without parentheses"_port_en_US , construct<OldParameterStmt>( "PARAMETER" >> nonemptyList (Parser<NamedConstantDef>{}))))))))}; return parser.Parse (state); } | |||
909 | extension<LanguageFeature::OldStyleParameter>(template <> auto Parser<typename decltype(attempt(instrumented ((("old style PARAMETER statement"_en_US)), inContext((("old style PARAMETER statement"_en_US )), ((extension<LanguageFeature::OldStyleParameter>( "nonstandard usage: PARAMETER without parentheses"_port_en_US , construct<OldParameterStmt>( "PARAMETER" >> nonemptyList (Parser<NamedConstantDef>{})))))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("old style PARAMETER statement"_en_US )), inContext((("old style PARAMETER statement"_en_US)), ((extension <LanguageFeature::OldStyleParameter>( "nonstandard usage: PARAMETER without parentheses"_port_en_US , construct<OldParameterStmt>( "PARAMETER" >> nonemptyList (Parser<NamedConstantDef>{}))))))))}; return parser.Parse (state); } | |||
910 | "nonstandard usage: PARAMETER without parentheses"_port_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("old style PARAMETER statement"_en_US)), inContext((("old style PARAMETER statement"_en_US )), ((extension<LanguageFeature::OldStyleParameter>( "nonstandard usage: PARAMETER without parentheses"_port_en_US , construct<OldParameterStmt>( "PARAMETER" >> nonemptyList (Parser<NamedConstantDef>{})))))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("old style PARAMETER statement"_en_US )), inContext((("old style PARAMETER statement"_en_US)), ((extension <LanguageFeature::OldStyleParameter>( "nonstandard usage: PARAMETER without parentheses"_port_en_US , construct<OldParameterStmt>( "PARAMETER" >> nonemptyList (Parser<NamedConstantDef>{}))))))))}; return parser.Parse (state); } | |||
911 | construct<OldParameterStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("old style PARAMETER statement"_en_US)), inContext((("old style PARAMETER statement"_en_US )), ((extension<LanguageFeature::OldStyleParameter>( "nonstandard usage: PARAMETER without parentheses"_port_en_US , construct<OldParameterStmt>( "PARAMETER" >> nonemptyList (Parser<NamedConstantDef>{})))))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("old style PARAMETER statement"_en_US )), inContext((("old style PARAMETER statement"_en_US)), ((extension <LanguageFeature::OldStyleParameter>( "nonstandard usage: PARAMETER without parentheses"_port_en_US , construct<OldParameterStmt>( "PARAMETER" >> nonemptyList (Parser<NamedConstantDef>{}))))))))}; return parser.Parse (state); } | |||
912 | "PARAMETER" >> nonemptyList(Parser<NamedConstantDef>{}))))template <> auto Parser<typename decltype(attempt(instrumented ((("old style PARAMETER statement"_en_US)), inContext((("old style PARAMETER statement"_en_US )), ((extension<LanguageFeature::OldStyleParameter>( "nonstandard usage: PARAMETER without parentheses"_port_en_US , construct<OldParameterStmt>( "PARAMETER" >> nonemptyList (Parser<NamedConstantDef>{})))))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("old style PARAMETER statement"_en_US )), inContext((("old style PARAMETER statement"_en_US)), ((extension <LanguageFeature::OldStyleParameter>( "nonstandard usage: PARAMETER without parentheses"_port_en_US , construct<OldParameterStmt>( "PARAMETER" >> nonemptyList (Parser<NamedConstantDef>{}))))))))}; return parser.Parse (state); } | |||
913 | ||||
914 | // R852 named-constant-def -> named-constant = constant-expr | |||
915 | TYPE_PARSER(construct<NamedConstantDef>(namedConstant, "=" >> constantExpr))template <> auto Parser<typename decltype(attempt(construct <NamedConstantDef>(namedConstant, "=" >> constantExpr )))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <NamedConstantDef>(namedConstant, "=" >> constantExpr ))}; return parser.Parse(state); } | |||
916 | ||||
917 | // R853 pointer-stmt -> POINTER [::] pointer-decl-list | |||
918 | TYPE_PARSER(construct<PointerStmt>("POINTER" >> maybe("::"_tok) >>template <> auto Parser<typename decltype(attempt(construct <PointerStmt>("POINTER" >> maybe("::"_tok) >> nonemptyList( "expected pointer declarations"_err_en_US, Parser <PointerDecl>{}))))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<PointerStmt>("POINTER" >> maybe("::"_tok) >> nonemptyList( "expected pointer declarations"_err_en_US , Parser<PointerDecl>{})))}; return parser.Parse(state) ; } | |||
919 | nonemptyList(template <> auto Parser<typename decltype(attempt(construct <PointerStmt>("POINTER" >> maybe("::"_tok) >> nonemptyList( "expected pointer declarations"_err_en_US, Parser <PointerDecl>{}))))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<PointerStmt>("POINTER" >> maybe("::"_tok) >> nonemptyList( "expected pointer declarations"_err_en_US , Parser<PointerDecl>{})))}; return parser.Parse(state) ; } | |||
920 | "expected pointer declarations"_err_en_US, Parser<PointerDecl>{})))template <> auto Parser<typename decltype(attempt(construct <PointerStmt>("POINTER" >> maybe("::"_tok) >> nonemptyList( "expected pointer declarations"_err_en_US, Parser <PointerDecl>{}))))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<PointerStmt>("POINTER" >> maybe("::"_tok) >> nonemptyList( "expected pointer declarations"_err_en_US , Parser<PointerDecl>{})))}; return parser.Parse(state) ; } | |||
921 | ||||
922 | // R854 pointer-decl -> | |||
923 | // object-name [( deferred-shape-spec-list )] | proc-entity-name | |||
924 | TYPE_PARSER(template <> auto Parser<typename decltype(attempt(construct <PointerDecl>(name, maybe(parenthesized(deferredShapeSpecList )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( construct<PointerDecl>(name, maybe(parenthesized(deferredShapeSpecList ))))}; return parser.Parse(state); } | |||
925 | construct<PointerDecl>(name, maybe(parenthesized(deferredShapeSpecList))))template <> auto Parser<typename decltype(attempt(construct <PointerDecl>(name, maybe(parenthesized(deferredShapeSpecList )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( construct<PointerDecl>(name, maybe(parenthesized(deferredShapeSpecList ))))}; return parser.Parse(state); } | |||
926 | ||||
927 | // R855 protected-stmt -> PROTECTED [::] entity-name-list | |||
928 | TYPE_PARSER(template <> auto Parser<typename decltype(attempt(construct <ProtectedStmt>("PROTECTED" >> maybe("::"_tok) >> listOfNames)))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<ProtectedStmt>("PROTECTED" >> maybe ("::"_tok) >> listOfNames))}; return parser.Parse(state ); } | |||
929 | construct<ProtectedStmt>("PROTECTED" >> maybe("::"_tok) >> listOfNames))template <> auto Parser<typename decltype(attempt(construct <ProtectedStmt>("PROTECTED" >> maybe("::"_tok) >> listOfNames)))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<ProtectedStmt>("PROTECTED" >> maybe ("::"_tok) >> listOfNames))}; return parser.Parse(state ); } | |||
930 | ||||
931 | // R856 save-stmt -> SAVE [[::] saved-entity-list] | |||
932 | TYPE_PARSER(construct<SaveStmt>(template <> auto Parser<typename decltype(attempt(construct <SaveStmt>( "SAVE" >> defaulted(maybe("::"_tok) >> nonemptyList("expected SAVE entities"_err_en_US, Parser<SavedEntity >{})))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<SaveStmt>( "SAVE" >> defaulted(maybe( "::"_tok) >> nonemptyList("expected SAVE entities"_err_en_US , Parser<SavedEntity>{}))))}; return parser.Parse(state ); } | |||
933 | "SAVE" >> defaulted(maybe("::"_tok) >>template <> auto Parser<typename decltype(attempt(construct <SaveStmt>( "SAVE" >> defaulted(maybe("::"_tok) >> nonemptyList("expected SAVE entities"_err_en_US, Parser<SavedEntity >{})))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<SaveStmt>( "SAVE" >> defaulted(maybe( "::"_tok) >> nonemptyList("expected SAVE entities"_err_en_US , Parser<SavedEntity>{}))))}; return parser.Parse(state ); } | |||
934 | nonemptyList("expected SAVE entities"_err_en_US,template <> auto Parser<typename decltype(attempt(construct <SaveStmt>( "SAVE" >> defaulted(maybe("::"_tok) >> nonemptyList("expected SAVE entities"_err_en_US, Parser<SavedEntity >{})))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<SaveStmt>( "SAVE" >> defaulted(maybe( "::"_tok) >> nonemptyList("expected SAVE entities"_err_en_US , Parser<SavedEntity>{}))))}; return parser.Parse(state ); } | |||
935 | Parser<SavedEntity>{}))))template <> auto Parser<typename decltype(attempt(construct <SaveStmt>( "SAVE" >> defaulted(maybe("::"_tok) >> nonemptyList("expected SAVE entities"_err_en_US, Parser<SavedEntity >{})))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<SaveStmt>( "SAVE" >> defaulted(maybe( "::"_tok) >> nonemptyList("expected SAVE entities"_err_en_US , Parser<SavedEntity>{}))))}; return parser.Parse(state ); } | |||
936 | ||||
937 | // R857 saved-entity -> object-name | proc-pointer-name | / common-block-name / | |||
938 | // R858 proc-pointer-name -> name | |||
939 | TYPE_PARSER(construct<SavedEntity>(pure(SavedEntity::Kind::Entity), name) ||template <> auto Parser<typename decltype(attempt(construct <SavedEntity>(pure(SavedEntity::Kind::Entity), name) || construct<SavedEntity>("/" >> pure(SavedEntity:: Kind::Common), name / "/")))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<SavedEntity>(pure(SavedEntity:: Kind::Entity), name) || construct<SavedEntity>("/" >> pure(SavedEntity::Kind::Common), name / "/"))}; return parser .Parse(state); } | |||
940 | construct<SavedEntity>("/" >> pure(SavedEntity::Kind::Common), name / "/"))template <> auto Parser<typename decltype(attempt(construct <SavedEntity>(pure(SavedEntity::Kind::Entity), name) || construct<SavedEntity>("/" >> pure(SavedEntity:: Kind::Common), name / "/")))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<SavedEntity>(pure(SavedEntity:: Kind::Entity), name) || construct<SavedEntity>("/" >> pure(SavedEntity::Kind::Common), name / "/"))}; return parser .Parse(state); } | |||
941 | ||||
942 | // R859 target-stmt -> TARGET [::] target-decl-list | |||
943 | TYPE_PARSER(construct<TargetStmt>("TARGET" >> maybe("::"_tok) >>template <> auto Parser<typename decltype(attempt(construct <TargetStmt>("TARGET" >> maybe("::"_tok) >> nonemptyList("expected objects"_err_en_US, Parser<ObjectDecl >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<TargetStmt>("TARGET" >> maybe("::"_tok ) >> nonemptyList("expected objects"_err_en_US, Parser< ObjectDecl>{})))}; return parser.Parse(state); } | |||
944 | nonemptyList("expected objects"_err_en_US, Parser<ObjectDecl>{})))template <> auto Parser<typename decltype(attempt(construct <TargetStmt>("TARGET" >> maybe("::"_tok) >> nonemptyList("expected objects"_err_en_US, Parser<ObjectDecl >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<TargetStmt>("TARGET" >> maybe("::"_tok ) >> nonemptyList("expected objects"_err_en_US, Parser< ObjectDecl>{})))}; return parser.Parse(state); } | |||
945 | ||||
946 | // R861 value-stmt -> VALUE [::] dummy-arg-name-list | |||
947 | TYPE_PARSER(construct<ValueStmt>("VALUE" >> maybe("::"_tok) >> listOfNames))template <> auto Parser<typename decltype(attempt(construct <ValueStmt>("VALUE" >> maybe("::"_tok) >> listOfNames )))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <ValueStmt>("VALUE" >> maybe("::"_tok) >> listOfNames ))}; return parser.Parse(state); } | |||
948 | ||||
949 | // R862 volatile-stmt -> VOLATILE [::] object-name-list | |||
950 | TYPE_PARSER(construct<VolatileStmt>("VOLATILE" >> maybe("::"_tok) >>template <> auto Parser<typename decltype(attempt(construct <VolatileStmt>("VOLATILE" >> maybe("::"_tok) >> nonemptyList("expected object names"_err_en_US, objectName)) ))::resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(construct< VolatileStmt>("VOLATILE" >> maybe("::"_tok) >> nonemptyList("expected object names"_err_en_US, objectName)) )}; return parser.Parse(state); } | |||
951 | nonemptyList("expected object names"_err_en_US, objectName)))template <> auto Parser<typename decltype(attempt(construct <VolatileStmt>("VOLATILE" >> maybe("::"_tok) >> nonemptyList("expected object names"_err_en_US, objectName)) ))::resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(construct< VolatileStmt>("VOLATILE" >> maybe("::"_tok) >> nonemptyList("expected object names"_err_en_US, objectName)) )}; return parser.Parse(state); } | |||
952 | ||||
953 | // R866 implicit-name-spec -> EXTERNAL | TYPE | |||
954 | constexpr auto implicitNameSpec{ | |||
955 | "EXTERNAL" >> pure(ImplicitStmt::ImplicitNoneNameSpec::External) || | |||
956 | "TYPE" >> pure(ImplicitStmt::ImplicitNoneNameSpec::Type)}; | |||
957 | ||||
958 | // R863 implicit-stmt -> | |||
959 | // IMPLICIT implicit-spec-list | | |||
960 | // IMPLICIT NONE [( [implicit-name-spec-list] )] | |||
961 | TYPE_CONTEXT_PARSER("IMPLICIT statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("IMPLICIT statement"_en_US)), inContext((("IMPLICIT statement"_en_US )), ((construct<ImplicitStmt>( "IMPLICIT" >> nonemptyList ("expected IMPLICIT specifications"_err_en_US, Parser<ImplicitSpec >{})) || construct<ImplicitStmt>("IMPLICIT NONE"_sptok >> defaulted(parenthesized(optionalList(implicitNameSpec ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("IMPLICIT statement"_en_US)), inContext((("IMPLICIT statement"_en_US )), ((construct<ImplicitStmt>( "IMPLICIT" >> nonemptyList ("expected IMPLICIT specifications"_err_en_US, Parser<ImplicitSpec >{})) || construct<ImplicitStmt>("IMPLICIT NONE"_sptok >> defaulted(parenthesized(optionalList(implicitNameSpec )))))))))}; return parser.Parse(state); } | |||
962 | construct<ImplicitStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("IMPLICIT statement"_en_US)), inContext((("IMPLICIT statement"_en_US )), ((construct<ImplicitStmt>( "IMPLICIT" >> nonemptyList ("expected IMPLICIT specifications"_err_en_US, Parser<ImplicitSpec >{})) || construct<ImplicitStmt>("IMPLICIT NONE"_sptok >> defaulted(parenthesized(optionalList(implicitNameSpec ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("IMPLICIT statement"_en_US)), inContext((("IMPLICIT statement"_en_US )), ((construct<ImplicitStmt>( "IMPLICIT" >> nonemptyList ("expected IMPLICIT specifications"_err_en_US, Parser<ImplicitSpec >{})) || construct<ImplicitStmt>("IMPLICIT NONE"_sptok >> defaulted(parenthesized(optionalList(implicitNameSpec )))))))))}; return parser.Parse(state); } | |||
963 | "IMPLICIT" >> nonemptyList("expected IMPLICIT specifications"_err_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("IMPLICIT statement"_en_US)), inContext((("IMPLICIT statement"_en_US )), ((construct<ImplicitStmt>( "IMPLICIT" >> nonemptyList ("expected IMPLICIT specifications"_err_en_US, Parser<ImplicitSpec >{})) || construct<ImplicitStmt>("IMPLICIT NONE"_sptok >> defaulted(parenthesized(optionalList(implicitNameSpec ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("IMPLICIT statement"_en_US)), inContext((("IMPLICIT statement"_en_US )), ((construct<ImplicitStmt>( "IMPLICIT" >> nonemptyList ("expected IMPLICIT specifications"_err_en_US, Parser<ImplicitSpec >{})) || construct<ImplicitStmt>("IMPLICIT NONE"_sptok >> defaulted(parenthesized(optionalList(implicitNameSpec )))))))))}; return parser.Parse(state); } | |||
964 | Parser<ImplicitSpec>{})) ||template <> auto Parser<typename decltype(attempt(instrumented ((("IMPLICIT statement"_en_US)), inContext((("IMPLICIT statement"_en_US )), ((construct<ImplicitStmt>( "IMPLICIT" >> nonemptyList ("expected IMPLICIT specifications"_err_en_US, Parser<ImplicitSpec >{})) || construct<ImplicitStmt>("IMPLICIT NONE"_sptok >> defaulted(parenthesized(optionalList(implicitNameSpec ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("IMPLICIT statement"_en_US)), inContext((("IMPLICIT statement"_en_US )), ((construct<ImplicitStmt>( "IMPLICIT" >> nonemptyList ("expected IMPLICIT specifications"_err_en_US, Parser<ImplicitSpec >{})) || construct<ImplicitStmt>("IMPLICIT NONE"_sptok >> defaulted(parenthesized(optionalList(implicitNameSpec )))))))))}; return parser.Parse(state); } | |||
965 | construct<ImplicitStmt>("IMPLICIT NONE"_sptok >>template <> auto Parser<typename decltype(attempt(instrumented ((("IMPLICIT statement"_en_US)), inContext((("IMPLICIT statement"_en_US )), ((construct<ImplicitStmt>( "IMPLICIT" >> nonemptyList ("expected IMPLICIT specifications"_err_en_US, Parser<ImplicitSpec >{})) || construct<ImplicitStmt>("IMPLICIT NONE"_sptok >> defaulted(parenthesized(optionalList(implicitNameSpec ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("IMPLICIT statement"_en_US)), inContext((("IMPLICIT statement"_en_US )), ((construct<ImplicitStmt>( "IMPLICIT" >> nonemptyList ("expected IMPLICIT specifications"_err_en_US, Parser<ImplicitSpec >{})) || construct<ImplicitStmt>("IMPLICIT NONE"_sptok >> defaulted(parenthesized(optionalList(implicitNameSpec )))))))))}; return parser.Parse(state); } | |||
966 | defaulted(parenthesized(optionalList(implicitNameSpec)))))template <> auto Parser<typename decltype(attempt(instrumented ((("IMPLICIT statement"_en_US)), inContext((("IMPLICIT statement"_en_US )), ((construct<ImplicitStmt>( "IMPLICIT" >> nonemptyList ("expected IMPLICIT specifications"_err_en_US, Parser<ImplicitSpec >{})) || construct<ImplicitStmt>("IMPLICIT NONE"_sptok >> defaulted(parenthesized(optionalList(implicitNameSpec ))))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("IMPLICIT statement"_en_US)), inContext((("IMPLICIT statement"_en_US )), ((construct<ImplicitStmt>( "IMPLICIT" >> nonemptyList ("expected IMPLICIT specifications"_err_en_US, Parser<ImplicitSpec >{})) || construct<ImplicitStmt>("IMPLICIT NONE"_sptok >> defaulted(parenthesized(optionalList(implicitNameSpec )))))))))}; return parser.Parse(state); } | |||
967 | ||||
968 | // R864 implicit-spec -> declaration-type-spec ( letter-spec-list ) | |||
969 | // The variant form of declarationTypeSpec is meant to avoid misrecognition | |||
970 | // of a letter-spec as a simple parenthesized expression for kind or character | |||
971 | // length, e.g., PARAMETER(I=5,N=1); IMPLICIT REAL(I-N)(O-Z) vs. | |||
972 | // IMPLICIT REAL(I-N). The variant form needs to attempt to reparse only | |||
973 | // types with optional parenthesized kind/length expressions, so derived | |||
974 | // type specs, DOUBLE PRECISION, and DOUBLE COMPLEX need not be considered. | |||
975 | constexpr auto noKindSelector{construct<std::optional<KindSelector>>()}; | |||
976 | constexpr auto implicitSpecDeclarationTypeSpecRetry{ | |||
977 | construct<DeclarationTypeSpec>(first( | |||
978 | construct<IntrinsicTypeSpec>( | |||
979 | construct<IntegerTypeSpec>("INTEGER" >> noKindSelector)), | |||
980 | construct<IntrinsicTypeSpec>( | |||
981 | construct<IntrinsicTypeSpec::Real>("REAL" >> noKindSelector)), | |||
982 | construct<IntrinsicTypeSpec>( | |||
983 | construct<IntrinsicTypeSpec::Complex>("COMPLEX" >> noKindSelector)), | |||
984 | construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Character>( | |||
985 | "CHARACTER" >> construct<std::optional<CharSelector>>())), | |||
986 | construct<IntrinsicTypeSpec>(construct<IntrinsicTypeSpec::Logical>( | |||
987 | "LOGICAL" >> noKindSelector))))}; | |||
988 | ||||
989 | TYPE_PARSER(construct<ImplicitSpec>(declarationTypeSpec,template <> auto Parser<typename decltype(attempt(construct <ImplicitSpec>(declarationTypeSpec, parenthesized(nonemptyList (Parser<LetterSpec>{}))) || construct<ImplicitSpec> (implicitSpecDeclarationTypeSpecRetry, parenthesized(nonemptyList (Parser<LetterSpec>{})))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<ImplicitSpec>(declarationTypeSpec , parenthesized(nonemptyList(Parser<LetterSpec>{}))) || construct<ImplicitSpec>(implicitSpecDeclarationTypeSpecRetry , parenthesized(nonemptyList(Parser<LetterSpec>{}))))}; return parser.Parse(state); } | |||
990 | parenthesized(nonemptyList(Parser<LetterSpec>{}))) ||template <> auto Parser<typename decltype(attempt(construct <ImplicitSpec>(declarationTypeSpec, parenthesized(nonemptyList (Parser<LetterSpec>{}))) || construct<ImplicitSpec> (implicitSpecDeclarationTypeSpecRetry, parenthesized(nonemptyList (Parser<LetterSpec>{})))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<ImplicitSpec>(declarationTypeSpec , parenthesized(nonemptyList(Parser<LetterSpec>{}))) || construct<ImplicitSpec>(implicitSpecDeclarationTypeSpecRetry , parenthesized(nonemptyList(Parser<LetterSpec>{}))))}; return parser.Parse(state); } | |||
991 | construct<ImplicitSpec>(implicitSpecDeclarationTypeSpecRetry,template <> auto Parser<typename decltype(attempt(construct <ImplicitSpec>(declarationTypeSpec, parenthesized(nonemptyList (Parser<LetterSpec>{}))) || construct<ImplicitSpec> (implicitSpecDeclarationTypeSpecRetry, parenthesized(nonemptyList (Parser<LetterSpec>{})))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<ImplicitSpec>(declarationTypeSpec , parenthesized(nonemptyList(Parser<LetterSpec>{}))) || construct<ImplicitSpec>(implicitSpecDeclarationTypeSpecRetry , parenthesized(nonemptyList(Parser<LetterSpec>{}))))}; return parser.Parse(state); } | |||
992 | parenthesized(nonemptyList(Parser<LetterSpec>{}))))template <> auto Parser<typename decltype(attempt(construct <ImplicitSpec>(declarationTypeSpec, parenthesized(nonemptyList (Parser<LetterSpec>{}))) || construct<ImplicitSpec> (implicitSpecDeclarationTypeSpecRetry, parenthesized(nonemptyList (Parser<LetterSpec>{})))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<ImplicitSpec>(declarationTypeSpec , parenthesized(nonemptyList(Parser<LetterSpec>{}))) || construct<ImplicitSpec>(implicitSpecDeclarationTypeSpecRetry , parenthesized(nonemptyList(Parser<LetterSpec>{}))))}; return parser.Parse(state); } | |||
993 | ||||
994 | // R865 letter-spec -> letter [- letter] | |||
995 | TYPE_PARSER(space >> (construct<LetterSpec>(letter, maybe("-" >> letter)) ||template <> auto Parser<typename decltype(attempt(space >> (construct<LetterSpec>(letter, maybe("-" >> letter)) || construct<LetterSpec>(otherIdChar, construct <std::optional<const char *>>()))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(space >> (construct <LetterSpec>(letter, maybe("-" >> letter)) || construct <LetterSpec>(otherIdChar, construct<std::optional< const char *>>())))}; return parser.Parse(state); } | |||
996 | construct<LetterSpec>(otherIdChar,template <> auto Parser<typename decltype(attempt(space >> (construct<LetterSpec>(letter, maybe("-" >> letter)) || construct<LetterSpec>(otherIdChar, construct <std::optional<const char *>>()))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(space >> (construct <LetterSpec>(letter, maybe("-" >> letter)) || construct <LetterSpec>(otherIdChar, construct<std::optional< const char *>>())))}; return parser.Parse(state); } | |||
997 | construct<std::optional<const char *>>())))template <> auto Parser<typename decltype(attempt(space >> (construct<LetterSpec>(letter, maybe("-" >> letter)) || construct<LetterSpec>(otherIdChar, construct <std::optional<const char *>>()))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(space >> (construct <LetterSpec>(letter, maybe("-" >> letter)) || construct <LetterSpec>(otherIdChar, construct<std::optional< const char *>>())))}; return parser.Parse(state); } | |||
998 | ||||
999 | // R867 import-stmt -> | |||
1000 | // IMPORT [[::] import-name-list] | | |||
1001 | // IMPORT , ONLY : import-name-list | IMPORT , NONE | IMPORT , ALL | |||
1002 | TYPE_CONTEXT_PARSER("IMPORT statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name )))))))}; return parser.Parse(state); } | |||
1003 | construct<ImportStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name )))))))}; return parser.Parse(state); } | |||
1004 | "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) ||template <> auto Parser<typename decltype(attempt(instrumented ((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name )))))))}; return parser.Parse(state); } | |||
1005 | construct<ImportStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name )))))))}; return parser.Parse(state); } | |||
1006 | "IMPORT , NONE" >> pure(common::ImportKind::None)) ||template <> auto Parser<typename decltype(attempt(instrumented ((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name )))))))}; return parser.Parse(state); } | |||
1007 | construct<ImportStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name )))))))}; return parser.Parse(state); } | |||
1008 | "IMPORT , ALL" >> pure(common::ImportKind::All)) ||template <> auto Parser<typename decltype(attempt(instrumented ((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name )))))))}; return parser.Parse(state); } | |||
1009 | construct<ImportStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name )))))))}; return parser.Parse(state); } | |||
1010 | "IMPORT" >> maybe("::"_tok) >> optionalList(name)))template <> auto Parser<typename decltype(attempt(instrumented ((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("IMPORT statement"_en_US)), inContext((("IMPORT statement"_en_US )), ((construct<ImportStmt>( "IMPORT , ONLY :" >> pure(common::ImportKind::Only), listOfNames) || construct< ImportStmt>( "IMPORT , NONE" >> pure(common::ImportKind ::None)) || construct<ImportStmt>( "IMPORT , ALL" >> pure(common::ImportKind::All)) || construct<ImportStmt> ( "IMPORT" >> maybe("::"_tok) >> optionalList(name )))))))}; return parser.Parse(state); } | |||
1011 | ||||
1012 | // R868 namelist-stmt -> | |||
1013 | // NAMELIST / namelist-group-name / namelist-group-object-list | |||
1014 | // [[,] / namelist-group-name / namelist-group-object-list]... | |||
1015 | // R869 namelist-group-object -> variable-name | |||
1016 | TYPE_PARSER(construct<NamelistStmt>("NAMELIST" >>template <> auto Parser<typename decltype(attempt(construct <NamelistStmt>("NAMELIST" >> nonemptySeparated( construct <NamelistStmt::Group>("/" >> name / "/", listOfNames ), maybe(","_tok)))))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<NamelistStmt>("NAMELIST" >> nonemptySeparated( construct<NamelistStmt::Group>("/" >> name / "/", listOfNames), maybe(","_tok))))}; return parser. Parse(state); } | |||
1017 | nonemptySeparated(template <> auto Parser<typename decltype(attempt(construct <NamelistStmt>("NAMELIST" >> nonemptySeparated( construct <NamelistStmt::Group>("/" >> name / "/", listOfNames ), maybe(","_tok)))))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<NamelistStmt>("NAMELIST" >> nonemptySeparated( construct<NamelistStmt::Group>("/" >> name / "/", listOfNames), maybe(","_tok))))}; return parser. Parse(state); } | |||
1018 | construct<NamelistStmt::Group>("/" >> name / "/", listOfNames),template <> auto Parser<typename decltype(attempt(construct <NamelistStmt>("NAMELIST" >> nonemptySeparated( construct <NamelistStmt::Group>("/" >> name / "/", listOfNames ), maybe(","_tok)))))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<NamelistStmt>("NAMELIST" >> nonemptySeparated( construct<NamelistStmt::Group>("/" >> name / "/", listOfNames), maybe(","_tok))))}; return parser. Parse(state); } | |||
1019 | maybe(","_tok))))template <> auto Parser<typename decltype(attempt(construct <NamelistStmt>("NAMELIST" >> nonemptySeparated( construct <NamelistStmt::Group>("/" >> name / "/", listOfNames ), maybe(","_tok)))))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<NamelistStmt>("NAMELIST" >> nonemptySeparated( construct<NamelistStmt::Group>("/" >> name / "/", listOfNames), maybe(","_tok))))}; return parser. Parse(state); } | |||
1020 | ||||
1021 | // R870 equivalence-stmt -> EQUIVALENCE equivalence-set-list | |||
1022 | // R871 equivalence-set -> ( equivalence-object , equivalence-object-list ) | |||
1023 | TYPE_PARSER(construct<EquivalenceStmt>("EQUIVALENCE" >>template <> auto Parser<typename decltype(attempt(construct <EquivalenceStmt>("EQUIVALENCE" >> nonemptyList( parenthesized (nonemptyList("expected EQUIVALENCE objects"_err_en_US, Parser <EquivalenceObject>{}))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<EquivalenceStmt>("EQUIVALENCE" >> nonemptyList( parenthesized(nonemptyList("expected EQUIVALENCE objects"_err_en_US , Parser<EquivalenceObject>{})))))}; return parser.Parse (state); } | |||
1024 | nonemptyList(template <> auto Parser<typename decltype(attempt(construct <EquivalenceStmt>("EQUIVALENCE" >> nonemptyList( parenthesized (nonemptyList("expected EQUIVALENCE objects"_err_en_US, Parser <EquivalenceObject>{}))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<EquivalenceStmt>("EQUIVALENCE" >> nonemptyList( parenthesized(nonemptyList("expected EQUIVALENCE objects"_err_en_US , Parser<EquivalenceObject>{})))))}; return parser.Parse (state); } | |||
1025 | parenthesized(nonemptyList("expected EQUIVALENCE objects"_err_en_US,template <> auto Parser<typename decltype(attempt(construct <EquivalenceStmt>("EQUIVALENCE" >> nonemptyList( parenthesized (nonemptyList("expected EQUIVALENCE objects"_err_en_US, Parser <EquivalenceObject>{}))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<EquivalenceStmt>("EQUIVALENCE" >> nonemptyList( parenthesized(nonemptyList("expected EQUIVALENCE objects"_err_en_US , Parser<EquivalenceObject>{})))))}; return parser.Parse (state); } | |||
1026 | Parser<EquivalenceObject>{})))))template <> auto Parser<typename decltype(attempt(construct <EquivalenceStmt>("EQUIVALENCE" >> nonemptyList( parenthesized (nonemptyList("expected EQUIVALENCE objects"_err_en_US, Parser <EquivalenceObject>{}))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<EquivalenceStmt>("EQUIVALENCE" >> nonemptyList( parenthesized(nonemptyList("expected EQUIVALENCE objects"_err_en_US , Parser<EquivalenceObject>{})))))}; return parser.Parse (state); } | |||
1027 | ||||
1028 | // R872 equivalence-object -> variable-name | array-element | substring | |||
1029 | TYPE_PARSER(construct<EquivalenceObject>(indirect(designator)))template <> auto Parser<typename decltype(attempt(construct <EquivalenceObject>(indirect(designator))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<EquivalenceObject >(indirect(designator)))}; return parser.Parse(state); } | |||
1030 | ||||
1031 | // R873 common-stmt -> | |||
1032 | // COMMON [/ [common-block-name] /] common-block-object-list | |||
1033 | // [[,] / [common-block-name] / common-block-object-list]... | |||
1034 | TYPE_PARSER(template <> auto Parser<typename decltype(attempt(construct <CommonStmt>("COMMON" >> defaulted("/" >> maybe (name) / "/"), nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{}), many(maybe(","_tok) >> construct<CommonStmt::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject>{}))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CommonStmt>( "COMMON" >> defaulted("/" >> maybe(name) / "/"), nonemptyList ("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject >{}), many(maybe(","_tok) >> construct<CommonStmt ::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{})))))}; return parser.Parse (state); } | |||
1035 | construct<CommonStmt>("COMMON" >> defaulted("/" >> maybe(name) / "/"),template <> auto Parser<typename decltype(attempt(construct <CommonStmt>("COMMON" >> defaulted("/" >> maybe (name) / "/"), nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{}), many(maybe(","_tok) >> construct<CommonStmt::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject>{}))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CommonStmt>( "COMMON" >> defaulted("/" >> maybe(name) / "/"), nonemptyList ("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject >{}), many(maybe(","_tok) >> construct<CommonStmt ::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{})))))}; return parser.Parse (state); } | |||
1036 | nonemptyList("expected COMMON block objects"_err_en_US,template <> auto Parser<typename decltype(attempt(construct <CommonStmt>("COMMON" >> defaulted("/" >> maybe (name) / "/"), nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{}), many(maybe(","_tok) >> construct<CommonStmt::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject>{}))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CommonStmt>( "COMMON" >> defaulted("/" >> maybe(name) / "/"), nonemptyList ("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject >{}), many(maybe(","_tok) >> construct<CommonStmt ::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{})))))}; return parser.Parse (state); } | |||
1037 | Parser<CommonBlockObject>{}),template <> auto Parser<typename decltype(attempt(construct <CommonStmt>("COMMON" >> defaulted("/" >> maybe (name) / "/"), nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{}), many(maybe(","_tok) >> construct<CommonStmt::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject>{}))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CommonStmt>( "COMMON" >> defaulted("/" >> maybe(name) / "/"), nonemptyList ("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject >{}), many(maybe(","_tok) >> construct<CommonStmt ::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{})))))}; return parser.Parse (state); } | |||
1038 | many(maybe(","_tok) >>template <> auto Parser<typename decltype(attempt(construct <CommonStmt>("COMMON" >> defaulted("/" >> maybe (name) / "/"), nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{}), many(maybe(","_tok) >> construct<CommonStmt::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject>{}))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CommonStmt>( "COMMON" >> defaulted("/" >> maybe(name) / "/"), nonemptyList ("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject >{}), many(maybe(","_tok) >> construct<CommonStmt ::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{})))))}; return parser.Parse (state); } | |||
1039 | construct<CommonStmt::Block>("/" >> maybe(name) / "/",template <> auto Parser<typename decltype(attempt(construct <CommonStmt>("COMMON" >> defaulted("/" >> maybe (name) / "/"), nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{}), many(maybe(","_tok) >> construct<CommonStmt::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject>{}))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CommonStmt>( "COMMON" >> defaulted("/" >> maybe(name) / "/"), nonemptyList ("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject >{}), many(maybe(","_tok) >> construct<CommonStmt ::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{})))))}; return parser.Parse (state); } | |||
1040 | nonemptyList("expected COMMON block objects"_err_en_US,template <> auto Parser<typename decltype(attempt(construct <CommonStmt>("COMMON" >> defaulted("/" >> maybe (name) / "/"), nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{}), many(maybe(","_tok) >> construct<CommonStmt::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject>{}))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CommonStmt>( "COMMON" >> defaulted("/" >> maybe(name) / "/"), nonemptyList ("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject >{}), many(maybe(","_tok) >> construct<CommonStmt ::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{})))))}; return parser.Parse (state); } | |||
1041 | Parser<CommonBlockObject>{})))))template <> auto Parser<typename decltype(attempt(construct <CommonStmt>("COMMON" >> defaulted("/" >> maybe (name) / "/"), nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{}), many(maybe(","_tok) >> construct<CommonStmt::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject>{}))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CommonStmt>( "COMMON" >> defaulted("/" >> maybe(name) / "/"), nonemptyList ("expected COMMON block objects"_err_en_US, Parser<CommonBlockObject >{}), many(maybe(","_tok) >> construct<CommonStmt ::Block>("/" >> maybe(name) / "/", nonemptyList("expected COMMON block objects"_err_en_US , Parser<CommonBlockObject>{})))))}; return parser.Parse (state); } | |||
1042 | ||||
1043 | // R874 common-block-object -> variable-name [( array-spec )] | |||
1044 | TYPE_PARSER(construct<CommonBlockObject>(name, maybe(arraySpec)))template <> auto Parser<typename decltype(attempt(construct <CommonBlockObject>(name, maybe(arraySpec))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<CommonBlockObject >(name, maybe(arraySpec)))}; return parser.Parse(state); } | |||
1045 | ||||
1046 | // R901 designator -> object-name | array-element | array-section | | |||
1047 | // coindexed-named-object | complex-part-designator | | |||
1048 | // structure-component | substring | |||
1049 | // The Standard's productions for designator and its alternatives are | |||
1050 | // ambiguous without recourse to a symbol table. Many of the alternatives | |||
1051 | // for designator (viz., array-element, coindexed-named-object, | |||
1052 | // and structure-component) are all syntactically just data-ref. | |||
1053 | // What designator boils down to is this: | |||
1054 | // It starts with either a name or a character literal. | |||
1055 | // If it starts with a character literal, it must be a substring. | |||
1056 | // If it starts with a name, it's a sequence of %-separated parts; | |||
1057 | // each part is a name, maybe a (section-subscript-list), and | |||
1058 | // maybe an [image-selector]. | |||
1059 | // If it's a substring, it ends with (substring-range). | |||
1060 | TYPE_CONTEXT_PARSER("designator"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("designator"_en_US)), inContext((("designator"_en_US)), (( sourced(construct<Designator>(substring) || construct< Designator>(dataRef))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("designator"_en_US)), inContext( (("designator"_en_US)), ((sourced(construct<Designator> (substring) || construct<Designator>(dataRef)))))))}; return parser.Parse(state); } | |||
1061 | sourced(construct<Designator>(substring) || construct<Designator>(dataRef)))template <> auto Parser<typename decltype(attempt(instrumented ((("designator"_en_US)), inContext((("designator"_en_US)), (( sourced(construct<Designator>(substring) || construct< Designator>(dataRef))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("designator"_en_US)), inContext( (("designator"_en_US)), ((sourced(construct<Designator> (substring) || construct<Designator>(dataRef)))))))}; return parser.Parse(state); } | |||
1062 | ||||
1063 | constexpr auto percentOrDot{"%"_tok || | |||
1064 | // legacy VAX extension for RECORD field access | |||
1065 | extension<LanguageFeature::DECStructures>( | |||
1066 | "nonstandard usage: component access with '.' in place of '%'"_port_en_US, | |||
1067 | "."_tok / lookAhead(OldStructureComponentName{}))}; | |||
1068 | ||||
1069 | // R902 variable -> designator | function-reference | |||
1070 | // This production appears to be left-recursive in the grammar via | |||
1071 | // function-reference -> procedure-designator -> proc-component-ref -> | |||
1072 | // scalar-variable | |||
1073 | // and would be so if we were to allow functions to be called via procedure | |||
1074 | // pointer components within derived type results of other function references | |||
1075 | // (a reasonable extension, esp. in the case of procedure pointer components | |||
1076 | // that are NOPASS). However, Fortran constrains the use of a variable in a | |||
1077 | // proc-component-ref to be a data-ref without coindices (C1027). | |||
1078 | // Some array element references will be misrecognized as function references. | |||
1079 | constexpr auto noMoreAddressing{!"("_tok >> !"["_tok >> !percentOrDot}; | |||
1080 | TYPE_CONTEXT_PARSER("variable"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("variable"_en_US)), inContext((("variable"_en_US)), ((construct <Variable>(indirect(functionReference / noMoreAddressing )) || construct<Variable>(indirect(designator)))))))):: resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(instrumented ((("variable"_en_US)), inContext((("variable"_en_US)), ((construct <Variable>(indirect(functionReference / noMoreAddressing )) || construct<Variable>(indirect(designator)))))))}; return parser.Parse(state); } | |||
1081 | construct<Variable>(indirect(functionReference / noMoreAddressing)) ||template <> auto Parser<typename decltype(attempt(instrumented ((("variable"_en_US)), inContext((("variable"_en_US)), ((construct <Variable>(indirect(functionReference / noMoreAddressing )) || construct<Variable>(indirect(designator)))))))):: resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(instrumented ((("variable"_en_US)), inContext((("variable"_en_US)), ((construct <Variable>(indirect(functionReference / noMoreAddressing )) || construct<Variable>(indirect(designator)))))))}; return parser.Parse(state); } | |||
1082 | construct<Variable>(indirect(designator)))template <> auto Parser<typename decltype(attempt(instrumented ((("variable"_en_US)), inContext((("variable"_en_US)), ((construct <Variable>(indirect(functionReference / noMoreAddressing )) || construct<Variable>(indirect(designator)))))))):: resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(instrumented ((("variable"_en_US)), inContext((("variable"_en_US)), ((construct <Variable>(indirect(functionReference / noMoreAddressing )) || construct<Variable>(indirect(designator)))))))}; return parser.Parse(state); } | |||
1083 | ||||
1084 | // R908 substring -> parent-string ( substring-range ) | |||
1085 | // R909 parent-string -> | |||
1086 | // scalar-variable-name | array-element | coindexed-named-object | | |||
1087 | // scalar-structure-component | scalar-char-literal-constant | | |||
1088 | // scalar-named-constant | |||
1089 | TYPE_PARSER(template <> auto Parser<typename decltype(attempt(construct <Substring>(dataRef, parenthesized(Parser<SubstringRange >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<Substring>(dataRef, parenthesized(Parser< SubstringRange>{})))}; return parser.Parse(state); } | |||
1090 | construct<Substring>(dataRef, parenthesized(Parser<SubstringRange>{})))template <> auto Parser<typename decltype(attempt(construct <Substring>(dataRef, parenthesized(Parser<SubstringRange >{}))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<Substring>(dataRef, parenthesized(Parser< SubstringRange>{})))}; return parser.Parse(state); } | |||
1091 | ||||
1092 | TYPE_PARSER(construct<CharLiteralConstantSubstring>(template <> auto Parser<typename decltype(attempt(construct <CharLiteralConstantSubstring>( charLiteralConstant, parenthesized (Parser<SubstringRange>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CharLiteralConstantSubstring>( charLiteralConstant , parenthesized(Parser<SubstringRange>{})))}; return parser .Parse(state); } | |||
1093 | charLiteralConstant, parenthesized(Parser<SubstringRange>{})))template <> auto Parser<typename decltype(attempt(construct <CharLiteralConstantSubstring>( charLiteralConstant, parenthesized (Parser<SubstringRange>{}))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<CharLiteralConstantSubstring>( charLiteralConstant , parenthesized(Parser<SubstringRange>{})))}; return parser .Parse(state); } | |||
1094 | ||||
1095 | TYPE_PARSER(sourced(construct<SubstringInquiry>(Parser<Substring>{}) /template <> auto Parser<typename decltype(attempt(sourced (construct<SubstringInquiry>(Parser<Substring>{}) / ("%LEN"_tok || "%KIND"_tok))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(sourced(construct<SubstringInquiry>(Parser <Substring>{}) / ("%LEN"_tok || "%KIND"_tok)))}; return parser.Parse(state); } | |||
1096 | ("%LEN"_tok || "%KIND"_tok)))template <> auto Parser<typename decltype(attempt(sourced (construct<SubstringInquiry>(Parser<Substring>{}) / ("%LEN"_tok || "%KIND"_tok))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(sourced(construct<SubstringInquiry>(Parser <Substring>{}) / ("%LEN"_tok || "%KIND"_tok)))}; return parser.Parse(state); } | |||
1097 | ||||
1098 | // R910 substring-range -> [scalar-int-expr] : [scalar-int-expr] | |||
1099 | TYPE_PARSER(construct<SubstringRange>(template <> auto Parser<typename decltype(attempt(construct <SubstringRange>( maybe(scalarIntExpr), ":" >> maybe (scalarIntExpr))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<SubstringRange>( maybe(scalarIntExpr ), ":" >> maybe(scalarIntExpr)))}; return parser.Parse( state); } | |||
1100 | maybe(scalarIntExpr), ":" >> maybe(scalarIntExpr)))template <> auto Parser<typename decltype(attempt(construct <SubstringRange>( maybe(scalarIntExpr), ":" >> maybe (scalarIntExpr))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(construct<SubstringRange>( maybe(scalarIntExpr ), ":" >> maybe(scalarIntExpr)))}; return parser.Parse( state); } | |||
1101 | ||||
1102 | // R911 data-ref -> part-ref [% part-ref]... | |||
1103 | // R914 coindexed-named-object -> data-ref | |||
1104 | // R917 array-element -> data-ref | |||
1105 | TYPE_PARSER(template <> auto Parser<typename decltype(attempt(construct <DataRef>(nonemptySeparated(Parser<PartRef>{}, percentOrDot ))))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <DataRef>(nonemptySeparated(Parser<PartRef>{}, percentOrDot )))}; return parser.Parse(state); } | |||
1106 | construct<DataRef>(nonemptySeparated(Parser<PartRef>{}, percentOrDot)))template <> auto Parser<typename decltype(attempt(construct <DataRef>(nonemptySeparated(Parser<PartRef>{}, percentOrDot ))))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <DataRef>(nonemptySeparated(Parser<PartRef>{}, percentOrDot )))}; return parser.Parse(state); } | |||
1107 | ||||
1108 | // R912 part-ref -> part-name [( section-subscript-list )] [image-selector] | |||
1109 | TYPE_PARSER(construct<PartRef>(name,template <> auto Parser<typename decltype(attempt(construct <PartRef>(name, defaulted( parenthesized(nonemptyList(Parser <SectionSubscript>{})) / !"=>"_tok), maybe(Parser< ImageSelector>{}))))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<PartRef>(name, defaulted( parenthesized (nonemptyList(Parser<SectionSubscript>{})) / !"=>"_tok ), maybe(Parser<ImageSelector>{})))}; return parser.Parse (state); } | |||
1110 | defaulted(template <> auto Parser<typename decltype(attempt(construct <PartRef>(name, defaulted( parenthesized(nonemptyList(Parser <SectionSubscript>{})) / !"=>"_tok), maybe(Parser< ImageSelector>{}))))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<PartRef>(name, defaulted( parenthesized (nonemptyList(Parser<SectionSubscript>{})) / !"=>"_tok ), maybe(Parser<ImageSelector>{})))}; return parser.Parse (state); } | |||
1111 | parenthesized(nonemptyList(Parser<SectionSubscript>{})) / !"=>"_tok),template <> auto Parser<typename decltype(attempt(construct <PartRef>(name, defaulted( parenthesized(nonemptyList(Parser <SectionSubscript>{})) / !"=>"_tok), maybe(Parser< ImageSelector>{}))))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<PartRef>(name, defaulted( parenthesized (nonemptyList(Parser<SectionSubscript>{})) / !"=>"_tok ), maybe(Parser<ImageSelector>{})))}; return parser.Parse (state); } | |||
1112 | maybe(Parser<ImageSelector>{})))template <> auto Parser<typename decltype(attempt(construct <PartRef>(name, defaulted( parenthesized(nonemptyList(Parser <SectionSubscript>{})) / !"=>"_tok), maybe(Parser< ImageSelector>{}))))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<PartRef>(name, defaulted( parenthesized (nonemptyList(Parser<SectionSubscript>{})) / !"=>"_tok ), maybe(Parser<ImageSelector>{})))}; return parser.Parse (state); } | |||
1113 | ||||
1114 | // R913 structure-component -> data-ref | |||
1115 | // The final part-ref in the data-ref is not allowed to have subscripts. | |||
1116 | TYPE_PARSER(construct<StructureComponent>(template <> auto Parser<typename decltype(attempt(construct <StructureComponent>( construct<DataRef>(some(Parser <PartRef>{} / percentOrDot)), name)))::resultType>:: Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<StructureComponent >( construct<DataRef>(some(Parser<PartRef>{} / percentOrDot)), name))}; return parser.Parse(state); } | |||
1117 | construct<DataRef>(some(Parser<PartRef>{} / percentOrDot)), name))template <> auto Parser<typename decltype(attempt(construct <StructureComponent>( construct<DataRef>(some(Parser <PartRef>{} / percentOrDot)), name)))::resultType>:: Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<StructureComponent >( construct<DataRef>(some(Parser<PartRef>{} / percentOrDot)), name))}; return parser.Parse(state); } | |||
1118 | ||||
1119 | // R919 subscript -> scalar-int-expr | |||
1120 | constexpr auto subscript{scalarIntExpr}; | |||
1121 | ||||
1122 | // R920 section-subscript -> subscript | subscript-triplet | vector-subscript | |||
1123 | // R923 vector-subscript -> int-expr | |||
1124 | // N.B. The distinction that needs to be made between "subscript" and | |||
1125 | // "vector-subscript" is deferred to semantic analysis. | |||
1126 | TYPE_PARSER(construct<SectionSubscript>(Parser<SubscriptTriplet>{}) ||template <> auto Parser<typename decltype(attempt(construct <SectionSubscript>(Parser<SubscriptTriplet>{}) || construct<SectionSubscript>(intExpr)))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<SectionSubscript >(Parser<SubscriptTriplet>{}) || construct<SectionSubscript >(intExpr))}; return parser.Parse(state); } | |||
1127 | construct<SectionSubscript>(intExpr))template <> auto Parser<typename decltype(attempt(construct <SectionSubscript>(Parser<SubscriptTriplet>{}) || construct<SectionSubscript>(intExpr)))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<SectionSubscript >(Parser<SubscriptTriplet>{}) || construct<SectionSubscript >(intExpr))}; return parser.Parse(state); } | |||
1128 | ||||
1129 | // R921 subscript-triplet -> [subscript] : [subscript] [: stride] | |||
1130 | TYPE_PARSER(construct<SubscriptTriplet>(template <> auto Parser<typename decltype(attempt(construct <SubscriptTriplet>( maybe(subscript), ":" >> maybe (subscript), maybe(":" >> subscript))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<SubscriptTriplet >( maybe(subscript), ":" >> maybe(subscript), maybe( ":" >> subscript)))}; return parser.Parse(state); } | |||
1131 | maybe(subscript), ":" >> maybe(subscript), maybe(":" >> subscript)))template <> auto Parser<typename decltype(attempt(construct <SubscriptTriplet>( maybe(subscript), ":" >> maybe (subscript), maybe(":" >> subscript))))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<SubscriptTriplet >( maybe(subscript), ":" >> maybe(subscript), maybe( ":" >> subscript)))}; return parser.Parse(state); } | |||
1132 | ||||
1133 | // R925 cosubscript -> scalar-int-expr | |||
1134 | constexpr auto cosubscript{scalarIntExpr}; | |||
1135 | ||||
1136 | // R924 image-selector -> | |||
1137 | // lbracket cosubscript-list [, image-selector-spec-list] rbracket | |||
1138 | TYPE_CONTEXT_PARSER("image selector"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("image selector"_en_US)), inContext((("image selector"_en_US )), ((construct<ImageSelector>( "[" >> nonemptyList (cosubscript / lookAhead(space / ",]"_ch)), defaulted("," >> nonemptyList(Parser<ImageSelectorSpec>{})) / "]")))))) )::resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(instrumented ((("image selector"_en_US)), inContext((("image selector"_en_US )), ((construct<ImageSelector>( "[" >> nonemptyList (cosubscript / lookAhead(space / ",]"_ch)), defaulted("," >> nonemptyList(Parser<ImageSelectorSpec>{})) / "]")))))) }; return parser.Parse(state); } | |||
1139 | construct<ImageSelector>(template <> auto Parser<typename decltype(attempt(instrumented ((("image selector"_en_US)), inContext((("image selector"_en_US )), ((construct<ImageSelector>( "[" >> nonemptyList (cosubscript / lookAhead(space / ",]"_ch)), defaulted("," >> nonemptyList(Parser<ImageSelectorSpec>{})) / "]")))))) )::resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(instrumented ((("image selector"_en_US)), inContext((("image selector"_en_US )), ((construct<ImageSelector>( "[" >> nonemptyList (cosubscript / lookAhead(space / ",]"_ch)), defaulted("," >> nonemptyList(Parser<ImageSelectorSpec>{})) / "]")))))) }; return parser.Parse(state); } | |||
1140 | "[" >> nonemptyList(cosubscript / lookAhead(space / ",]"_ch)),template <> auto Parser<typename decltype(attempt(instrumented ((("image selector"_en_US)), inContext((("image selector"_en_US )), ((construct<ImageSelector>( "[" >> nonemptyList (cosubscript / lookAhead(space / ",]"_ch)), defaulted("," >> nonemptyList(Parser<ImageSelectorSpec>{})) / "]")))))) )::resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(instrumented ((("image selector"_en_US)), inContext((("image selector"_en_US )), ((construct<ImageSelector>( "[" >> nonemptyList (cosubscript / lookAhead(space / ",]"_ch)), defaulted("," >> nonemptyList(Parser<ImageSelectorSpec>{})) / "]")))))) }; return parser.Parse(state); } | |||
1141 | defaulted("," >> nonemptyList(Parser<ImageSelectorSpec>{})) / "]"))template <> auto Parser<typename decltype(attempt(instrumented ((("image selector"_en_US)), inContext((("image selector"_en_US )), ((construct<ImageSelector>( "[" >> nonemptyList (cosubscript / lookAhead(space / ",]"_ch)), defaulted("," >> nonemptyList(Parser<ImageSelectorSpec>{})) / "]")))))) )::resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(instrumented ((("image selector"_en_US)), inContext((("image selector"_en_US )), ((construct<ImageSelector>( "[" >> nonemptyList (cosubscript / lookAhead(space / ",]"_ch)), defaulted("," >> nonemptyList(Parser<ImageSelectorSpec>{})) / "]")))))) }; return parser.Parse(state); } | |||
1142 | ||||
1143 | // R926 image-selector-spec -> | |||
1144 | // STAT = stat-variable | TEAM = team-value | | |||
1145 | // TEAM_NUMBER = scalar-int-expr | |||
1146 | TYPE_PARSER(construct<ImageSelectorSpec>(construct<ImageSelectorSpec::Stat>(template <> auto Parser<typename decltype(attempt(construct <ImageSelectorSpec>(construct<ImageSelectorSpec::Stat >( "STAT =" >> scalar(integer(indirect(variable))))) || construct<ImageSelectorSpec>(construct<TeamValue >("TEAM =" >> teamValue)) || construct<ImageSelectorSpec >(construct<ImageSelectorSpec::Team_Number>( "TEAM_NUMBER =" >> scalarIntExpr))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<ImageSelectorSpec>(construct< ImageSelectorSpec::Stat>( "STAT =" >> scalar(integer (indirect(variable))))) || construct<ImageSelectorSpec> (construct<TeamValue>("TEAM =" >> teamValue)) || construct <ImageSelectorSpec>(construct<ImageSelectorSpec::Team_Number >( "TEAM_NUMBER =" >> scalarIntExpr)))}; return parser .Parse(state); } | |||
1147 | "STAT =" >> scalar(integer(indirect(variable))))) ||template <> auto Parser<typename decltype(attempt(construct <ImageSelectorSpec>(construct<ImageSelectorSpec::Stat >( "STAT =" >> scalar(integer(indirect(variable))))) || construct<ImageSelectorSpec>(construct<TeamValue >("TEAM =" >> teamValue)) || construct<ImageSelectorSpec >(construct<ImageSelectorSpec::Team_Number>( "TEAM_NUMBER =" >> scalarIntExpr))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<ImageSelectorSpec>(construct< ImageSelectorSpec::Stat>( "STAT =" >> scalar(integer (indirect(variable))))) || construct<ImageSelectorSpec> (construct<TeamValue>("TEAM =" >> teamValue)) || construct <ImageSelectorSpec>(construct<ImageSelectorSpec::Team_Number >( "TEAM_NUMBER =" >> scalarIntExpr)))}; return parser .Parse(state); } | |||
1148 | construct<ImageSelectorSpec>(construct<TeamValue>("TEAM =" >> teamValue)) ||template <> auto Parser<typename decltype(attempt(construct <ImageSelectorSpec>(construct<ImageSelectorSpec::Stat >( "STAT =" >> scalar(integer(indirect(variable))))) || construct<ImageSelectorSpec>(construct<TeamValue >("TEAM =" >> teamValue)) || construct<ImageSelectorSpec >(construct<ImageSelectorSpec::Team_Number>( "TEAM_NUMBER =" >> scalarIntExpr))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<ImageSelectorSpec>(construct< ImageSelectorSpec::Stat>( "STAT =" >> scalar(integer (indirect(variable))))) || construct<ImageSelectorSpec> (construct<TeamValue>("TEAM =" >> teamValue)) || construct <ImageSelectorSpec>(construct<ImageSelectorSpec::Team_Number >( "TEAM_NUMBER =" >> scalarIntExpr)))}; return parser .Parse(state); } | |||
1149 | construct<ImageSelectorSpec>(construct<ImageSelectorSpec::Team_Number>(template <> auto Parser<typename decltype(attempt(construct <ImageSelectorSpec>(construct<ImageSelectorSpec::Stat >( "STAT =" >> scalar(integer(indirect(variable))))) || construct<ImageSelectorSpec>(construct<TeamValue >("TEAM =" >> teamValue)) || construct<ImageSelectorSpec >(construct<ImageSelectorSpec::Team_Number>( "TEAM_NUMBER =" >> scalarIntExpr))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<ImageSelectorSpec>(construct< ImageSelectorSpec::Stat>( "STAT =" >> scalar(integer (indirect(variable))))) || construct<ImageSelectorSpec> (construct<TeamValue>("TEAM =" >> teamValue)) || construct <ImageSelectorSpec>(construct<ImageSelectorSpec::Team_Number >( "TEAM_NUMBER =" >> scalarIntExpr)))}; return parser .Parse(state); } | |||
1150 | "TEAM_NUMBER =" >> scalarIntExpr)))template <> auto Parser<typename decltype(attempt(construct <ImageSelectorSpec>(construct<ImageSelectorSpec::Stat >( "STAT =" >> scalar(integer(indirect(variable))))) || construct<ImageSelectorSpec>(construct<TeamValue >("TEAM =" >> teamValue)) || construct<ImageSelectorSpec >(construct<ImageSelectorSpec::Team_Number>( "TEAM_NUMBER =" >> scalarIntExpr))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<ImageSelectorSpec>(construct< ImageSelectorSpec::Stat>( "STAT =" >> scalar(integer (indirect(variable))))) || construct<ImageSelectorSpec> (construct<TeamValue>("TEAM =" >> teamValue)) || construct <ImageSelectorSpec>(construct<ImageSelectorSpec::Team_Number >( "TEAM_NUMBER =" >> scalarIntExpr)))}; return parser .Parse(state); } | |||
1151 | ||||
1152 | // R927 allocate-stmt -> | |||
1153 | // ALLOCATE ( [type-spec ::] allocation-list [, alloc-opt-list] ) | |||
1154 | TYPE_CONTEXT_PARSER("ALLOCATE statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("ALLOCATE statement"_en_US)), inContext((("ALLOCATE statement"_en_US )), ((construct<AllocateStmt>("ALLOCATE (" >> maybe (typeSpec / "::"), nonemptyList(Parser<Allocation>{}), defaulted ("," >> nonemptyList(Parser<AllocOpt>{})) / ")")) )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( instrumented((("ALLOCATE statement"_en_US)), inContext((("ALLOCATE statement"_en_US )), ((construct<AllocateStmt>("ALLOCATE (" >> maybe (typeSpec / "::"), nonemptyList(Parser<Allocation>{}), defaulted ("," >> nonemptyList(Parser<AllocOpt>{})) / ")")) ))))}; return parser.Parse(state); } | |||
1155 | construct<AllocateStmt>("ALLOCATE (" >> maybe(typeSpec / "::"),template <> auto Parser<typename decltype(attempt(instrumented ((("ALLOCATE statement"_en_US)), inContext((("ALLOCATE statement"_en_US )), ((construct<AllocateStmt>("ALLOCATE (" >> maybe (typeSpec / "::"), nonemptyList(Parser<Allocation>{}), defaulted ("," >> nonemptyList(Parser<AllocOpt>{})) / ")")) )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( instrumented((("ALLOCATE statement"_en_US)), inContext((("ALLOCATE statement"_en_US )), ((construct<AllocateStmt>("ALLOCATE (" >> maybe (typeSpec / "::"), nonemptyList(Parser<Allocation>{}), defaulted ("," >> nonemptyList(Parser<AllocOpt>{})) / ")")) ))))}; return parser.Parse(state); } | |||
1156 | nonemptyList(Parser<Allocation>{}),template <> auto Parser<typename decltype(attempt(instrumented ((("ALLOCATE statement"_en_US)), inContext((("ALLOCATE statement"_en_US )), ((construct<AllocateStmt>("ALLOCATE (" >> maybe (typeSpec / "::"), nonemptyList(Parser<Allocation>{}), defaulted ("," >> nonemptyList(Parser<AllocOpt>{})) / ")")) )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( instrumented((("ALLOCATE statement"_en_US)), inContext((("ALLOCATE statement"_en_US )), ((construct<AllocateStmt>("ALLOCATE (" >> maybe (typeSpec / "::"), nonemptyList(Parser<Allocation>{}), defaulted ("," >> nonemptyList(Parser<AllocOpt>{})) / ")")) ))))}; return parser.Parse(state); } | |||
1157 | defaulted("," >> nonemptyList(Parser<AllocOpt>{})) / ")"))template <> auto Parser<typename decltype(attempt(instrumented ((("ALLOCATE statement"_en_US)), inContext((("ALLOCATE statement"_en_US )), ((construct<AllocateStmt>("ALLOCATE (" >> maybe (typeSpec / "::"), nonemptyList(Parser<Allocation>{}), defaulted ("," >> nonemptyList(Parser<AllocOpt>{})) / ")")) )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( instrumented((("ALLOCATE statement"_en_US)), inContext((("ALLOCATE statement"_en_US )), ((construct<AllocateStmt>("ALLOCATE (" >> maybe (typeSpec / "::"), nonemptyList(Parser<Allocation>{}), defaulted ("," >> nonemptyList(Parser<AllocOpt>{})) / ")")) ))))}; return parser.Parse(state); } | |||
1158 | ||||
1159 | // R928 alloc-opt -> | |||
1160 | // ERRMSG = errmsg-variable | MOLD = source-expr | | |||
1161 | // SOURCE = source-expr | STAT = stat-variable | |||
1162 | // R931 source-expr -> expr | |||
1163 | TYPE_PARSER(construct<AllocOpt>(template <> auto Parser<typename decltype(attempt(construct <AllocOpt>( construct<AllocOpt::Mold>("MOLD =" >> indirect(expr))) || construct<AllocOpt>( construct< AllocOpt::Source>("SOURCE =" >> indirect(expr))) || construct <AllocOpt>(statOrErrmsg)))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<AllocOpt>( construct<AllocOpt ::Mold>("MOLD =" >> indirect(expr))) || construct< AllocOpt>( construct<AllocOpt::Source>("SOURCE =" >> indirect(expr))) || construct<AllocOpt>(statOrErrmsg)) }; return parser.Parse(state); } | |||
1164 | construct<AllocOpt::Mold>("MOLD =" >> indirect(expr))) ||template <> auto Parser<typename decltype(attempt(construct <AllocOpt>( construct<AllocOpt::Mold>("MOLD =" >> indirect(expr))) || construct<AllocOpt>( construct< AllocOpt::Source>("SOURCE =" >> indirect(expr))) || construct <AllocOpt>(statOrErrmsg)))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<AllocOpt>( construct<AllocOpt ::Mold>("MOLD =" >> indirect(expr))) || construct< AllocOpt>( construct<AllocOpt::Source>("SOURCE =" >> indirect(expr))) || construct<AllocOpt>(statOrErrmsg)) }; return parser.Parse(state); } | |||
1165 | construct<AllocOpt>(template <> auto Parser<typename decltype(attempt(construct <AllocOpt>( construct<AllocOpt::Mold>("MOLD =" >> indirect(expr))) || construct<AllocOpt>( construct< AllocOpt::Source>("SOURCE =" >> indirect(expr))) || construct <AllocOpt>(statOrErrmsg)))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<AllocOpt>( construct<AllocOpt ::Mold>("MOLD =" >> indirect(expr))) || construct< AllocOpt>( construct<AllocOpt::Source>("SOURCE =" >> indirect(expr))) || construct<AllocOpt>(statOrErrmsg)) }; return parser.Parse(state); } | |||
1166 | construct<AllocOpt::Source>("SOURCE =" >> indirect(expr))) ||template <> auto Parser<typename decltype(attempt(construct <AllocOpt>( construct<AllocOpt::Mold>("MOLD =" >> indirect(expr))) || construct<AllocOpt>( construct< AllocOpt::Source>("SOURCE =" >> indirect(expr))) || construct <AllocOpt>(statOrErrmsg)))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<AllocOpt>( construct<AllocOpt ::Mold>("MOLD =" >> indirect(expr))) || construct< AllocOpt>( construct<AllocOpt::Source>("SOURCE =" >> indirect(expr))) || construct<AllocOpt>(statOrErrmsg)) }; return parser.Parse(state); } | |||
1167 | construct<AllocOpt>(statOrErrmsg))template <> auto Parser<typename decltype(attempt(construct <AllocOpt>( construct<AllocOpt::Mold>("MOLD =" >> indirect(expr))) || construct<AllocOpt>( construct< AllocOpt::Source>("SOURCE =" >> indirect(expr))) || construct <AllocOpt>(statOrErrmsg)))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(construct<AllocOpt>( construct<AllocOpt ::Mold>("MOLD =" >> indirect(expr))) || construct< AllocOpt>( construct<AllocOpt::Source>("SOURCE =" >> indirect(expr))) || construct<AllocOpt>(statOrErrmsg)) }; return parser.Parse(state); } | |||
1168 | ||||
1169 | // R929 stat-variable -> scalar-int-variable | |||
1170 | TYPE_PARSER(construct<StatVariable>(scalar(integer(variable))))template <> auto Parser<typename decltype(attempt(construct <StatVariable>(scalar(integer(variable)))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<StatVariable >(scalar(integer(variable))))}; return parser.Parse(state) ; } | |||
1171 | ||||
1172 | // R932 allocation -> | |||
1173 | // allocate-object [( allocate-shape-spec-list )] | |||
1174 | // [lbracket allocate-coarray-spec rbracket] | |||
1175 | TYPE_PARSER(construct<Allocation>(Parser<AllocateObject>{},template <> auto Parser<typename decltype(attempt(construct <Allocation>(Parser<AllocateObject>{}, defaulted( parenthesized(nonemptyList(Parser<AllocateShapeSpec>{}) )), maybe(bracketed(Parser<AllocateCoarraySpec>{}))))):: resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(construct< Allocation>(Parser<AllocateObject>{}, defaulted(parenthesized (nonemptyList(Parser<AllocateShapeSpec>{}))), maybe(bracketed (Parser<AllocateCoarraySpec>{}))))}; return parser.Parse (state); } | |||
1176 | defaulted(parenthesized(nonemptyList(Parser<AllocateShapeSpec>{}))),template <> auto Parser<typename decltype(attempt(construct <Allocation>(Parser<AllocateObject>{}, defaulted( parenthesized(nonemptyList(Parser<AllocateShapeSpec>{}) )), maybe(bracketed(Parser<AllocateCoarraySpec>{}))))):: resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(construct< Allocation>(Parser<AllocateObject>{}, defaulted(parenthesized (nonemptyList(Parser<AllocateShapeSpec>{}))), maybe(bracketed (Parser<AllocateCoarraySpec>{}))))}; return parser.Parse (state); } | |||
1177 | maybe(bracketed(Parser<AllocateCoarraySpec>{}))))template <> auto Parser<typename decltype(attempt(construct <Allocation>(Parser<AllocateObject>{}, defaulted( parenthesized(nonemptyList(Parser<AllocateShapeSpec>{}) )), maybe(bracketed(Parser<AllocateCoarraySpec>{}))))):: resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(construct< Allocation>(Parser<AllocateObject>{}, defaulted(parenthesized (nonemptyList(Parser<AllocateShapeSpec>{}))), maybe(bracketed (Parser<AllocateCoarraySpec>{}))))}; return parser.Parse (state); } | |||
1178 | ||||
1179 | // R933 allocate-object -> variable-name | structure-component | |||
1180 | TYPE_PARSER(construct<AllocateObject>(structureComponent) ||template <> auto Parser<typename decltype(attempt(construct <AllocateObject>(structureComponent) || construct<AllocateObject >(name / !"="_tok)))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<AllocateObject>(structureComponent ) || construct<AllocateObject>(name / !"="_tok))}; return parser.Parse(state); } | |||
1181 | construct<AllocateObject>(name / !"="_tok))template <> auto Parser<typename decltype(attempt(construct <AllocateObject>(structureComponent) || construct<AllocateObject >(name / !"="_tok)))::resultType>::Parse( ParseState & state) ->std::optional<resultType> { static constexpr auto parser{(construct<AllocateObject>(structureComponent ) || construct<AllocateObject>(name / !"="_tok))}; return parser.Parse(state); } | |||
1182 | ||||
1183 | // R934 allocate-shape-spec -> [lower-bound-expr :] upper-bound-expr | |||
1184 | // R938 allocate-coshape-spec -> [lower-bound-expr :] upper-bound-expr | |||
1185 | TYPE_PARSER(construct<AllocateShapeSpec>(maybe(boundExpr / ":"), boundExpr))template <> auto Parser<typename decltype(attempt(construct <AllocateShapeSpec>(maybe(boundExpr / ":"), boundExpr)) )::resultType>::Parse( ParseState &state) ->std::optional <resultType> { static constexpr auto parser{(construct< AllocateShapeSpec>(maybe(boundExpr / ":"), boundExpr))}; return parser.Parse(state); } | |||
1186 | ||||
1187 | // R937 allocate-coarray-spec -> | |||
1188 | // [allocate-coshape-spec-list ,] [lower-bound-expr :] * | |||
1189 | TYPE_PARSER(construct<AllocateCoarraySpec>(template <> auto Parser<typename decltype(attempt(construct <AllocateCoarraySpec>( defaulted(nonemptyList(Parser< AllocateShapeSpec>{}) / ","), maybe(boundExpr / ":") / "*" )))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <AllocateCoarraySpec>( defaulted(nonemptyList(Parser< AllocateShapeSpec>{}) / ","), maybe(boundExpr / ":") / "*" ))}; return parser.Parse(state); } | |||
1190 | defaulted(nonemptyList(Parser<AllocateShapeSpec>{}) / ","),template <> auto Parser<typename decltype(attempt(construct <AllocateCoarraySpec>( defaulted(nonemptyList(Parser< AllocateShapeSpec>{}) / ","), maybe(boundExpr / ":") / "*" )))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <AllocateCoarraySpec>( defaulted(nonemptyList(Parser< AllocateShapeSpec>{}) / ","), maybe(boundExpr / ":") / "*" ))}; return parser.Parse(state); } | |||
1191 | maybe(boundExpr / ":") / "*"))template <> auto Parser<typename decltype(attempt(construct <AllocateCoarraySpec>( defaulted(nonemptyList(Parser< AllocateShapeSpec>{}) / ","), maybe(boundExpr / ":") / "*" )))::resultType>::Parse( ParseState &state) ->std:: optional<resultType> { static constexpr auto parser{(construct <AllocateCoarraySpec>( defaulted(nonemptyList(Parser< AllocateShapeSpec>{}) / ","), maybe(boundExpr / ":") / "*" ))}; return parser.Parse(state); } | |||
1192 | ||||
1193 | // R939 nullify-stmt -> NULLIFY ( pointer-object-list ) | |||
1194 | TYPE_CONTEXT_PARSER("NULLIFY statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("NULLIFY statement"_en_US)), inContext((("NULLIFY statement"_en_US )), (("NULLIFY" >> parenthesized(construct<NullifyStmt >( nonemptyList(Parser<PointerObject>{})))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("NULLIFY statement"_en_US )), inContext((("NULLIFY statement"_en_US)), (("NULLIFY" >> parenthesized(construct<NullifyStmt>( nonemptyList(Parser <PointerObject>{}))))))))}; return parser.Parse(state); } | |||
1195 | "NULLIFY" >> parenthesized(construct<NullifyStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("NULLIFY statement"_en_US)), inContext((("NULLIFY statement"_en_US )), (("NULLIFY" >> parenthesized(construct<NullifyStmt >( nonemptyList(Parser<PointerObject>{})))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("NULLIFY statement"_en_US )), inContext((("NULLIFY statement"_en_US)), (("NULLIFY" >> parenthesized(construct<NullifyStmt>( nonemptyList(Parser <PointerObject>{}))))))))}; return parser.Parse(state); } | |||
1196 | nonemptyList(Parser<PointerObject>{}))))template <> auto Parser<typename decltype(attempt(instrumented ((("NULLIFY statement"_en_US)), inContext((("NULLIFY statement"_en_US )), (("NULLIFY" >> parenthesized(construct<NullifyStmt >( nonemptyList(Parser<PointerObject>{})))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("NULLIFY statement"_en_US )), inContext((("NULLIFY statement"_en_US)), (("NULLIFY" >> parenthesized(construct<NullifyStmt>( nonemptyList(Parser <PointerObject>{}))))))))}; return parser.Parse(state); } | |||
1197 | ||||
1198 | // R940 pointer-object -> | |||
1199 | // variable-name | structure-component | proc-pointer-name | |||
1200 | TYPE_PARSER(construct<PointerObject>(structureComponent) ||template <> auto Parser<typename decltype(attempt(construct <PointerObject>(structureComponent) || construct<PointerObject >(name)))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<PointerObject>(structureComponent) || construct <PointerObject>(name))}; return parser.Parse(state); } | |||
1201 | construct<PointerObject>(name))template <> auto Parser<typename decltype(attempt(construct <PointerObject>(structureComponent) || construct<PointerObject >(name)))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(construct<PointerObject>(structureComponent) || construct <PointerObject>(name))}; return parser.Parse(state); } | |||
1202 | ||||
1203 | // R941 deallocate-stmt -> | |||
1204 | // DEALLOCATE ( allocate-object-list [, dealloc-opt-list] ) | |||
1205 | TYPE_CONTEXT_PARSER("DEALLOCATE statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("DEALLOCATE statement"_en_US)), inContext((("DEALLOCATE statement"_en_US )), ((construct<DeallocateStmt>( "DEALLOCATE (" >> nonemptyList(Parser<AllocateObject>{}), defaulted("," >> nonemptyList(statOrErrmsg)) / ")")))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("DEALLOCATE statement"_en_US )), inContext((("DEALLOCATE statement"_en_US)), ((construct< DeallocateStmt>( "DEALLOCATE (" >> nonemptyList(Parser <AllocateObject>{}), defaulted("," >> nonemptyList (statOrErrmsg)) / ")"))))))}; return parser.Parse(state); } | |||
1206 | construct<DeallocateStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("DEALLOCATE statement"_en_US)), inContext((("DEALLOCATE statement"_en_US )), ((construct<DeallocateStmt>( "DEALLOCATE (" >> nonemptyList(Parser<AllocateObject>{}), defaulted("," >> nonemptyList(statOrErrmsg)) / ")")))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("DEALLOCATE statement"_en_US )), inContext((("DEALLOCATE statement"_en_US)), ((construct< DeallocateStmt>( "DEALLOCATE (" >> nonemptyList(Parser <AllocateObject>{}), defaulted("," >> nonemptyList (statOrErrmsg)) / ")"))))))}; return parser.Parse(state); } | |||
1207 | "DEALLOCATE (" >> nonemptyList(Parser<AllocateObject>{}),template <> auto Parser<typename decltype(attempt(instrumented ((("DEALLOCATE statement"_en_US)), inContext((("DEALLOCATE statement"_en_US )), ((construct<DeallocateStmt>( "DEALLOCATE (" >> nonemptyList(Parser<AllocateObject>{}), defaulted("," >> nonemptyList(statOrErrmsg)) / ")")))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("DEALLOCATE statement"_en_US )), inContext((("DEALLOCATE statement"_en_US)), ((construct< DeallocateStmt>( "DEALLOCATE (" >> nonemptyList(Parser <AllocateObject>{}), defaulted("," >> nonemptyList (statOrErrmsg)) / ")"))))))}; return parser.Parse(state); } | |||
1208 | defaulted("," >> nonemptyList(statOrErrmsg)) / ")"))template <> auto Parser<typename decltype(attempt(instrumented ((("DEALLOCATE statement"_en_US)), inContext((("DEALLOCATE statement"_en_US )), ((construct<DeallocateStmt>( "DEALLOCATE (" >> nonemptyList(Parser<AllocateObject>{}), defaulted("," >> nonemptyList(statOrErrmsg)) / ")")))))))::resultType>::Parse ( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("DEALLOCATE statement"_en_US )), inContext((("DEALLOCATE statement"_en_US)), ((construct< DeallocateStmt>( "DEALLOCATE (" >> nonemptyList(Parser <AllocateObject>{}), defaulted("," >> nonemptyList (statOrErrmsg)) / ")"))))))}; return parser.Parse(state); } | |||
1209 | ||||
1210 | // R942 dealloc-opt -> STAT = stat-variable | ERRMSG = errmsg-variable | |||
1211 | // R1165 sync-stat -> STAT = stat-variable | ERRMSG = errmsg-variable | |||
1212 | TYPE_PARSER(construct<StatOrErrmsg>("STAT =" >> statVariable) ||template <> auto Parser<typename decltype(attempt(construct <StatOrErrmsg>("STAT =" >> statVariable) || construct <StatOrErrmsg>("ERRMSG =" >> msgVariable)))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<StatOrErrmsg >("STAT =" >> statVariable) || construct<StatOrErrmsg >("ERRMSG =" >> msgVariable))}; return parser.Parse( state); } | |||
1213 | construct<StatOrErrmsg>("ERRMSG =" >> msgVariable))template <> auto Parser<typename decltype(attempt(construct <StatOrErrmsg>("STAT =" >> statVariable) || construct <StatOrErrmsg>("ERRMSG =" >> msgVariable)))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<StatOrErrmsg >("STAT =" >> statVariable) || construct<StatOrErrmsg >("ERRMSG =" >> msgVariable))}; return parser.Parse( state); } | |||
1214 | ||||
1215 | // Directives, extensions, and deprecated statements | |||
1216 | // !DIR$ IGNORE_TKR [ [(tkrdmac...)] name ]... | |||
1217 | // !DIR$ LOOP COUNT (n1[, n2]...) | |||
1218 | // !DIR$ name... | |||
1219 | constexpr auto beginDirective{skipStuffBeforeStatement >> "!"_ch}; | |||
1220 | constexpr auto endDirective{space >> endOfLine}; | |||
1221 | constexpr auto ignore_tkr{ | |||
1222 | "DIR$ IGNORE_TKR" >> optionalList(construct<CompilerDirective::IgnoreTKR>( | |||
1223 | maybe(parenthesized(many(letter))), name))}; | |||
1224 | constexpr auto loopCount{ | |||
1225 | "DIR$ LOOP COUNT" >> construct<CompilerDirective::LoopCount>( | |||
1226 | parenthesized(nonemptyList(digitString64)))}; | |||
1227 | ||||
1228 | TYPE_PARSER(beginDirective >>template <> auto Parser<typename decltype(attempt(beginDirective >> sourced(construct<CompilerDirective>(ignore_tkr ) || construct<CompilerDirective>(loopCount) || construct <CompilerDirective>( "DIR$" >> many(construct< CompilerDirective::NameValue>(name, maybe(("="_tok || ":"_tok ) >> digitString64))))) / endDirective))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(beginDirective >> sourced (construct<CompilerDirective>(ignore_tkr) || construct< CompilerDirective>(loopCount) || construct<CompilerDirective >( "DIR$" >> many(construct<CompilerDirective::NameValue >(name, maybe(("="_tok || ":"_tok) >> digitString64) )))) / endDirective)}; return parser.Parse(state); } | |||
1229 | sourced(construct<CompilerDirective>(ignore_tkr) ||template <> auto Parser<typename decltype(attempt(beginDirective >> sourced(construct<CompilerDirective>(ignore_tkr ) || construct<CompilerDirective>(loopCount) || construct <CompilerDirective>( "DIR$" >> many(construct< CompilerDirective::NameValue>(name, maybe(("="_tok || ":"_tok ) >> digitString64))))) / endDirective))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(beginDirective >> sourced (construct<CompilerDirective>(ignore_tkr) || construct< CompilerDirective>(loopCount) || construct<CompilerDirective >( "DIR$" >> many(construct<CompilerDirective::NameValue >(name, maybe(("="_tok || ":"_tok) >> digitString64) )))) / endDirective)}; return parser.Parse(state); } | |||
1230 | construct<CompilerDirective>(loopCount) ||template <> auto Parser<typename decltype(attempt(beginDirective >> sourced(construct<CompilerDirective>(ignore_tkr ) || construct<CompilerDirective>(loopCount) || construct <CompilerDirective>( "DIR$" >> many(construct< CompilerDirective::NameValue>(name, maybe(("="_tok || ":"_tok ) >> digitString64))))) / endDirective))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(beginDirective >> sourced (construct<CompilerDirective>(ignore_tkr) || construct< CompilerDirective>(loopCount) || construct<CompilerDirective >( "DIR$" >> many(construct<CompilerDirective::NameValue >(name, maybe(("="_tok || ":"_tok) >> digitString64) )))) / endDirective)}; return parser.Parse(state); } | |||
1231 | construct<CompilerDirective>(template <> auto Parser<typename decltype(attempt(beginDirective >> sourced(construct<CompilerDirective>(ignore_tkr ) || construct<CompilerDirective>(loopCount) || construct <CompilerDirective>( "DIR$" >> many(construct< CompilerDirective::NameValue>(name, maybe(("="_tok || ":"_tok ) >> digitString64))))) / endDirective))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(beginDirective >> sourced (construct<CompilerDirective>(ignore_tkr) || construct< CompilerDirective>(loopCount) || construct<CompilerDirective >( "DIR$" >> many(construct<CompilerDirective::NameValue >(name, maybe(("="_tok || ":"_tok) >> digitString64) )))) / endDirective)}; return parser.Parse(state); } | |||
1232 | "DIR$" >> many(construct<CompilerDirective::NameValue>(name,template <> auto Parser<typename decltype(attempt(beginDirective >> sourced(construct<CompilerDirective>(ignore_tkr ) || construct<CompilerDirective>(loopCount) || construct <CompilerDirective>( "DIR$" >> many(construct< CompilerDirective::NameValue>(name, maybe(("="_tok || ":"_tok ) >> digitString64))))) / endDirective))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(beginDirective >> sourced (construct<CompilerDirective>(ignore_tkr) || construct< CompilerDirective>(loopCount) || construct<CompilerDirective >( "DIR$" >> many(construct<CompilerDirective::NameValue >(name, maybe(("="_tok || ":"_tok) >> digitString64) )))) / endDirective)}; return parser.Parse(state); } | |||
1233 | maybe(("="_tok || ":"_tok) >> digitString64))))) /template <> auto Parser<typename decltype(attempt(beginDirective >> sourced(construct<CompilerDirective>(ignore_tkr ) || construct<CompilerDirective>(loopCount) || construct <CompilerDirective>( "DIR$" >> many(construct< CompilerDirective::NameValue>(name, maybe(("="_tok || ":"_tok ) >> digitString64))))) / endDirective))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(beginDirective >> sourced (construct<CompilerDirective>(ignore_tkr) || construct< CompilerDirective>(loopCount) || construct<CompilerDirective >( "DIR$" >> many(construct<CompilerDirective::NameValue >(name, maybe(("="_tok || ":"_tok) >> digitString64) )))) / endDirective)}; return parser.Parse(state); } | |||
1234 | endDirective)template <> auto Parser<typename decltype(attempt(beginDirective >> sourced(construct<CompilerDirective>(ignore_tkr ) || construct<CompilerDirective>(loopCount) || construct <CompilerDirective>( "DIR$" >> many(construct< CompilerDirective::NameValue>(name, maybe(("="_tok || ":"_tok ) >> digitString64))))) / endDirective))::resultType> ::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(beginDirective >> sourced (construct<CompilerDirective>(ignore_tkr) || construct< CompilerDirective>(loopCount) || construct<CompilerDirective >( "DIR$" >> many(construct<CompilerDirective::NameValue >(name, maybe(("="_tok || ":"_tok) >> digitString64) )))) / endDirective)}; return parser.Parse(state); } | |||
1235 | ||||
1236 | TYPE_PARSER(extension<LanguageFeature::CrayPointer>(template <> auto Parser<typename decltype(attempt(extension <LanguageFeature::CrayPointer>( "nonstandard usage: based POINTER"_port_en_US , construct<BasedPointerStmt>( "POINTER" >> nonemptyList ("expected POINTER associations"_err_en_US, construct<BasedPointer >("(" >> objectName / ",", objectName, maybe(Parser< ArraySpec>{}) / ")"))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(extension<LanguageFeature::CrayPointer>( "nonstandard usage: based POINTER"_port_en_US , construct<BasedPointerStmt>( "POINTER" >> nonemptyList ("expected POINTER associations"_err_en_US, construct<BasedPointer >("(" >> objectName / ",", objectName, maybe(Parser< ArraySpec>{}) / ")")))))}; return parser.Parse(state); } | |||
1237 | "nonstandard usage: based POINTER"_port_en_US,template <> auto Parser<typename decltype(attempt(extension <LanguageFeature::CrayPointer>( "nonstandard usage: based POINTER"_port_en_US , construct<BasedPointerStmt>( "POINTER" >> nonemptyList ("expected POINTER associations"_err_en_US, construct<BasedPointer >("(" >> objectName / ",", objectName, maybe(Parser< ArraySpec>{}) / ")"))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(extension<LanguageFeature::CrayPointer>( "nonstandard usage: based POINTER"_port_en_US , construct<BasedPointerStmt>( "POINTER" >> nonemptyList ("expected POINTER associations"_err_en_US, construct<BasedPointer >("(" >> objectName / ",", objectName, maybe(Parser< ArraySpec>{}) / ")")))))}; return parser.Parse(state); } | |||
1238 | construct<BasedPointerStmt>(template <> auto Parser<typename decltype(attempt(extension <LanguageFeature::CrayPointer>( "nonstandard usage: based POINTER"_port_en_US , construct<BasedPointerStmt>( "POINTER" >> nonemptyList ("expected POINTER associations"_err_en_US, construct<BasedPointer >("(" >> objectName / ",", objectName, maybe(Parser< ArraySpec>{}) / ")"))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(extension<LanguageFeature::CrayPointer>( "nonstandard usage: based POINTER"_port_en_US , construct<BasedPointerStmt>( "POINTER" >> nonemptyList ("expected POINTER associations"_err_en_US, construct<BasedPointer >("(" >> objectName / ",", objectName, maybe(Parser< ArraySpec>{}) / ")")))))}; return parser.Parse(state); } | |||
1239 | "POINTER" >> nonemptyList("expected POINTER associations"_err_en_US,template <> auto Parser<typename decltype(attempt(extension <LanguageFeature::CrayPointer>( "nonstandard usage: based POINTER"_port_en_US , construct<BasedPointerStmt>( "POINTER" >> nonemptyList ("expected POINTER associations"_err_en_US, construct<BasedPointer >("(" >> objectName / ",", objectName, maybe(Parser< ArraySpec>{}) / ")"))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(extension<LanguageFeature::CrayPointer>( "nonstandard usage: based POINTER"_port_en_US , construct<BasedPointerStmt>( "POINTER" >> nonemptyList ("expected POINTER associations"_err_en_US, construct<BasedPointer >("(" >> objectName / ",", objectName, maybe(Parser< ArraySpec>{}) / ")")))))}; return parser.Parse(state); } | |||
1240 | construct<BasedPointer>("(" >> objectName / ",",template <> auto Parser<typename decltype(attempt(extension <LanguageFeature::CrayPointer>( "nonstandard usage: based POINTER"_port_en_US , construct<BasedPointerStmt>( "POINTER" >> nonemptyList ("expected POINTER associations"_err_en_US, construct<BasedPointer >("(" >> objectName / ",", objectName, maybe(Parser< ArraySpec>{}) / ")"))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(extension<LanguageFeature::CrayPointer>( "nonstandard usage: based POINTER"_port_en_US , construct<BasedPointerStmt>( "POINTER" >> nonemptyList ("expected POINTER associations"_err_en_US, construct<BasedPointer >("(" >> objectName / ",", objectName, maybe(Parser< ArraySpec>{}) / ")")))))}; return parser.Parse(state); } | |||
1241 | objectName, maybe(Parser<ArraySpec>{}) / ")")))))template <> auto Parser<typename decltype(attempt(extension <LanguageFeature::CrayPointer>( "nonstandard usage: based POINTER"_port_en_US , construct<BasedPointerStmt>( "POINTER" >> nonemptyList ("expected POINTER associations"_err_en_US, construct<BasedPointer >("(" >> objectName / ",", objectName, maybe(Parser< ArraySpec>{}) / ")"))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(extension<LanguageFeature::CrayPointer>( "nonstandard usage: based POINTER"_port_en_US , construct<BasedPointerStmt>( "POINTER" >> nonemptyList ("expected POINTER associations"_err_en_US, construct<BasedPointer >("(" >> objectName / ",", objectName, maybe(Parser< ArraySpec>{}) / ")")))))}; return parser.Parse(state); } | |||
1242 | ||||
1243 | // Subtle: the name includes the surrounding slashes, which avoids | |||
1244 | // clashes with other uses of the name in the same scope. | |||
1245 | TYPE_PARSER(construct<StructureStmt>(template <> auto Parser<typename decltype(attempt(construct <StructureStmt>( "STRUCTURE" >> maybe(sourced("/" >> name / "/")), optionalList(entityDecl))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<StructureStmt >( "STRUCTURE" >> maybe(sourced("/" >> name / "/" )), optionalList(entityDecl)))}; return parser.Parse(state); } | |||
1246 | "STRUCTURE" >> maybe(sourced("/" >> name / "/")), optionalList(entityDecl)))template <> auto Parser<typename decltype(attempt(construct <StructureStmt>( "STRUCTURE" >> maybe(sourced("/" >> name / "/")), optionalList(entityDecl))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<StructureStmt >( "STRUCTURE" >> maybe(sourced("/" >> name / "/" )), optionalList(entityDecl)))}; return parser.Parse(state); } | |||
1247 | ||||
1248 | constexpr auto nestedStructureDef{ | |||
1249 | CONTEXT_PARSER("nested STRUCTURE definition"_en_US,instrumented(("nested STRUCTURE definition"_en_US), inContext (("nested STRUCTURE definition"_en_US), (construct<StructureDef >(statement(NestedStructureStmt{}), many(Parser<StructureField >{}), statement(construct<StructureDef::EndStructureStmt >( "END STRUCTURE"_tok)))))) | |||
1250 | construct<StructureDef>(statement(NestedStructureStmt{}),instrumented(("nested STRUCTURE definition"_en_US), inContext (("nested STRUCTURE definition"_en_US), (construct<StructureDef >(statement(NestedStructureStmt{}), many(Parser<StructureField >{}), statement(construct<StructureDef::EndStructureStmt >( "END STRUCTURE"_tok)))))) | |||
1251 | many(Parser<StructureField>{}),instrumented(("nested STRUCTURE definition"_en_US), inContext (("nested STRUCTURE definition"_en_US), (construct<StructureDef >(statement(NestedStructureStmt{}), many(Parser<StructureField >{}), statement(construct<StructureDef::EndStructureStmt >( "END STRUCTURE"_tok)))))) | |||
1252 | statement(construct<StructureDef::EndStructureStmt>(instrumented(("nested STRUCTURE definition"_en_US), inContext (("nested STRUCTURE definition"_en_US), (construct<StructureDef >(statement(NestedStructureStmt{}), many(Parser<StructureField >{}), statement(construct<StructureDef::EndStructureStmt >( "END STRUCTURE"_tok)))))) | |||
1253 | "END STRUCTURE"_tok))))instrumented(("nested STRUCTURE definition"_en_US), inContext (("nested STRUCTURE definition"_en_US), (construct<StructureDef >(statement(NestedStructureStmt{}), many(Parser<StructureField >{}), statement(construct<StructureDef::EndStructureStmt >( "END STRUCTURE"_tok))))))}; | |||
1254 | ||||
1255 | TYPE_PARSER(construct<StructureField>(statement(StructureComponents{})) ||template <> auto Parser<typename decltype(attempt(construct <StructureField>(statement(StructureComponents{})) || construct <StructureField>(indirect(Parser<Union>{})) || construct <StructureField>(indirect(nestedStructureDef))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<StructureField >(statement(StructureComponents{})) || construct<StructureField >(indirect(Parser<Union>{})) || construct<StructureField >(indirect(nestedStructureDef)))}; return parser.Parse(state ); } | |||
1256 | construct<StructureField>(indirect(Parser<Union>{})) ||template <> auto Parser<typename decltype(attempt(construct <StructureField>(statement(StructureComponents{})) || construct <StructureField>(indirect(Parser<Union>{})) || construct <StructureField>(indirect(nestedStructureDef))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<StructureField >(statement(StructureComponents{})) || construct<StructureField >(indirect(Parser<Union>{})) || construct<StructureField >(indirect(nestedStructureDef)))}; return parser.Parse(state ); } | |||
1257 | construct<StructureField>(indirect(nestedStructureDef)))template <> auto Parser<typename decltype(attempt(construct <StructureField>(statement(StructureComponents{})) || construct <StructureField>(indirect(Parser<Union>{})) || construct <StructureField>(indirect(nestedStructureDef))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(construct<StructureField >(statement(StructureComponents{})) || construct<StructureField >(indirect(Parser<Union>{})) || construct<StructureField >(indirect(nestedStructureDef)))}; return parser.Parse(state ); } | |||
1258 | ||||
1259 | TYPE_CONTEXT_PARSER("STRUCTURE definition"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("STRUCTURE definition"_en_US)), inContext((("STRUCTURE definition"_en_US )), ((extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<StructureDef>(statement(Parser<StructureStmt >{}), many(Parser<StructureField>{}), statement(construct <StructureDef::EndStructureStmt>( "END STRUCTURE"_tok)) ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("STRUCTURE definition"_en_US)), inContext((( "STRUCTURE definition"_en_US)), ((extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<StructureDef>(statement(Parser<StructureStmt >{}), many(Parser<StructureField>{}), statement(construct <StructureDef::EndStructureStmt>( "END STRUCTURE"_tok)) )))))))}; return parser.Parse(state); } | |||
1260 | extension<LanguageFeature::DECStructures>(template <> auto Parser<typename decltype(attempt(instrumented ((("STRUCTURE definition"_en_US)), inContext((("STRUCTURE definition"_en_US )), ((extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<StructureDef>(statement(Parser<StructureStmt >{}), many(Parser<StructureField>{}), statement(construct <StructureDef::EndStructureStmt>( "END STRUCTURE"_tok)) ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("STRUCTURE definition"_en_US)), inContext((( "STRUCTURE definition"_en_US)), ((extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<StructureDef>(statement(Parser<StructureStmt >{}), many(Parser<StructureField>{}), statement(construct <StructureDef::EndStructureStmt>( "END STRUCTURE"_tok)) )))))))}; return parser.Parse(state); } | |||
1261 | "nonstandard usage: STRUCTURE"_port_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("STRUCTURE definition"_en_US)), inContext((("STRUCTURE definition"_en_US )), ((extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<StructureDef>(statement(Parser<StructureStmt >{}), many(Parser<StructureField>{}), statement(construct <StructureDef::EndStructureStmt>( "END STRUCTURE"_tok)) ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("STRUCTURE definition"_en_US)), inContext((( "STRUCTURE definition"_en_US)), ((extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<StructureDef>(statement(Parser<StructureStmt >{}), many(Parser<StructureField>{}), statement(construct <StructureDef::EndStructureStmt>( "END STRUCTURE"_tok)) )))))))}; return parser.Parse(state); } | |||
1262 | construct<StructureDef>(statement(Parser<StructureStmt>{}),template <> auto Parser<typename decltype(attempt(instrumented ((("STRUCTURE definition"_en_US)), inContext((("STRUCTURE definition"_en_US )), ((extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<StructureDef>(statement(Parser<StructureStmt >{}), many(Parser<StructureField>{}), statement(construct <StructureDef::EndStructureStmt>( "END STRUCTURE"_tok)) ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("STRUCTURE definition"_en_US)), inContext((( "STRUCTURE definition"_en_US)), ((extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<StructureDef>(statement(Parser<StructureStmt >{}), many(Parser<StructureField>{}), statement(construct <StructureDef::EndStructureStmt>( "END STRUCTURE"_tok)) )))))))}; return parser.Parse(state); } | |||
1263 | many(Parser<StructureField>{}),template <> auto Parser<typename decltype(attempt(instrumented ((("STRUCTURE definition"_en_US)), inContext((("STRUCTURE definition"_en_US )), ((extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<StructureDef>(statement(Parser<StructureStmt >{}), many(Parser<StructureField>{}), statement(construct <StructureDef::EndStructureStmt>( "END STRUCTURE"_tok)) ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("STRUCTURE definition"_en_US)), inContext((( "STRUCTURE definition"_en_US)), ((extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<StructureDef>(statement(Parser<StructureStmt >{}), many(Parser<StructureField>{}), statement(construct <StructureDef::EndStructureStmt>( "END STRUCTURE"_tok)) )))))))}; return parser.Parse(state); } | |||
1264 | statement(construct<StructureDef::EndStructureStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("STRUCTURE definition"_en_US)), inContext((("STRUCTURE definition"_en_US )), ((extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<StructureDef>(statement(Parser<StructureStmt >{}), many(Parser<StructureField>{}), statement(construct <StructureDef::EndStructureStmt>( "END STRUCTURE"_tok)) ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("STRUCTURE definition"_en_US)), inContext((( "STRUCTURE definition"_en_US)), ((extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<StructureDef>(statement(Parser<StructureStmt >{}), many(Parser<StructureField>{}), statement(construct <StructureDef::EndStructureStmt>( "END STRUCTURE"_tok)) )))))))}; return parser.Parse(state); } | |||
1265 | "END STRUCTURE"_tok)))))template <> auto Parser<typename decltype(attempt(instrumented ((("STRUCTURE definition"_en_US)), inContext((("STRUCTURE definition"_en_US )), ((extension<LanguageFeature::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<StructureDef>(statement(Parser<StructureStmt >{}), many(Parser<StructureField>{}), statement(construct <StructureDef::EndStructureStmt>( "END STRUCTURE"_tok)) ))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("STRUCTURE definition"_en_US)), inContext((( "STRUCTURE definition"_en_US)), ((extension<LanguageFeature ::DECStructures>( "nonstandard usage: STRUCTURE"_port_en_US , construct<StructureDef>(statement(Parser<StructureStmt >{}), many(Parser<StructureField>{}), statement(construct <StructureDef::EndStructureStmt>( "END STRUCTURE"_tok)) )))))))}; return parser.Parse(state); } | |||
1266 | ||||
1267 | TYPE_CONTEXT_PARSER("UNION definition"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("UNION definition"_en_US)), inContext((("UNION definition"_en_US )), ((construct<Union>(statement(construct<Union::UnionStmt >("UNION"_tok)), many(Parser<Map>{}), statement(construct <Union::EndUnionStmt>("END UNION"_tok)))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("UNION definition"_en_US )), inContext((("UNION definition"_en_US)), ((construct<Union >(statement(construct<Union::UnionStmt>("UNION"_tok) ), many(Parser<Map>{}), statement(construct<Union::EndUnionStmt >("END UNION"_tok))))))))}; return parser.Parse(state); } | |||
1268 | construct<Union>(statement(construct<Union::UnionStmt>("UNION"_tok)),template <> auto Parser<typename decltype(attempt(instrumented ((("UNION definition"_en_US)), inContext((("UNION definition"_en_US )), ((construct<Union>(statement(construct<Union::UnionStmt >("UNION"_tok)), many(Parser<Map>{}), statement(construct <Union::EndUnionStmt>("END UNION"_tok)))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("UNION definition"_en_US )), inContext((("UNION definition"_en_US)), ((construct<Union >(statement(construct<Union::UnionStmt>("UNION"_tok) ), many(Parser<Map>{}), statement(construct<Union::EndUnionStmt >("END UNION"_tok))))))))}; return parser.Parse(state); } | |||
1269 | many(Parser<Map>{}),template <> auto Parser<typename decltype(attempt(instrumented ((("UNION definition"_en_US)), inContext((("UNION definition"_en_US )), ((construct<Union>(statement(construct<Union::UnionStmt >("UNION"_tok)), many(Parser<Map>{}), statement(construct <Union::EndUnionStmt>("END UNION"_tok)))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("UNION definition"_en_US )), inContext((("UNION definition"_en_US)), ((construct<Union >(statement(construct<Union::UnionStmt>("UNION"_tok) ), many(Parser<Map>{}), statement(construct<Union::EndUnionStmt >("END UNION"_tok))))))))}; return parser.Parse(state); } | |||
1270 | statement(construct<Union::EndUnionStmt>("END UNION"_tok))))template <> auto Parser<typename decltype(attempt(instrumented ((("UNION definition"_en_US)), inContext((("UNION definition"_en_US )), ((construct<Union>(statement(construct<Union::UnionStmt >("UNION"_tok)), many(Parser<Map>{}), statement(construct <Union::EndUnionStmt>("END UNION"_tok)))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("UNION definition"_en_US )), inContext((("UNION definition"_en_US)), ((construct<Union >(statement(construct<Union::UnionStmt>("UNION"_tok) ), many(Parser<Map>{}), statement(construct<Union::EndUnionStmt >("END UNION"_tok))))))))}; return parser.Parse(state); } | |||
1271 | ||||
1272 | TYPE_CONTEXT_PARSER("MAP definition"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("MAP definition"_en_US)), inContext((("MAP definition"_en_US )), ((construct<Map>(statement(construct<Map::MapStmt >("MAP"_tok)), many(Parser<StructureField>{}), statement (construct<Map::EndMapStmt>("END MAP"_tok)))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("MAP definition"_en_US )), inContext((("MAP definition"_en_US)), ((construct<Map> (statement(construct<Map::MapStmt>("MAP"_tok)), many(Parser <StructureField>{}), statement(construct<Map::EndMapStmt >("END MAP"_tok))))))))}; return parser.Parse(state); } | |||
1273 | construct<Map>(statement(construct<Map::MapStmt>("MAP"_tok)),template <> auto Parser<typename decltype(attempt(instrumented ((("MAP definition"_en_US)), inContext((("MAP definition"_en_US )), ((construct<Map>(statement(construct<Map::MapStmt >("MAP"_tok)), many(Parser<StructureField>{}), statement (construct<Map::EndMapStmt>("END MAP"_tok)))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("MAP definition"_en_US )), inContext((("MAP definition"_en_US)), ((construct<Map> (statement(construct<Map::MapStmt>("MAP"_tok)), many(Parser <StructureField>{}), statement(construct<Map::EndMapStmt >("END MAP"_tok))))))))}; return parser.Parse(state); } | |||
1274 | many(Parser<StructureField>{}),template <> auto Parser<typename decltype(attempt(instrumented ((("MAP definition"_en_US)), inContext((("MAP definition"_en_US )), ((construct<Map>(statement(construct<Map::MapStmt >("MAP"_tok)), many(Parser<StructureField>{}), statement (construct<Map::EndMapStmt>("END MAP"_tok)))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("MAP definition"_en_US )), inContext((("MAP definition"_en_US)), ((construct<Map> (statement(construct<Map::MapStmt>("MAP"_tok)), many(Parser <StructureField>{}), statement(construct<Map::EndMapStmt >("END MAP"_tok))))))))}; return parser.Parse(state); } | |||
1275 | statement(construct<Map::EndMapStmt>("END MAP"_tok))))template <> auto Parser<typename decltype(attempt(instrumented ((("MAP definition"_en_US)), inContext((("MAP definition"_en_US )), ((construct<Map>(statement(construct<Map::MapStmt >("MAP"_tok)), many(Parser<StructureField>{}), statement (construct<Map::EndMapStmt>("END MAP"_tok)))))))))::resultType >::Parse( ParseState &state) ->std::optional<resultType > { static constexpr auto parser{(instrumented((("MAP definition"_en_US )), inContext((("MAP definition"_en_US)), ((construct<Map> (statement(construct<Map::MapStmt>("MAP"_tok)), many(Parser <StructureField>{}), statement(construct<Map::EndMapStmt >("END MAP"_tok))))))))}; return parser.Parse(state); } | |||
1276 | ||||
1277 | TYPE_CONTEXT_PARSER("arithmetic IF statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("arithmetic IF statement"_en_US)), inContext((("arithmetic IF statement"_en_US )), ((deprecated<LanguageFeature::ArithmeticIF>(construct <ArithmeticIfStmt>( "IF" >> parenthesized(expr), label / ",", label / ",", label))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("arithmetic IF statement"_en_US) ), inContext((("arithmetic IF statement"_en_US)), ((deprecated <LanguageFeature::ArithmeticIF>(construct<ArithmeticIfStmt >( "IF" >> parenthesized(expr), label / ",", label / ",", label)))))))}; return parser.Parse(state); } | |||
1278 | deprecated<LanguageFeature::ArithmeticIF>(construct<ArithmeticIfStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("arithmetic IF statement"_en_US)), inContext((("arithmetic IF statement"_en_US )), ((deprecated<LanguageFeature::ArithmeticIF>(construct <ArithmeticIfStmt>( "IF" >> parenthesized(expr), label / ",", label / ",", label))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("arithmetic IF statement"_en_US) ), inContext((("arithmetic IF statement"_en_US)), ((deprecated <LanguageFeature::ArithmeticIF>(construct<ArithmeticIfStmt >( "IF" >> parenthesized(expr), label / ",", label / ",", label)))))))}; return parser.Parse(state); } | |||
1279 | "IF" >> parenthesized(expr), label / ",", label / ",", label)))template <> auto Parser<typename decltype(attempt(instrumented ((("arithmetic IF statement"_en_US)), inContext((("arithmetic IF statement"_en_US )), ((deprecated<LanguageFeature::ArithmeticIF>(construct <ArithmeticIfStmt>( "IF" >> parenthesized(expr), label / ",", label / ",", label))))))))::resultType>::Parse( ParseState &state) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("arithmetic IF statement"_en_US) ), inContext((("arithmetic IF statement"_en_US)), ((deprecated <LanguageFeature::ArithmeticIF>(construct<ArithmeticIfStmt >( "IF" >> parenthesized(expr), label / ",", label / ",", label)))))))}; return parser.Parse(state); } | |||
1280 | ||||
1281 | TYPE_CONTEXT_PARSER("ASSIGN statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("ASSIGN statement"_en_US)), inContext((("ASSIGN statement"_en_US )), ((deprecated<LanguageFeature::Assign>( construct< AssignStmt>("ASSIGN" >> label, "TO" >> name))) )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( instrumented((("ASSIGN statement"_en_US)), inContext((("ASSIGN statement"_en_US )), ((deprecated<LanguageFeature::Assign>( construct< AssignStmt>("ASSIGN" >> label, "TO" >> name))) ))))}; return parser.Parse(state); } | |||
1282 | deprecated<LanguageFeature::Assign>(template <> auto Parser<typename decltype(attempt(instrumented ((("ASSIGN statement"_en_US)), inContext((("ASSIGN statement"_en_US )), ((deprecated<LanguageFeature::Assign>( construct< AssignStmt>("ASSIGN" >> label, "TO" >> name))) )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( instrumented((("ASSIGN statement"_en_US)), inContext((("ASSIGN statement"_en_US )), ((deprecated<LanguageFeature::Assign>( construct< AssignStmt>("ASSIGN" >> label, "TO" >> name))) ))))}; return parser.Parse(state); } | |||
1283 | construct<AssignStmt>("ASSIGN" >> label, "TO" >> name)))template <> auto Parser<typename decltype(attempt(instrumented ((("ASSIGN statement"_en_US)), inContext((("ASSIGN statement"_en_US )), ((deprecated<LanguageFeature::Assign>( construct< AssignStmt>("ASSIGN" >> label, "TO" >> name))) )))))::resultType>::Parse( ParseState &state) ->std ::optional<resultType> { static constexpr auto parser{( instrumented((("ASSIGN statement"_en_US)), inContext((("ASSIGN statement"_en_US )), ((deprecated<LanguageFeature::Assign>( construct< AssignStmt>("ASSIGN" >> label, "TO" >> name))) ))))}; return parser.Parse(state); } | |||
1284 | ||||
1285 | TYPE_CONTEXT_PARSER("assigned GOTO statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("assigned GOTO statement"_en_US)), inContext((("assigned GOTO statement"_en_US )), ((deprecated<LanguageFeature::AssignedGOTO>(construct <AssignedGotoStmt>( "GO TO" >> name, defaulted(maybe (","_tok) >> parenthesized(nonemptyList("expected labels"_err_en_US , label)))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("assigned GOTO statement"_en_US)), inContext ((("assigned GOTO statement"_en_US)), ((deprecated<LanguageFeature ::AssignedGOTO>(construct<AssignedGotoStmt>( "GO TO" >> name, defaulted(maybe(","_tok) >> parenthesized (nonemptyList("expected labels"_err_en_US, label))))))))))}; return parser.Parse(state); } | |||
| ||||
1286 | deprecated<LanguageFeature::AssignedGOTO>(construct<AssignedGotoStmt>(template <> auto Parser<typename decltype(attempt(instrumented ((("assigned GOTO statement"_en_US)), inContext((("assigned GOTO statement"_en_US )), ((deprecated<LanguageFeature::AssignedGOTO>(construct <AssignedGotoStmt>( "GO TO" >> name, defaulted(maybe (","_tok) >> parenthesized(nonemptyList("expected labels"_err_en_US , label)))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("assigned GOTO statement"_en_US)), inContext ((("assigned GOTO statement"_en_US)), ((deprecated<LanguageFeature ::AssignedGOTO>(construct<AssignedGotoStmt>( "GO TO" >> name, defaulted(maybe(","_tok) >> parenthesized (nonemptyList("expected labels"_err_en_US, label))))))))))}; return parser.Parse(state); } | |||
1287 | "GO TO" >> name,template <> auto Parser<typename decltype(attempt(instrumented ((("assigned GOTO statement"_en_US)), inContext((("assigned GOTO statement"_en_US )), ((deprecated<LanguageFeature::AssignedGOTO>(construct <AssignedGotoStmt>( "GO TO" >> name, defaulted(maybe (","_tok) >> parenthesized(nonemptyList("expected labels"_err_en_US , label)))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("assigned GOTO statement"_en_US)), inContext ((("assigned GOTO statement"_en_US)), ((deprecated<LanguageFeature ::AssignedGOTO>(construct<AssignedGotoStmt>( "GO TO" >> name, defaulted(maybe(","_tok) >> parenthesized (nonemptyList("expected labels"_err_en_US, label))))))))))}; return parser.Parse(state); } | |||
1288 | defaulted(maybe(","_tok) >>template <> auto Parser<typename decltype(attempt(instrumented ((("assigned GOTO statement"_en_US)), inContext((("assigned GOTO statement"_en_US )), ((deprecated<LanguageFeature::AssignedGOTO>(construct <AssignedGotoStmt>( "GO TO" >> name, defaulted(maybe (","_tok) >> parenthesized(nonemptyList("expected labels"_err_en_US , label)))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("assigned GOTO statement"_en_US)), inContext ((("assigned GOTO statement"_en_US)), ((deprecated<LanguageFeature ::AssignedGOTO>(construct<AssignedGotoStmt>( "GO TO" >> name, defaulted(maybe(","_tok) >> parenthesized (nonemptyList("expected labels"_err_en_US, label))))))))))}; return parser.Parse(state); } | |||
1289 | parenthesized(nonemptyList("expected labels"_err_en_US, label))))))template <> auto Parser<typename decltype(attempt(instrumented ((("assigned GOTO statement"_en_US)), inContext((("assigned GOTO statement"_en_US )), ((deprecated<LanguageFeature::AssignedGOTO>(construct <AssignedGotoStmt>( "GO TO" >> name, defaulted(maybe (","_tok) >> parenthesized(nonemptyList("expected labels"_err_en_US , label)))))))))))::resultType>::Parse( ParseState &state ) ->std::optional<resultType> { static constexpr auto parser{(instrumented((("assigned GOTO statement"_en_US)), inContext ((("assigned GOTO statement"_en_US)), ((deprecated<LanguageFeature ::AssignedGOTO>(construct<AssignedGotoStmt>( "GO TO" >> name, defaulted(maybe(","_tok) >> parenthesized (nonemptyList("expected labels"_err_en_US, label))))))))))}; return parser.Parse(state); } | |||
1290 | ||||
1291 | TYPE_CONTEXT_PARSER("PAUSE statement"_en_US,template <> auto Parser<typename decltype(attempt(instrumented ((("PAUSE statement"_en_US)), inContext((("PAUSE statement"_en_US )), ((deprecated<LanguageFeature::Pause>( construct< PauseStmt>("PAUSE" >> maybe(Parser<StopCode>{} )))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("PAUSE statement"_en_US)), inContext((("PAUSE statement"_en_US )), ((deprecated<LanguageFeature::Pause>( construct< PauseStmt>("PAUSE" >> maybe(Parser<StopCode>{} ))))))))}; return parser.Parse(state); } | |||
1292 | deprecated<LanguageFeature::Pause>(template <> auto Parser<typename decltype(attempt(instrumented ((("PAUSE statement"_en_US)), inContext((("PAUSE statement"_en_US )), ((deprecated<LanguageFeature::Pause>( construct< PauseStmt>("PAUSE" >> maybe(Parser<StopCode>{} )))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("PAUSE statement"_en_US)), inContext((("PAUSE statement"_en_US )), ((deprecated<LanguageFeature::Pause>( construct< PauseStmt>("PAUSE" >> maybe(Parser<StopCode>{} ))))))))}; return parser.Parse(state); } | |||
1293 | construct<PauseStmt>("PAUSE" >> maybe(Parser<StopCode>{}))))template <> auto Parser<typename decltype(attempt(instrumented ((("PAUSE statement"_en_US)), inContext((("PAUSE statement"_en_US )), ((deprecated<LanguageFeature::Pause>( construct< PauseStmt>("PAUSE" >> maybe(Parser<StopCode>{} )))))))))::resultType>::Parse( ParseState &state) -> std::optional<resultType> { static constexpr auto parser {(instrumented((("PAUSE statement"_en_US)), inContext((("PAUSE statement"_en_US )), ((deprecated<LanguageFeature::Pause>( construct< PauseStmt>("PAUSE" >> maybe(Parser<StopCode>{} ))))))))}; return parser.Parse(state); } | |||
1294 | ||||
1295 | // These requirement productions are defined by the Fortran standard but never | |||
1296 | // used directly by the grammar: | |||
1297 | // R620 delimiter -> ( | ) | / | [ | ] | (/ | /) | |||
1298 | // R1027 numeric-expr -> expr | |||
1299 | // R1031 int-constant-expr -> int-expr | |||
1300 | // R1221 dtv-type-spec -> TYPE ( derived-type-spec ) | | |||
1301 | // CLASS ( derived-type-spec ) | |||
1302 | // | |||
1303 | // These requirement productions are defined and used, but need not be | |||
1304 | // defined independently here in this file: | |||
1305 | // R771 lbracket -> [ | |||
1306 | // R772 rbracket -> ] | |||
1307 | // | |||
1308 | // Further note that: | |||
1309 | // R607 int-constant -> constant | |||
1310 | // is used only once via R844 scalar-int-constant | |||
1311 | // R904 logical-variable -> variable | |||
1312 | // is used only via scalar-logical-variable | |||
1313 | // R906 default-char-variable -> variable | |||
1314 | // is used only via scalar-default-char-variable | |||
1315 | // R907 int-variable -> variable | |||
1316 | // is used only via scalar-int-variable | |||
1317 | // R915 complex-part-designator -> designator % RE | designator % IM | |||
1318 | // %RE and %IM are initially recognized as structure components | |||
1319 | // R916 type-param-inquiry -> designator % type-param-name | |||
1320 | // is occulted by structure component designators | |||
1321 | // R918 array-section -> | |||
1322 | // data-ref [( substring-range )] | complex-part-designator | |||
1323 | // is not used because parsing is not sensitive to rank | |||
1324 | // R1030 default-char-constant-expr -> default-char-expr | |||
1325 | // is only used via scalar-default-char-constant-expr | |||
1326 | } // namespace Fortran::parser |
1 | //===-- include/flang/Parser/instrumented-parser.h --------------*- C++ -*-===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #ifndef FORTRAN_PARSER_INSTRUMENTED_PARSER_H_ |
10 | #define FORTRAN_PARSER_INSTRUMENTED_PARSER_H_ |
11 | |
12 | #include "parse-state.h" |
13 | #include "user-state.h" |
14 | #include "flang/Parser/message.h" |
15 | #include "flang/Parser/provenance.h" |
16 | #include <cstddef> |
17 | #include <map> |
18 | |
19 | namespace llvm { |
20 | class raw_ostream; |
21 | } |
22 | |
23 | namespace Fortran::parser { |
24 | |
25 | class ParsingLog { |
26 | public: |
27 | ParsingLog() {} |
28 | |
29 | void clear(); |
30 | |
31 | bool Fails(const char *at, const MessageFixedText &tag, ParseState &); |
32 | void Note(const char *at, const MessageFixedText &tag, bool pass, |
33 | const ParseState &); |
34 | void Dump(llvm::raw_ostream &, const AllCookedSources &) const; |
35 | |
36 | private: |
37 | struct LogForPosition { |
38 | struct Entry { |
39 | Entry() {} |
40 | bool pass{true}; |
41 | int count{0}; |
42 | bool deferred{false}; |
43 | Messages messages; |
44 | }; |
45 | std::map<MessageFixedText, Entry> perTag; |
46 | }; |
47 | std::map<std::size_t, LogForPosition> perPos_; |
48 | }; |
49 | |
50 | template <typename PA> class InstrumentedParser { |
51 | public: |
52 | using resultType = typename PA::resultType; |
53 | constexpr InstrumentedParser(const InstrumentedParser &) = default; |
54 | constexpr InstrumentedParser(const MessageFixedText &tag, const PA &parser) |
55 | : tag_{tag}, parser_{parser} {} |
56 | std::optional<resultType> Parse(ParseState &state) const { |
57 | if (UserState * ustate{state.userState()}) { |
58 | if (ParsingLog * log{ustate->log()}) { |
59 | const char *at{state.GetLocation()}; |
60 | if (log->Fails(at, tag_, state)) { |
61 | return std::nullopt; |
62 | } |
63 | Messages messages{std::move(state.messages())}; |
64 | std::optional<resultType> result{parser_.Parse(state)}; |
65 | log->Note(at, tag_, result.has_value(), state); |
66 | state.messages().Annex(std::move(messages)); |
67 | return result; |
68 | } |
69 | } |
70 | return parser_.Parse(state); |
71 | } |
72 | |
73 | private: |
74 | const MessageFixedText tag_; |
75 | const PA parser_; |
76 | }; |
77 | |
78 | template <typename PA> |
79 | inline constexpr auto instrumented( |
80 | const MessageFixedText &tag, const PA &parser) { |
81 | return InstrumentedParser{tag, parser}; |
82 | } |
83 | } // namespace Fortran::parser |
84 | #endif // FORTRAN_PARSER_INSTRUMENTED_PARSER_H_ |
1 | //===-- lib/Parser/basic-parsers.h ------------------------------*- C++ -*-===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #ifndef FORTRAN_PARSER_BASIC_PARSERS_H_ |
10 | #define FORTRAN_PARSER_BASIC_PARSERS_H_ |
11 | |
12 | // Let a "parser" be an instance of any class that supports this |
13 | // type definition and member (or static) function: |
14 | // |
15 | // using resultType = ...; |
16 | // std::optional<resultType> Parse(ParseState &) const; |
17 | // |
18 | // which either returns a value to signify a successful recognition or else |
19 | // returns {} to signify failure. On failure, the state cannot be assumed |
20 | // to still be valid, in general -- see below for exceptions. |
21 | // |
22 | // This header defines the fundamental parser class templates and helper |
23 | // template functions. See parser-combinators.txt for documentation. |
24 | |
25 | #include "flang/Common/Fortran-features.h" |
26 | #include "flang/Common/idioms.h" |
27 | #include "flang/Common/indirection.h" |
28 | #include "flang/Parser/char-block.h" |
29 | #include "flang/Parser/message.h" |
30 | #include "flang/Parser/parse-state.h" |
31 | #include "flang/Parser/provenance.h" |
32 | #include "flang/Parser/user-state.h" |
33 | #include <cstring> |
34 | #include <functional> |
35 | #include <list> |
36 | #include <memory> |
37 | #include <optional> |
38 | #include <string> |
39 | #include <tuple> |
40 | #include <type_traits> |
41 | #include <utility> |
42 | |
43 | namespace Fortran::parser { |
44 | |
45 | // fail<A>("..."_err_en_US) returns a parser that never succeeds. It reports an |
46 | // error message at the current position. The result type is unused, |
47 | // but might have to be specified at the point of call to satisfy |
48 | // the type checker. The state remains valid. |
49 | template <typename A> class FailParser { |
50 | public: |
51 | using resultType = A; |
52 | constexpr FailParser(const FailParser &) = default; |
53 | constexpr explicit FailParser(MessageFixedText t) : text_{t} {} |
54 | std::optional<A> Parse(ParseState &state) const { |
55 | state.Say(text_); |
56 | return std::nullopt; |
57 | } |
58 | |
59 | private: |
60 | const MessageFixedText text_; |
61 | }; |
62 | |
63 | template <typename A = Success> inline constexpr auto fail(MessageFixedText t) { |
64 | return FailParser<A>{t}; |
65 | } |
66 | |
67 | // pure(x) returns a parser that always succeeds, does not advance the |
68 | // parse, and returns a captured value x whose type must be copy-constructible. |
69 | // |
70 | // pure<A>() is essentially pure(A{}); it returns a default-constructed A{}, |
71 | // and works even when A is not copy-constructible. |
72 | template <typename A> class PureParser { |
73 | public: |
74 | using resultType = A; |
75 | constexpr PureParser(const PureParser &) = default; |
76 | constexpr explicit PureParser(A &&x) : value_(std::move(x)) {} |
77 | std::optional<A> Parse(ParseState &) const { return value_; } |
78 | |
79 | private: |
80 | const A value_; |
81 | }; |
82 | |
83 | template <typename A> inline constexpr auto pure(A x) { |
84 | return PureParser<A>(std::move(x)); |
85 | } |
86 | |
87 | template <typename A> class PureDefaultParser { |
88 | public: |
89 | using resultType = A; |
90 | constexpr PureDefaultParser(const PureDefaultParser &) = default; |
91 | constexpr PureDefaultParser() {} |
92 | std::optional<A> Parse(ParseState &) const { return std::make_optional<A>(); } |
93 | }; |
94 | |
95 | template <typename A> inline constexpr auto pure() { |
96 | return PureDefaultParser<A>(); |
97 | } |
98 | |
99 | // If a is a parser, attempt(a) is the same parser, but on failure |
100 | // the ParseState is guaranteed to have been restored to its initial value. |
101 | template <typename A> class BacktrackingParser { |
102 | public: |
103 | using resultType = typename A::resultType; |
104 | constexpr BacktrackingParser(const BacktrackingParser &) = default; |
105 | constexpr BacktrackingParser(const A &parser) : parser_{parser} {} |
106 | std::optional<resultType> Parse(ParseState &state) const { |
107 | Messages messages{std::move(state.messages())}; |
108 | ParseState backtrack{state}; |
109 | std::optional<resultType> result{parser_.Parse(state)}; |
110 | if (result) { |
111 | state.messages().Annex(std::move(messages)); |
112 | } else { |
113 | state = std::move(backtrack); |
114 | state.messages() = std::move(messages); |
115 | } |
116 | return result; |
117 | } |
118 | |
119 | private: |
120 | const A parser_; |
121 | }; |
122 | |
123 | template <typename A> inline constexpr auto attempt(const A &parser) { |
124 | return BacktrackingParser<A>{parser}; |
125 | } |
126 | |
127 | // For any parser x, the parser returned by !x is one that succeeds when |
128 | // x fails, returning a useless (but present) result. !x fails when x succeeds. |
129 | template <typename PA> class NegatedParser { |
130 | public: |
131 | using resultType = Success; |
132 | constexpr NegatedParser(const NegatedParser &) = default; |
133 | constexpr NegatedParser(PA p) : parser_{p} {} |
134 | std::optional<Success> Parse(ParseState &state) const { |
135 | ParseState forked{state}; |
136 | forked.set_deferMessages(true); |
137 | if (parser_.Parse(forked)) { |
138 | return std::nullopt; |
139 | } |
140 | return Success{}; |
141 | } |
142 | |
143 | private: |
144 | const PA parser_; |
145 | }; |
146 | |
147 | template <typename PA, typename = typename PA::resultType> |
148 | constexpr auto operator!(PA p) { |
149 | return NegatedParser<PA>(p); |
150 | } |
151 | |
152 | // For any parser x, the parser returned by lookAhead(x) is one that succeeds |
153 | // or fails if x does, but the state is not modified. |
154 | template <typename PA> class LookAheadParser { |
155 | public: |
156 | using resultType = Success; |
157 | constexpr LookAheadParser(const LookAheadParser &) = default; |
158 | constexpr LookAheadParser(PA p) : parser_{p} {} |
159 | std::optional<Success> Parse(ParseState &state) const { |
160 | ParseState forked{state}; |
161 | forked.set_deferMessages(true); |
162 | if (parser_.Parse(forked)) { |
163 | return Success{}; |
164 | } |
165 | return std::nullopt; |
166 | } |
167 | |
168 | private: |
169 | const PA parser_; |
170 | }; |
171 | |
172 | template <typename PA> inline constexpr auto lookAhead(PA p) { |
173 | return LookAheadParser<PA>{p}; |
174 | } |
175 | |
176 | // If a is a parser, inContext("..."_en_US, a) runs it in a nested message |
177 | // context. |
178 | template <typename PA> class MessageContextParser { |
179 | public: |
180 | using resultType = typename PA::resultType; |
181 | constexpr MessageContextParser(const MessageContextParser &) = default; |
182 | constexpr MessageContextParser(MessageFixedText t, PA p) |
183 | : text_{t}, parser_{p} {} |
184 | std::optional<resultType> Parse(ParseState &state) const { |
185 | state.PushContext(text_); |
186 | std::optional<resultType> result{parser_.Parse(state)}; |
187 | state.PopContext(); |
188 | return result; |
189 | } |
190 | |
191 | private: |
192 | const MessageFixedText text_; |
193 | const PA parser_; |
194 | }; |
195 | |
196 | template <typename PA> |
197 | inline constexpr auto inContext(MessageFixedText context, PA parser) { |
198 | return MessageContextParser{context, parser}; |
199 | } |
200 | |
201 | // If a is a parser, withMessage("..."_en_US, a) runs it unchanged if it |
202 | // succeeds, and overrides its messages with a specific one if it fails and |
203 | // has matched no tokens. |
204 | template <typename PA> class WithMessageParser { |
205 | public: |
206 | using resultType = typename PA::resultType; |
207 | constexpr WithMessageParser(const WithMessageParser &) = default; |
208 | constexpr WithMessageParser(MessageFixedText t, PA p) |
209 | : text_{t}, parser_{p} {} |
210 | std::optional<resultType> Parse(ParseState &state) const { |
211 | if (state.deferMessages()) { // fast path |
212 | std::optional<resultType> result{parser_.Parse(state)}; |
213 | if (!result) { |
214 | state.set_anyDeferredMessages(); |
215 | } |
216 | return result; |
217 | } |
218 | Messages messages{std::move(state.messages())}; |
219 | bool hadAnyTokenMatched{state.anyTokenMatched()}; |
220 | state.set_anyTokenMatched(false); |
221 | std::optional<resultType> result{parser_.Parse(state)}; |
222 | bool emitMessage{false}; |
223 | if (result) { |
224 | messages.Annex(std::move(state.messages())); |
225 | if (hadAnyTokenMatched) { |
226 | state.set_anyTokenMatched(); |
227 | } |
228 | } else if (state.anyTokenMatched()) { |
229 | emitMessage = state.messages().empty(); |
230 | messages.Annex(std::move(state.messages())); |
231 | } else { |
232 | emitMessage = true; |
233 | if (hadAnyTokenMatched) { |
234 | state.set_anyTokenMatched(); |
235 | } |
236 | } |
237 | state.messages() = std::move(messages); |
238 | if (emitMessage) { |
239 | state.Say(text_); |
240 | } |
241 | return result; |
242 | } |
243 | |
244 | private: |
245 | const MessageFixedText text_; |
246 | const PA parser_; |
247 | }; |
248 | |
249 | template <typename PA> |
250 | inline constexpr auto withMessage(MessageFixedText msg, PA parser) { |
251 | return WithMessageParser{msg, parser}; |
252 | } |
253 | |
254 | // If a and b are parsers, then a >> b returns a parser that succeeds when |
255 | // b succeeds after a does so, but fails when either a or b does. The |
256 | // result is taken from b. Similarly, a / b also succeeds if both a and b |
257 | // do so, but the result is that returned by a. |
258 | template <typename PA, typename PB> class SequenceParser { |
259 | public: |
260 | using resultType = typename PB::resultType; |
261 | constexpr SequenceParser(const SequenceParser &) = default; |
262 | constexpr SequenceParser(PA pa, PB pb) : pa_{pa}, pb2_{pb} {} |
263 | std::optional<resultType> Parse(ParseState &state) const { |
264 | if (pa_.Parse(state)) { |
265 | return pb2_.Parse(state); |
266 | } else { |
267 | return std::nullopt; |
268 | } |
269 | } |
270 | |
271 | private: |
272 | const PA pa_; |
273 | const PB pb2_; |
274 | }; |
275 | |
276 | template <typename PA, typename PB> |
277 | inline constexpr auto operator>>(PA pa, PB pb) { |
278 | return SequenceParser<PA, PB>{pa, pb}; |
279 | } |
280 | |
281 | template <typename PA, typename PB> class FollowParser { |
282 | public: |
283 | using resultType = typename PA::resultType; |
284 | constexpr FollowParser(const FollowParser &) = default; |
285 | constexpr FollowParser(PA pa, PB pb) : pa_{pa}, pb_{pb} {} |
286 | std::optional<resultType> Parse(ParseState &state) const { |
287 | if (std::optional<resultType> ax{pa_.Parse(state)}) { |
288 | if (pb_.Parse(state)) { |
289 | return ax; |
290 | } |
291 | } |
292 | return std::nullopt; |
293 | } |
294 | |
295 | private: |
296 | const PA pa_; |
297 | const PB pb_; |
298 | }; |
299 | |
300 | template <typename PA, typename PB> |
301 | inline constexpr auto operator/(PA pa, PB pb) { |
302 | return FollowParser<PA, PB>{pa, pb}; |
303 | } |
304 | |
305 | template <typename PA, typename... Ps> class AlternativesParser { |
306 | public: |
307 | using resultType = typename PA::resultType; |
308 | constexpr AlternativesParser(PA pa, Ps... ps) : ps_{pa, ps...} {} |
309 | constexpr AlternativesParser(const AlternativesParser &) = default; |
310 | std::optional<resultType> Parse(ParseState &state) const { |
311 | Messages messages{std::move(state.messages())}; |
312 | ParseState backtrack{state}; |
313 | std::optional<resultType> result{std::get<0>(ps_).Parse(state)}; |
314 | if constexpr (sizeof...(Ps) > 0) { |
315 | if (!result) { |
316 | ParseRest<1>(result, state, backtrack); |
317 | } |
318 | } |
319 | state.messages().Annex(std::move(messages)); |
320 | return result; |
321 | } |
322 | |
323 | private: |
324 | template <int J> |
325 | void ParseRest(std::optional<resultType> &result, ParseState &state, |
326 | ParseState &backtrack) const { |
327 | ParseState prevState{std::move(state)}; |
328 | state = backtrack; |
329 | result = std::get<J>(ps_).Parse(state); |
330 | if (!result) { |
331 | state.CombineFailedParses(std::move(prevState)); |
332 | if constexpr (J < sizeof...(Ps)) { |
333 | ParseRest<J + 1>(result, state, backtrack); |
334 | } |
335 | } |
336 | } |
337 | |
338 | const std::tuple<PA, Ps...> ps_; |
339 | }; |
340 | |
341 | template <typename... Ps> inline constexpr auto first(Ps... ps) { |
342 | return AlternativesParser<Ps...>{ps...}; |
343 | } |
344 | |
345 | template <typename PA, typename PB> |
346 | inline constexpr auto operator||(PA pa, PB pb) { |
347 | return AlternativesParser<PA, PB>{pa, pb}; |
348 | } |
349 | |
350 | // If a and b are parsers, then recovery(a,b) returns a parser that succeeds if |
351 | // a does so, or if a fails and b succeeds. If a succeeds, b is not attempted. |
352 | // All messages from the first parse are retained. |
353 | // The two parsers must return values of the same type. |
354 | template <typename PA, typename PB> class RecoveryParser { |
355 | public: |
356 | using resultType = typename PA::resultType; |
357 | static_assert(std::is_same_v<resultType, typename PB::resultType>); |
358 | constexpr RecoveryParser(const RecoveryParser &) = default; |
359 | constexpr RecoveryParser(PA pa, PB pb) : pa_{pa}, pb_{pb} {} |
360 | std::optional<resultType> Parse(ParseState &state) const { |
361 | bool originallyDeferred{state.deferMessages()}; |
362 | ParseState backtrack{state}; |
363 | if (!originallyDeferred && state.messages().empty() && |
364 | !state.anyErrorRecovery()) { |
365 | // Fast path. There are no messages or recovered errors in the incoming |
366 | // state. Attempt to parse with messages deferred, expecting that the |
367 | // parse will succeed silently. |
368 | state.set_deferMessages(true); |
369 | if (std::optional<resultType> ax{pa_.Parse(state)}) { |
370 | if (!state.anyDeferredMessages() && !state.anyErrorRecovery()) { |
371 | state.set_deferMessages(false); |
372 | return ax; |
373 | } |
374 | } |
375 | state = backtrack; |
376 | } |
377 | Messages messages{std::move(state.messages())}; |
378 | if (std::optional<resultType> ax{pa_.Parse(state)}) { |
379 | state.messages().Annex(std::move(messages)); |
380 | return ax; |
381 | } |
382 | messages.Annex(std::move(state.messages())); |
383 | bool hadDeferredMessages{state.anyDeferredMessages()}; |
384 | bool anyTokenMatched{state.anyTokenMatched()}; |
385 | state = std::move(backtrack); |
386 | state.set_deferMessages(true); |
387 | std::optional<resultType> bx{pb_.Parse(state)}; |
388 | state.messages() = std::move(messages); |
389 | state.set_deferMessages(originallyDeferred); |
390 | if (anyTokenMatched) { |
391 | state.set_anyTokenMatched(); |
392 | } |
393 | if (hadDeferredMessages) { |
394 | state.set_anyDeferredMessages(); |
395 | } |
396 | if (bx) { |
397 | // Error recovery situations must also produce messages. |
398 | CHECK(state.anyDeferredMessages() || state.messages().AnyFatalError())((state.anyDeferredMessages() || state.messages().AnyFatalError ()) || (Fortran::common::die("CHECK(" "state.anyDeferredMessages() || state.messages().AnyFatalError()" ") failed" " at " "flang/lib/Parser/basic-parsers.h" "(%d)", 398), false)); |
399 | state.set_anyErrorRecovery(); |
400 | } |
401 | return bx; |
402 | } |
403 | |
404 | private: |
405 | const PA pa_; |
406 | const PB pb_; |
407 | }; |
408 | |
409 | template <typename PA, typename PB> |
410 | inline constexpr auto recovery(PA pa, PB pb) { |
411 | return RecoveryParser<PA, PB>{pa, pb}; |
412 | } |
413 | |
414 | // If x is a parser, then many(x) returns a parser that always succeeds |
415 | // and whose value is a list, possibly empty, of the values returned from |
416 | // repeated application of x until it fails or does not advance the parse. |
417 | template <typename PA> class ManyParser { |
418 | using paType = typename PA::resultType; |
419 | |
420 | public: |
421 | using resultType = std::list<paType>; |
422 | constexpr ManyParser(const ManyParser &) = default; |
423 | constexpr ManyParser(PA parser) : parser_{parser} {} |
424 | std::optional<resultType> Parse(ParseState &state) const { |
425 | resultType result; |
426 | auto at{state.GetLocation()}; |
427 | while (std::optional<paType> x{parser_.Parse(state)}) { |
428 | result.emplace_back(std::move(*x)); |
429 | if (state.GetLocation() <= at) { |
430 | break; // no forward progress, don't loop |
431 | } |
432 | at = state.GetLocation(); |
433 | } |
434 | return {std::move(result)}; |
435 | } |
436 | |
437 | private: |
438 | const BacktrackingParser<PA> parser_; |
439 | }; |
440 | |
441 | template <typename PA> inline constexpr auto many(PA parser) { |
442 | return ManyParser<PA>{parser}; |
443 | } |
444 | |
445 | // If x is a parser, then some(x) returns a parser that succeeds if x does |
446 | // and whose value is a nonempty list of the values returned from repeated |
447 | // application of x until it fails or does not advance the parse. In other |
448 | // words, some(x) is a variant of many(x) that has to succeed at least once. |
449 | template <typename PA> class SomeParser { |
450 | using paType = typename PA::resultType; |
451 | |
452 | public: |
453 | using resultType = std::list<paType>; |
454 | constexpr SomeParser(const SomeParser &) = default; |
455 | constexpr SomeParser(PA parser) : parser_{parser} {} |
456 | std::optional<resultType> Parse(ParseState &state) const { |
457 | auto start{state.GetLocation()}; |
458 | if (std::optional<paType> first{parser_.Parse(state)}) { |
459 | resultType result; |
460 | result.emplace_back(std::move(*first)); |
461 | if (state.GetLocation() > start) { |
462 | result.splice(result.end(), many(parser_).Parse(state).value()); |
463 | } |
464 | return {std::move(result)}; |
465 | } |
466 | return std::nullopt; |
467 | } |
468 | |
469 | private: |
470 | const PA parser_; |
471 | }; |
472 | |
473 | template <typename PA> inline constexpr auto some(PA parser) { |
474 | return SomeParser<PA>{parser}; |
475 | } |
476 | |
477 | // If x is a parser, skipMany(x) is equivalent to many(x) but with no result. |
478 | template <typename PA> class SkipManyParser { |
479 | public: |
480 | using resultType = Success; |
481 | constexpr SkipManyParser(const SkipManyParser &) = default; |
482 | constexpr SkipManyParser(PA parser) : parser_{parser} {} |
483 | std::optional<Success> Parse(ParseState &state) const { |
484 | for (auto at{state.GetLocation()}; |
485 | parser_.Parse(state) && state.GetLocation() > at; |
486 | at = state.GetLocation()) { |
487 | } |
488 | return Success{}; |
489 | } |
490 | |
491 | private: |
492 | const BacktrackingParser<PA> parser_; |
493 | }; |
494 | |
495 | template <typename PA> inline constexpr auto skipMany(PA parser) { |
496 | return SkipManyParser<PA>{parser}; |
497 | } |
498 | |
499 | // If x is a parser, skipManyFast(x) is equivalent to skipMany(x). |
500 | // The parser x must always advance on success and never invalidate the |
501 | // state on failure. |
502 | template <typename PA> class SkipManyFastParser { |
503 | public: |
504 | using resultType = Success; |
505 | constexpr SkipManyFastParser(const SkipManyFastParser &) = default; |
506 | constexpr SkipManyFastParser(PA parser) : parser_{parser} {} |
507 | std::optional<Success> Parse(ParseState &state) const { |
508 | while (parser_.Parse(state)) { |
509 | } |
510 | return Success{}; |
511 | } |
512 | |
513 | private: |
514 | const PA parser_; |
515 | }; |
516 | |
517 | template <typename PA> inline constexpr auto skipManyFast(PA parser) { |
518 | return SkipManyFastParser<PA>{parser}; |
519 | } |
520 | |
521 | // If x is a parser returning some type A, then maybe(x) returns a |
522 | // parser that returns std::optional<A>, always succeeding. |
523 | template <typename PA> class MaybeParser { |
524 | using paType = typename PA::resultType; |
525 | |
526 | public: |
527 | using resultType = std::optional<paType>; |
528 | constexpr MaybeParser(const MaybeParser &) = default; |
529 | constexpr MaybeParser(PA parser) : parser_{parser} {} |
530 | std::optional<resultType> Parse(ParseState &state) const { |
531 | if (resultType result{parser_.Parse(state)}) { |
532 | // permit optional<optional<...>> |
533 | return {std::move(result)}; |
534 | } |
535 | return resultType{}; |
536 | } |
537 | |
538 | private: |
539 | const BacktrackingParser<PA> parser_; |
540 | }; |
541 | |
542 | template <typename PA> inline constexpr auto maybe(PA parser) { |
543 | return MaybeParser<PA>{parser}; |
544 | } |
545 | |
546 | // If x is a parser, then defaulted(x) returns a parser that always |
547 | // succeeds. When x succeeds, its result is that of x; otherwise, its |
548 | // result is a default-constructed value of x's result type. |
549 | template <typename PA> class DefaultedParser { |
550 | public: |
551 | using resultType = typename PA::resultType; |
552 | constexpr DefaultedParser(const DefaultedParser &) = default; |
553 | constexpr DefaultedParser(PA p) : parser_{p} {} |
554 | std::optional<resultType> Parse(ParseState &state) const { |
555 | std::optional<std::optional<resultType>> ax{maybe(parser_).Parse(state)}; |
556 | if (ax.value()) { // maybe() always succeeds |
557 | return std::move(*ax); |
558 | } |
559 | return resultType{}; |
560 | } |
561 | |
562 | private: |
563 | const BacktrackingParser<PA> parser_; |
564 | }; |
565 | |
566 | template <typename PA> inline constexpr auto defaulted(PA p) { |
567 | return DefaultedParser<PA>(p); |
568 | } |
569 | |
570 | // If a is a parser, and f is a function mapping an rvalue of a's result type |
571 | // to some other type T, then applyFunction(f, a) returns a parser that succeeds |
572 | // iff a does, and whose result value ax has been passed through the function; |
573 | // the final result is that returned by the call f(std::move(ax)). |
574 | // |
575 | // Function application is generalized to functions with more than one |
576 | // argument with applyFunction(f, a, b, ...) succeeding if all of the parsers |
577 | // a, b, &c. do so, and the result is the value of applying f to their |
578 | // results. |
579 | // |
580 | // applyLambda(f, ...) is the same concept extended to std::function<> functors. |
581 | // It is not constexpr. |
582 | // |
583 | // Member function application is supported by applyMem(f, a). If the |
584 | // parser a succeeds and returns some value ax, the result is that returned |
585 | // by ax.f(). Additional parser arguments can be specified to supply their |
586 | // results to the member function call, so applyMem(f, a, b) succeeds if |
587 | // both a and b do so and returns the result of calling ax.f(std::move(bx)). |
588 | |
589 | // Runs a sequence of parsers until one fails or all have succeeded. |
590 | // Collects their results in a std::tuple<std::optional<>...>. |
591 | template <typename... PARSER> |
592 | using ApplyArgs = std::tuple<std::optional<typename PARSER::resultType>...>; |
593 | |
594 | template <typename... PARSER, std::size_t... J> |
595 | inline bool ApplyHelperArgs(const std::tuple<PARSER...> &parsers, |
596 | ApplyArgs<PARSER...> &args, ParseState &state, std::index_sequence<J...>) { |
597 | return (... && |
598 | (std::get<J>(args) = std::get<J>(parsers).Parse(state), |
599 | std::get<J>(args).has_value())); |
600 | } |
601 | |
602 | // Applies a function to the arguments collected by ApplyHelperArgs. |
603 | template <typename RESULT, typename... PARSER> |
604 | using ApplicableFunctionPointer = RESULT (*)(typename PARSER::resultType &&...); |
605 | template <typename RESULT, typename... PARSER> |
606 | using ApplicableFunctionObject = |
607 | const std::function<RESULT(typename PARSER::resultType &&...)> &; |
608 | |
609 | template <template <typename...> class FUNCTION, typename RESULT, |
610 | typename... PARSER, std::size_t... J> |
611 | inline RESULT ApplyHelperFunction(FUNCTION<RESULT, PARSER...> f, |
612 | ApplyArgs<PARSER...> &&args, std::index_sequence<J...>) { |
613 | return f(std::move(*std::get<J>(args))...); |
614 | } |
615 | |
616 | template <template <typename...> class FUNCTION, typename RESULT, |
617 | typename... PARSER> |
618 | class ApplyFunction { |
619 | using funcType = FUNCTION<RESULT, PARSER...>; |
620 | |
621 | public: |
622 | using resultType = RESULT; |
623 | constexpr ApplyFunction(const ApplyFunction &) = default; |
624 | constexpr ApplyFunction(funcType f, PARSER... p) |
625 | : function_{f}, parsers_{p...} {} |
626 | std::optional<resultType> Parse(ParseState &state) const { |
627 | ApplyArgs<PARSER...> results; |
628 | using Sequence = std::index_sequence_for<PARSER...>; |
629 | if (ApplyHelperArgs(parsers_, results, state, Sequence{})) { |
630 | return ApplyHelperFunction<FUNCTION, RESULT, PARSER...>( |
631 | function_, std::move(results), Sequence{}); |
632 | } else { |
633 | return std::nullopt; |
634 | } |
635 | } |
636 | |
637 | private: |
638 | const funcType function_; |
639 | const std::tuple<PARSER...> parsers_; |
640 | }; |
641 | |
642 | template <typename RESULT, typename... PARSER> |
643 | inline constexpr auto applyFunction( |
644 | ApplicableFunctionPointer<RESULT, PARSER...> f, const PARSER &...parser) { |
645 | return ApplyFunction<ApplicableFunctionPointer, RESULT, PARSER...>{ |
646 | f, parser...}; |
647 | } |
648 | |
649 | template <typename RESULT, typename... PARSER> |
650 | inline /* not constexpr */ auto applyLambda( |
651 | ApplicableFunctionObject<RESULT, PARSER...> f, const PARSER &...parser) { |
652 | return ApplyFunction<ApplicableFunctionObject, RESULT, PARSER...>{ |
653 | f, parser...}; |
654 | } |
655 | |
656 | // Member function application |
657 | template <typename OBJPARSER, typename... PARSER> class AMFPHelper { |
658 | using resultType = typename OBJPARSER::resultType; |
659 | |
660 | public: |
661 | using type = void (resultType::*)(typename PARSER::resultType &&...); |
662 | }; |
663 | template <typename OBJPARSER, typename... PARSER> |
664 | using ApplicableMemberFunctionPointer = |
665 | typename AMFPHelper<OBJPARSER, PARSER...>::type; |
666 | |
667 | template <typename OBJPARSER, typename... PARSER, std::size_t... J> |
668 | inline auto ApplyHelperMember( |
669 | ApplicableMemberFunctionPointer<OBJPARSER, PARSER...> mfp, |
670 | ApplyArgs<OBJPARSER, PARSER...> &&args, std::index_sequence<J...>) -> |
671 | typename OBJPARSER::resultType { |
672 | ((*std::get<0>(args)).*mfp)(std::move(*std::get<J + 1>(args))...); |
673 | return std::get<0>(std::move(args)); |
674 | } |
675 | |
676 | template <typename OBJPARSER, typename... PARSER> class ApplyMemberFunction { |
677 | using funcType = ApplicableMemberFunctionPointer<OBJPARSER, PARSER...>; |
678 | |
679 | public: |
680 | using resultType = typename OBJPARSER::resultType; |
681 | constexpr ApplyMemberFunction(const ApplyMemberFunction &) = default; |
682 | constexpr ApplyMemberFunction(funcType f, OBJPARSER o, PARSER... p) |
683 | : function_{f}, parsers_{o, p...} {} |
684 | std::optional<resultType> Parse(ParseState &state) const { |
685 | ApplyArgs<OBJPARSER, PARSER...> results; |
686 | using Sequence1 = std::index_sequence_for<OBJPARSER, PARSER...>; |
687 | using Sequence2 = std::index_sequence_for<PARSER...>; |
688 | if (ApplyHelperArgs(parsers_, results, state, Sequence1{})) { |
689 | return ApplyHelperMember<OBJPARSER, PARSER...>( |
690 | function_, std::move(results), Sequence2{}); |
691 | } else { |
692 | return std::nullopt; |
693 | } |
694 | } |
695 | |
696 | private: |
697 | const funcType function_; |
698 | const std::tuple<OBJPARSER, PARSER...> parsers_; |
699 | }; |
700 | |
701 | template <typename OBJPARSER, typename... PARSER> |
702 | inline constexpr auto applyMem( |
703 | ApplicableMemberFunctionPointer<OBJPARSER, PARSER...> mfp, |
704 | const OBJPARSER &objParser, PARSER... parser) { |
705 | return ApplyMemberFunction<OBJPARSER, PARSER...>{mfp, objParser, parser...}; |
706 | } |
707 | |
708 | // As is done with function application via applyFunction() above, class |
709 | // instance construction can also be based upon the results of successful |
710 | // parses. For some type T and zero or more parsers a, b, &c., the call |
711 | // construct<T>(a, b, ...) returns a parser that succeeds if all of |
712 | // its argument parsers do so in succession, and whose result is an |
713 | // instance of T constructed upon the values they returned. |
714 | // With a single argument that is a parser with no usable value, |
715 | // construct<T>(p) invokes T's default nullary constructor (T(){}). |
716 | // (This means that "construct<T>(Foo >> Bar >> ok)" is functionally |
717 | // equivalent to "Foo >> Bar >> construct<T>()", but I'd like to hold open |
718 | // the opportunity to make construct<> capture source provenance all of the |
719 | // time, and the first form will then lead to better error positioning.) |
720 | |
721 | template <typename RESULT, typename... PARSER, std::size_t... J> |
722 | inline RESULT ApplyHelperConstructor( |
723 | ApplyArgs<PARSER...> &&args, std::index_sequence<J...>) { |
724 | return RESULT{std::move(*std::get<J>(args))...}; |
725 | } |
726 | |
727 | template <typename RESULT, typename... PARSER> class ApplyConstructor { |
728 | public: |
729 | using resultType = RESULT; |
730 | constexpr ApplyConstructor(const ApplyConstructor &) = default; |
731 | constexpr explicit ApplyConstructor(PARSER... p) : parsers_{p...} {} |
732 | std::optional<resultType> Parse(ParseState &state) const { |
733 | if constexpr (sizeof...(PARSER) == 0) { |
734 | return RESULT{}; |
735 | } else { |
736 | if constexpr (sizeof...(PARSER) == 1) { |
737 | return ParseOne(state); |
738 | } else { |
739 | ApplyArgs<PARSER...> results; |
740 | using Sequence = std::index_sequence_for<PARSER...>; |
741 | if (ApplyHelperArgs(parsers_, results, state, Sequence{})) { |
742 | return ApplyHelperConstructor<RESULT, PARSER...>( |
743 | std::move(results), Sequence{}); |
744 | } |
745 | } |
746 | return std::nullopt; |
747 | } |
748 | } |
749 | |
750 | private: |
751 | std::optional<resultType> ParseOne(ParseState &state) const { |
752 | if constexpr (std::is_same_v<Success, typename PARSER::resultType...>) { |
753 | if (std::get<0>(parsers_).Parse(state)) { |
754 | return RESULT{}; |
755 | } |
756 | } else if (auto arg{std::get<0>(parsers_).Parse(state)}) { |
757 | return RESULT{std::move(*arg)}; |
758 | } |
759 | return std::nullopt; |
760 | } |
761 | |
762 | const std::tuple<PARSER...> parsers_; |
763 | }; |
764 | |
765 | template <typename RESULT, typename... PARSER> |
766 | inline constexpr auto construct(PARSER... p) { |
767 | return ApplyConstructor<RESULT, PARSER...>{p...}; |
768 | } |
769 | |
770 | // For a parser p, indirect(p) returns a parser that builds an indirect |
771 | // reference to p's return type. |
772 | template <typename PA> inline constexpr auto indirect(PA p) { |
773 | return construct<common::Indirection<typename PA::resultType>>(p); |
774 | } |
775 | |
776 | // If a and b are parsers, then nonemptySeparated(a, b) returns a parser |
777 | // that succeeds if a does. If a succeeds, it then applies many(b >> a). |
778 | // The result is the list of the values returned from all of the applications |
779 | // of a. |
780 | template <typename T> |
781 | common::IfNoLvalue<std::list<T>, T> prepend(T &&head, std::list<T> &&rest) { |
782 | rest.push_front(std::move(head)); |
783 | return std::move(rest); |
784 | } |
785 | |
786 | template <typename PA, typename PB> class NonemptySeparated { |
787 | private: |
788 | using paType = typename PA::resultType; |
789 | |
790 | public: |
791 | using resultType = std::list<paType>; |
792 | constexpr NonemptySeparated(const NonemptySeparated &) = default; |
793 | constexpr NonemptySeparated(PA p, PB sep) : parser_{p}, separator_{sep} {} |
794 | std::optional<resultType> Parse(ParseState &state) const { |
795 | return applyFunction<std::list<paType>>( |
796 | prepend<paType>, parser_, many(separator_ >> parser_)) |
797 | .Parse(state); |
798 | } |
799 | |
800 | private: |
801 | const PA parser_; |
802 | const PB separator_; |
803 | }; |
804 | |
805 | template <typename PA, typename PB> |
806 | inline constexpr auto nonemptySeparated(PA p, PB sep) { |
807 | return NonemptySeparated<PA, PB>{p, sep}; |
808 | } |
809 | |
810 | // ok is a parser that always succeeds. It is useful when a parser |
811 | // must discard its result in order to be compatible in type with other |
812 | // parsers in an alternative, e.g. "x >> ok || y >> ok" is type-safe even |
813 | // when x and y have distinct result types. |
814 | struct OkParser { |
815 | using resultType = Success; |
816 | constexpr OkParser() {} |
817 | static constexpr std::optional<Success> Parse(ParseState &) { |
818 | return Success{}; |
819 | } |
820 | }; |
821 | constexpr OkParser ok; |
822 | |
823 | // A variant of recovery() above for convenience. |
824 | template <typename PA, typename PB> |
825 | inline constexpr auto localRecovery(MessageFixedText msg, PA pa, PB pb) { |
826 | return recovery(withMessage(msg, pa), pb >> pure<typename PA::resultType>()); |
827 | } |
828 | |
829 | // nextCh is a parser that succeeds if the parsing state is not |
830 | // at the end of its input, returning the next character location and |
831 | // advancing the parse when it does so. |
832 | struct NextCh { |
833 | using resultType = const char *; |
834 | constexpr NextCh() {} |
835 | std::optional<const char *> Parse(ParseState &state) const { |
836 | if (std::optional<const char *> result{state.GetNextChar()}) { |
837 | return result; |
838 | } |
839 | state.Say("end of file"_err_en_US); |
840 | return std::nullopt; |
841 | } |
842 | }; |
843 | |
844 | constexpr NextCh nextCh; |
845 | |
846 | // If a is a parser for some nonstandard language feature LF, extension<LF>(a) |
847 | // is a parser that optionally enabled, sets a strict conformance violation |
848 | // flag, and may emit a warning message, if those are enabled. |
849 | template <LanguageFeature LF, typename PA> class NonstandardParser { |
850 | public: |
851 | using resultType = typename PA::resultType; |
852 | constexpr NonstandardParser(const NonstandardParser &) = default; |
853 | constexpr NonstandardParser(PA parser, MessageFixedText msg) |
854 | : parser_{parser}, message_{msg} {} |
855 | std::optional<resultType> Parse(ParseState &state) const { |
856 | if (UserState * ustate{state.userState()}) { |
857 | if (!ustate->features().IsEnabled(LF)) { |
858 | return std::nullopt; |
859 | } |
860 | } |
861 | auto at{state.GetLocation()}; |
862 | auto result{parser_.Parse(state)}; |
863 | if (result) { |
864 | state.Nonstandard( |
865 | CharBlock{at, std::max(state.GetLocation(), at + 1)}, LF, message_); |
866 | } |
867 | return result; |
868 | } |
869 | |
870 | private: |
871 | const PA parser_; |
872 | const MessageFixedText message_; |
873 | }; |
874 | |
875 | template <LanguageFeature LF, typename PA> |
876 | inline constexpr auto extension(MessageFixedText feature, PA parser) { |
877 | return NonstandardParser<LF, PA>(parser, feature); |
878 | } |
879 | |
880 | // If a is a parser for some deprecated or deleted language feature LF, |
881 | // deprecated<LF>(a) is a parser that is optionally enabled, sets a strict |
882 | // conformance violation flag, and may emit a warning message, if enabled. |
883 | template <LanguageFeature LF, typename PA> class DeprecatedParser { |
884 | public: |
885 | using resultType = typename PA::resultType; |
886 | constexpr DeprecatedParser(const DeprecatedParser &) = default; |
887 | constexpr DeprecatedParser(PA parser) : parser_{parser} {} |
888 | std::optional<resultType> Parse(ParseState &state) const { |
889 | if (UserState * ustate{state.userState()}) { |
890 | if (!ustate->features().IsEnabled(LF)) { |
891 | return std::nullopt; |
892 | } |
893 | } |
894 | auto at{state.GetLocation()}; |
895 | auto result{parser_.Parse(state)}; |
896 | if (result) { |
897 | state.Nonstandard(CharBlock{at, state.GetLocation()}, LF, |
898 | "deprecated usage"_port_en_US); |
899 | } |
900 | return result; |
901 | } |
902 | |
903 | private: |
904 | const PA parser_; |
905 | }; |
906 | |
907 | template <LanguageFeature LF, typename PA> |
908 | inline constexpr auto deprecated(PA parser) { |
909 | return DeprecatedParser<LF, PA>(parser); |
910 | } |
911 | |
912 | // Parsing objects with "source" members. |
913 | template <typename PA> class SourcedParser { |
914 | public: |
915 | using resultType = typename PA::resultType; |
916 | constexpr SourcedParser(const SourcedParser &) = default; |
917 | constexpr SourcedParser(PA parser) : parser_{parser} {} |
918 | std::optional<resultType> Parse(ParseState &state) const { |
919 | const char *start{state.GetLocation()}; |
920 | auto result{parser_.Parse(state)}; |
921 | if (result) { |
922 | const char *end{state.GetLocation()}; |
923 | for (; start < end && start[0] == ' '; ++start) { |
924 | } |
925 | for (; start < end && end[-1] == ' '; --end) { |
926 | } |
927 | result->source = CharBlock{start, end}; |
928 | } |
929 | return result; |
930 | } |
931 | |
932 | private: |
933 | const PA parser_; |
934 | }; |
935 | |
936 | template <typename PA> inline constexpr auto sourced(PA parser) { |
937 | return SourcedParser<PA>{parser}; |
938 | } |
939 | } // namespace Fortran::parser |
940 | #endif // FORTRAN_PARSER_BASIC_PARSERS_H_ |
1 | //===-- include/flang/Parser/parse-state.h ----------------------*- C++ -*-===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #ifndef FORTRAN_PARSER_PARSE_STATE_H_ |
10 | #define FORTRAN_PARSER_PARSE_STATE_H_ |
11 | |
12 | // Defines the ParseState type used as the argument for every parser's |
13 | // Parse member or static function. Tracks source provenance, context, |
14 | // accumulated messages, and an arbitrary UserState instance for parsing |
15 | // attempts. Must be efficient to duplicate and assign for backtracking |
16 | // and recovery during parsing! |
17 | |
18 | #include "user-state.h" |
19 | #include "flang/Common/Fortran-features.h" |
20 | #include "flang/Common/idioms.h" |
21 | #include "flang/Parser/characters.h" |
22 | #include "flang/Parser/message.h" |
23 | #include "flang/Parser/provenance.h" |
24 | #include <cstddef> |
25 | #include <cstring> |
26 | #include <list> |
27 | #include <memory> |
28 | #include <optional> |
29 | #include <utility> |
30 | |
31 | namespace Fortran::parser { |
32 | |
33 | using common::LanguageFeature; |
34 | |
35 | class ParseState { |
36 | public: |
37 | ParseState(const CookedSource &cooked) |
38 | : p_{cooked.AsCharBlock().begin()}, limit_{cooked.AsCharBlock().end()} {} |
39 | ParseState(const ParseState &that) |
40 | : p_{that.p_}, limit_{that.limit_}, context_{that.context_}, |
41 | userState_{that.userState_}, inFixedForm_{that.inFixedForm_}, |
42 | anyErrorRecovery_{that.anyErrorRecovery_}, |
43 | anyConformanceViolation_{that.anyConformanceViolation_}, |
44 | deferMessages_{that.deferMessages_}, |
45 | anyDeferredMessages_{that.anyDeferredMessages_}, |
46 | anyTokenMatched_{that.anyTokenMatched_} {} |
47 | ParseState(ParseState &&that) |
48 | : p_{that.p_}, limit_{that.limit_}, messages_{std::move(that.messages_)}, |
49 | context_{std::move(that.context_)}, userState_{that.userState_}, |
50 | inFixedForm_{that.inFixedForm_}, |
51 | anyErrorRecovery_{that.anyErrorRecovery_}, |
52 | anyConformanceViolation_{that.anyConformanceViolation_}, |
53 | deferMessages_{that.deferMessages_}, |
54 | anyDeferredMessages_{that.anyDeferredMessages_}, |
55 | anyTokenMatched_{that.anyTokenMatched_} {} |
56 | ParseState &operator=(const ParseState &that) { |
57 | p_ = that.p_, limit_ = that.limit_, context_ = that.context_; |
58 | userState_ = that.userState_, inFixedForm_ = that.inFixedForm_; |
59 | anyErrorRecovery_ = that.anyErrorRecovery_; |
60 | anyConformanceViolation_ = that.anyConformanceViolation_; |
61 | deferMessages_ = that.deferMessages_; |
62 | anyDeferredMessages_ = that.anyDeferredMessages_; |
63 | anyTokenMatched_ = that.anyTokenMatched_; |
64 | return *this; |
65 | } |
66 | ParseState &operator=(ParseState &&that) { |
67 | p_ = that.p_, limit_ = that.limit_, messages_ = std::move(that.messages_); |
68 | context_ = std::move(that.context_); |
69 | userState_ = that.userState_, inFixedForm_ = that.inFixedForm_; |
70 | anyErrorRecovery_ = that.anyErrorRecovery_; |
71 | anyConformanceViolation_ = that.anyConformanceViolation_; |
72 | deferMessages_ = that.deferMessages_; |
73 | anyDeferredMessages_ = that.anyDeferredMessages_; |
74 | anyTokenMatched_ = that.anyTokenMatched_; |
75 | return *this; |
76 | } |
77 | |
78 | const Messages &messages() const { return messages_; } |
79 | Messages &messages() { return messages_; } |
80 | |
81 | const Message::Reference &context() const { return context_; } |
82 | Message::Reference &context() { return context_; } |
83 | |
84 | bool anyErrorRecovery() const { return anyErrorRecovery_; } |
85 | void set_anyErrorRecovery() { anyErrorRecovery_ = true; } |
86 | |
87 | bool anyConformanceViolation() const { return anyConformanceViolation_; } |
88 | void set_anyConformanceViolation() { anyConformanceViolation_ = true; } |
89 | |
90 | UserState *userState() const { return userState_; } |
91 | ParseState &set_userState(UserState *u) { |
92 | userState_ = u; |
93 | return *this; |
94 | } |
95 | |
96 | bool inFixedForm() const { return inFixedForm_; } |
97 | ParseState &set_inFixedForm(bool yes = true) { |
98 | inFixedForm_ = yes; |
99 | return *this; |
100 | } |
101 | |
102 | bool deferMessages() const { return deferMessages_; } |
103 | ParseState &set_deferMessages(bool yes = true) { |
104 | deferMessages_ = yes; |
105 | return *this; |
106 | } |
107 | |
108 | bool anyDeferredMessages() const { return anyDeferredMessages_; } |
109 | ParseState &set_anyDeferredMessages(bool yes = true) { |
110 | anyDeferredMessages_ = yes; |
111 | return *this; |
112 | } |
113 | |
114 | bool anyTokenMatched() const { return anyTokenMatched_; } |
115 | ParseState &set_anyTokenMatched(bool yes = true) { |
116 | anyTokenMatched_ = yes; |
117 | return *this; |
118 | } |
119 | |
120 | const char *GetLocation() const { return p_; } |
121 | |
122 | void PushContext(MessageFixedText text) { |
123 | auto m{new Message{p_, text}}; // reference-counted |
124 | m->SetContext(context_.get()); |
125 | context_ = Message::Reference{m}; |
126 | } |
127 | |
128 | void PopContext() { |
129 | CHECK(context_)((context_) || (Fortran::common::die("CHECK(" "context_" ") failed" " at " "flang/include/flang/Parser/parse-state.h" "(%d)", 129 ), false)); |
130 | context_ = context_->attachment(); |
131 | } |
132 | |
133 | template <typename... A> void Say(CharBlock range, A &&...args) { |
134 | if (deferMessages_) { |
135 | anyDeferredMessages_ = true; |
136 | } else { |
137 | messages_.Say(range, std::forward<A>(args)...).SetContext(context_.get()); |
138 | } |
139 | } |
140 | template <typename... A> void Say(const MessageFixedText &text, A &&...args) { |
141 | Say(p_, text, std::forward<A>(args)...); |
142 | } |
143 | template <typename... A> |
144 | void Say(const MessageExpectedText &text, A &&...args) { |
145 | Say(p_, text, std::forward<A>(args)...); |
146 | } |
147 | |
148 | void Nonstandard(LanguageFeature lf, const MessageFixedText &msg) { |
149 | Nonstandard(p_, lf, msg); |
150 | } |
151 | void Nonstandard( |
152 | CharBlock range, LanguageFeature lf, const MessageFixedText &msg) { |
153 | anyConformanceViolation_ = true; |
154 | if (userState_ && userState_->features().ShouldWarn(lf)) { |
155 | Say(range, msg); |
156 | } |
157 | } |
158 | bool IsNonstandardOk(LanguageFeature lf, const MessageFixedText &msg) { |
159 | if (userState_ && !userState_->features().IsEnabled(lf)) { |
160 | return false; |
161 | } |
162 | Nonstandard(lf, msg); |
163 | return true; |
164 | } |
165 | |
166 | bool IsAtEnd() const { return p_ >= limit_; } |
167 | |
168 | const char *UncheckedAdvance(std::size_t n = 1) { |
169 | const char *result{p_}; |
170 | p_ += n; |
171 | return result; |
172 | } |
173 | |
174 | std::optional<const char *> GetNextChar() { |
175 | if (p_ < limit_) { |
176 | return UncheckedAdvance(); |
177 | } else { |
178 | return std::nullopt; |
179 | } |
180 | } |
181 | |
182 | std::optional<const char *> PeekAtNextChar() const { |
183 | if (p_ < limit_) { |
184 | return p_; |
185 | } else { |
186 | return std::nullopt; |
187 | } |
188 | } |
189 | |
190 | std::size_t BytesRemaining() const { |
191 | std::size_t remain = limit_ - p_; |
192 | return remain; |
193 | } |
194 | |
195 | void CombineFailedParses(ParseState &&prev) { |
196 | if (prev.anyTokenMatched_) { |
197 | if (!anyTokenMatched_ || prev.p_ > p_) { |
198 | anyTokenMatched_ = true; |
199 | p_ = prev.p_; |
200 | messages_ = std::move(prev.messages_); |
201 | } else if (prev.p_ == p_) { |
202 | messages_.Merge(std::move(prev.messages_)); |
203 | } |
204 | } |
205 | anyDeferredMessages_ |= prev.anyDeferredMessages_; |
206 | anyConformanceViolation_ |= prev.anyConformanceViolation_; |
207 | anyErrorRecovery_ |= prev.anyErrorRecovery_; |
208 | } |
209 | |
210 | private: |
211 | // Text remaining to be parsed |
212 | const char *p_{nullptr}, *limit_{nullptr}; |
213 | |
214 | // Accumulated messages and current nested context. |
215 | Messages messages_; |
216 | Message::Reference context_; |
217 | |
218 | UserState *userState_{nullptr}; |
219 | |
220 | bool inFixedForm_{false}; |
221 | bool anyErrorRecovery_{false}; |
222 | bool anyConformanceViolation_{false}; |
223 | bool deferMessages_{false}; |
224 | bool anyDeferredMessages_{false}; |
225 | bool anyTokenMatched_{false}; |
226 | // NOTE: Any additions or modifications to these data members must also be |
227 | // reflected in the copy and move constructors defined at the top of this |
228 | // class definition! |
229 | }; |
230 | } // namespace Fortran::parser |
231 | #endif // FORTRAN_PARSER_PARSE_STATE_H_ |
1 | //===-- include/flang/Parser/message.h --------------------------*- C++ -*-===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #ifndef FORTRAN_PARSER_MESSAGE_H_ |
10 | #define FORTRAN_PARSER_MESSAGE_H_ |
11 | |
12 | // Defines a representation for sequences of compiler messages. |
13 | // Supports nested contextualization. |
14 | |
15 | #include "char-block.h" |
16 | #include "char-set.h" |
17 | #include "provenance.h" |
18 | #include "flang/Common/idioms.h" |
19 | #include "flang/Common/reference-counted.h" |
20 | #include "flang/Common/restorer.h" |
21 | #include <cstddef> |
22 | #include <cstring> |
23 | #include <forward_list> |
24 | #include <list> |
25 | #include <optional> |
26 | #include <string> |
27 | #include <utility> |
28 | #include <variant> |
29 | |
30 | namespace Fortran::parser { |
31 | |
32 | // Use "..."_err_en_US, "..."_warn_en_US, "..."_port_en_US, "..."_because_en_US, |
33 | // "..."_todo_en_US, and "..."_en_US string literals to define the static text |
34 | // and severity of a message or attachment. |
35 | enum class Severity { |
36 | Error, // fatal error that prevents code and module file generation |
37 | Warning, // likely problem |
38 | Portability, // nonstandard or obsolete features |
39 | Because, // for AttachTo(), explanatory attachment to support another message |
40 | Context, // (internal): attachment from SetContext() |
41 | Todo, // a feature that's not yet implemented, a fatal error |
42 | None // everything else, common for attachments with source locations |
43 | }; |
44 | |
45 | class MessageFixedText { |
46 | public: |
47 | constexpr MessageFixedText() {} |
48 | constexpr MessageFixedText( |
49 | const char str[], std::size_t n, Severity severity = Severity::None) |
50 | : text_{str, n}, severity_{severity} {} |
51 | constexpr MessageFixedText(const MessageFixedText &) = default; |
52 | constexpr MessageFixedText(MessageFixedText &&) = default; |
53 | constexpr MessageFixedText &operator=(const MessageFixedText &) = default; |
54 | constexpr MessageFixedText &operator=(MessageFixedText &&) = default; |
55 | |
56 | CharBlock text() const { return text_; } |
57 | Severity severity() const { return severity_; } |
58 | MessageFixedText &set_severity(Severity severity) { |
59 | severity_ = severity; |
60 | return *this; |
61 | } |
62 | bool IsFatal() const { |
63 | return severity_ == Severity::Error || severity_ == Severity::Todo; |
64 | } |
65 | |
66 | private: |
67 | CharBlock text_; |
68 | Severity severity_{Severity::None}; |
69 | }; |
70 | |
71 | inline namespace literals { |
72 | constexpr MessageFixedText operator""_err_en_US( |
73 | const char str[], std::size_t n) { |
74 | return MessageFixedText{str, n, Severity::Error}; |
75 | } |
76 | constexpr MessageFixedText operator""_warn_en_US( |
77 | const char str[], std::size_t n) { |
78 | return MessageFixedText{str, n, Severity::Warning}; |
79 | } |
80 | constexpr MessageFixedText operator""_port_en_US( |
81 | const char str[], std::size_t n) { |
82 | return MessageFixedText{str, n, Severity::Portability}; |
83 | } |
84 | constexpr MessageFixedText operator""_because_en_US( |
85 | const char str[], std::size_t n) { |
86 | return MessageFixedText{str, n, Severity::Because}; |
87 | } |
88 | constexpr MessageFixedText operator""_todo_en_US( |
89 | const char str[], std::size_t n) { |
90 | return MessageFixedText{str, n, Severity::Todo}; |
91 | } |
92 | constexpr MessageFixedText operator""_en_US(const char str[], std::size_t n) { |
93 | return MessageFixedText{str, n, Severity::None}; |
94 | } |
95 | } // namespace literals |
96 | |
97 | // The construction of a MessageFormattedText uses a MessageFixedText |
98 | // as a vsnprintf() formatting string that is applied to the |
99 | // following arguments. CharBlock, std::string, and std::string_view |
100 | // argument values are also supported; they are automatically converted |
101 | // into char pointers that are suitable for '%s' formatting. |
102 | class MessageFormattedText { |
103 | public: |
104 | template <typename... A> |
105 | MessageFormattedText(const MessageFixedText &text, A &&...x) |
106 | : severity_{text.severity()} { |
107 | Format(&text, Convert(std::forward<A>(x))...); |
108 | } |
109 | MessageFormattedText(const MessageFormattedText &) = default; |
110 | MessageFormattedText(MessageFormattedText &&) = default; |
111 | MessageFormattedText &operator=(const MessageFormattedText &) = default; |
112 | MessageFormattedText &operator=(MessageFormattedText &&) = default; |
113 | const std::string &string() const { return string_; } |
114 | bool IsFatal() const { |
115 | return severity_ == Severity::Error || severity_ == Severity::Todo; |
116 | } |
117 | Severity severity() const { return severity_; } |
118 | MessageFormattedText &set_severity(Severity severity) { |
119 | severity_ = severity; |
120 | return *this; |
121 | } |
122 | std::string MoveString() { return std::move(string_); } |
123 | |
124 | private: |
125 | void Format(const MessageFixedText *, ...); |
126 | |
127 | template <typename A> A Convert(const A &x) { |
128 | static_assert(!std::is_class_v<std::decay_t<A>>); |
129 | return x; |
130 | } |
131 | template <typename A> common::IfNoLvalue<A, A> Convert(A &&x) { |
132 | static_assert(!std::is_class_v<std::decay_t<A>>); |
133 | return std::move(x); |
134 | } |
135 | const char *Convert(const char *s) { return s; } |
136 | const char *Convert(char *s) { return s; } |
137 | const char *Convert(const std::string &); |
138 | const char *Convert(std::string &&); |
139 | const char *Convert(const std::string_view &); |
140 | const char *Convert(std::string_view &&); |
141 | const char *Convert(CharBlock); |
142 | std::intmax_t Convert(std::int64_t x) { return x; } |
143 | std::uintmax_t Convert(std::uint64_t x) { return x; } |
144 | |
145 | Severity severity_; |
146 | std::string string_; |
147 | std::forward_list<std::string> conversions_; // preserves created strings |
148 | }; |
149 | |
150 | // Represents a formatted rendition of "expected '%s'"_err_en_US |
151 | // on a constant text or a set of characters. |
152 | class MessageExpectedText { |
153 | public: |
154 | MessageExpectedText(const char *s, std::size_t n) { |
155 | if (n == std::string::npos) { |
156 | n = std::strlen(s); |
157 | } |
158 | if (n == 1) { |
159 | // Treat a one-character string as a singleton set for better merging. |
160 | u_ = SetOfChars{*s}; |
161 | } else { |
162 | u_ = CharBlock{s, n}; |
163 | } |
164 | } |
165 | constexpr explicit MessageExpectedText(CharBlock cb) : u_{cb} {} |
166 | constexpr explicit MessageExpectedText(char ch) : u_{SetOfChars{ch}} {} |
167 | constexpr explicit MessageExpectedText(SetOfChars set) : u_{set} {} |
168 | MessageExpectedText(const MessageExpectedText &) = default; |
169 | MessageExpectedText(MessageExpectedText &&) = default; |
170 | MessageExpectedText &operator=(const MessageExpectedText &) = default; |
171 | MessageExpectedText &operator=(MessageExpectedText &&) = default; |
172 | |
173 | std::string ToString() const; |
174 | bool Merge(const MessageExpectedText &); |
175 | |
176 | private: |
177 | std::variant<CharBlock, SetOfChars> u_; |
178 | }; |
179 | |
180 | class Message : public common::ReferenceCounted<Message> { |
181 | public: |
182 | using Reference = common::CountedReference<Message>; |
183 | |
184 | Message(const Message &) = default; |
185 | Message(Message &&) = default; |
186 | Message &operator=(const Message &) = default; |
187 | Message &operator=(Message &&) = default; |
188 | |
189 | Message(ProvenanceRange pr, const MessageFixedText &t) |
190 | : location_{pr}, text_{t} {} |
191 | Message(ProvenanceRange pr, const MessageFormattedText &s) |
192 | : location_{pr}, text_{s} {} |
193 | Message(ProvenanceRange pr, MessageFormattedText &&s) |
194 | : location_{pr}, text_{std::move(s)} {} |
195 | Message(ProvenanceRange pr, const MessageExpectedText &t) |
196 | : location_{pr}, text_{t} {} |
197 | |
198 | Message(CharBlock csr, const MessageFixedText &t) |
199 | : location_{csr}, text_{t} {} |
200 | Message(CharBlock csr, const MessageFormattedText &s) |
201 | : location_{csr}, text_{s} {} |
202 | Message(CharBlock csr, MessageFormattedText &&s) |
203 | : location_{csr}, text_{std::move(s)} {} |
204 | Message(CharBlock csr, const MessageExpectedText &t) |
205 | : location_{csr}, text_{t} {} |
206 | |
207 | template <typename RANGE, typename A, typename... As> |
208 | Message(RANGE r, const MessageFixedText &t, A &&x, As &&...xs) |
209 | : location_{r}, text_{MessageFormattedText{ |
210 | t, std::forward<A>(x), std::forward<As>(xs)...}} {} |
211 | |
212 | Reference attachment() const { return attachment_; } |
213 | |
214 | void SetContext(Message *c) { |
215 | attachment_ = c; |
216 | attachmentIsContext_ = true; |
217 | } |
218 | Message &Attach(Message *); |
219 | Message &Attach(std::unique_ptr<Message> &&); |
220 | template <typename... A> Message &Attach(A &&...args) { |
221 | return Attach(new Message{std::forward<A>(args)...}); // reference-counted |
222 | } |
223 | |
224 | bool SortBefore(const Message &that) const; |
225 | bool IsFatal() const; |
226 | Severity severity() const; |
227 | Message &set_severity(Severity); |
228 | std::string ToString() const; |
229 | std::optional<ProvenanceRange> GetProvenanceRange( |
230 | const AllCookedSources &) const; |
231 | void Emit(llvm::raw_ostream &, const AllCookedSources &, |
232 | bool echoSourceLine = true) const; |
233 | |
234 | // If this Message or any of its attachments locates itself via a CharBlock, |
235 | // replace its location with the corresponding ProvenanceRange. |
236 | void ResolveProvenances(const AllCookedSources &); |
237 | |
238 | bool IsMergeable() const { |
239 | return std::holds_alternative<MessageExpectedText>(text_); |
240 | } |
241 | bool Merge(const Message &); |
242 | bool operator==(const Message &that) const; |
243 | bool operator!=(const Message &that) const { return !(*this == that); } |
244 | |
245 | private: |
246 | bool AtSameLocation(const Message &) const; |
247 | std::variant<ProvenanceRange, CharBlock> location_; |
248 | std::variant<MessageFixedText, MessageFormattedText, MessageExpectedText> |
249 | text_; |
250 | bool attachmentIsContext_{false}; |
251 | Reference attachment_; |
252 | }; |
253 | |
254 | class Messages { |
255 | public: |
256 | Messages() {} |
257 | Messages(Messages &&that) : messages_{std::move(that.messages_)} {} |
258 | Messages &operator=(Messages &&that) { |
259 | messages_ = std::move(that.messages_); |
260 | return *this; |
261 | } |
262 | |
263 | std::list<Message> &messages() { return messages_; } |
264 | bool empty() const { return messages_.empty(); } |
265 | void clear() { messages_.clear(); } |
266 | |
267 | template <typename... A> Message &Say(A &&...args) { |
268 | return messages_.emplace_back(std::forward<A>(args)...); |
269 | } |
270 | |
271 | void Annex(Messages &&that) { |
272 | messages_.splice(messages_.end(), that.messages_); |
273 | } |
274 | |
275 | bool Merge(const Message &); |
276 | void Merge(Messages &&); |
277 | void Copy(const Messages &); |
278 | void ResolveProvenances(const AllCookedSources &); |
279 | void Emit(llvm::raw_ostream &, const AllCookedSources &, |
280 | bool echoSourceLines = true) const; |
281 | void AttachTo(Message &, std::optional<Severity> = std::nullopt); |
282 | bool AnyFatalError() const; |
283 | |
284 | private: |
285 | std::list<Message> messages_; |
286 | }; |
287 | |
288 | class ContextualMessages { |
289 | public: |
290 | ContextualMessages() = default; |
291 | ContextualMessages(CharBlock at, Messages *m) : at_{at}, messages_{m} {} |
292 | explicit ContextualMessages(Messages *m) : messages_{m} {} |
293 | ContextualMessages(const ContextualMessages &that) |
294 | : at_{that.at_}, messages_{that.messages_} {} |
295 | |
296 | CharBlock at() const { return at_; } |
297 | Messages *messages() const { return messages_; } |
298 | Message::Reference contextMessage() const { return contextMessage_; } |
299 | bool empty() const { return !messages_ || messages_->empty(); } |
300 | |
301 | // Set CharBlock for messages; restore when the returned value is deleted |
302 | common::Restorer<CharBlock> SetLocation(CharBlock at) { |
303 | if (at.empty()) { |
304 | at = at_; |
305 | } |
306 | return common::ScopedSet(at_, std::move(at)); |
307 | } |
308 | |
309 | common::Restorer<Message::Reference> SetContext(Message *m) { |
310 | if (!m) { |
311 | m = contextMessage_.get(); |
312 | } |
313 | return common::ScopedSet(contextMessage_, m); |
314 | } |
315 | |
316 | // Diverts messages to another buffer; restored when the returned |
317 | // value is deleted. |
318 | common::Restorer<Messages *> SetMessages(Messages &buffer) { |
319 | return common::ScopedSet(messages_, &buffer); |
320 | } |
321 | // Discard future messages until the returned value is deleted. |
322 | common::Restorer<Messages *> DiscardMessages() { |
323 | return common::ScopedSet(messages_, nullptr); |
324 | } |
325 | |
326 | template <typename... A> Message *Say(CharBlock at, A &&...args) { |
327 | if (messages_ != nullptr) { |
328 | auto &msg{messages_->Say(at, std::forward<A>(args)...)}; |
329 | if (contextMessage_) { |
330 | msg.SetContext(contextMessage_.get()); |
331 | } |
332 | return &msg; |
333 | } else { |
334 | return nullptr; |
335 | } |
336 | } |
337 | |
338 | template <typename... A> |
339 | Message *Say(std::optional<CharBlock> at, A &&...args) { |
340 | return Say(at.value_or(at_), std::forward<A>(args)...); |
341 | } |
342 | |
343 | template <typename... A> Message *Say(A &&...args) { |
344 | return Say(at_, std::forward<A>(args)...); |
345 | } |
346 | |
347 | Message *Say(Message &&msg) { |
348 | if (messages_ != nullptr) { |
349 | if (contextMessage_) { |
350 | msg.SetContext(contextMessage_.get()); |
351 | } |
352 | return &messages_->Say(std::move(msg)); |
353 | } else { |
354 | return nullptr; |
355 | } |
356 | } |
357 | |
358 | private: |
359 | CharBlock at_; |
360 | Messages *messages_{nullptr}; |
361 | Message::Reference contextMessage_; |
362 | }; |
363 | } // namespace Fortran::parser |
364 | #endif // FORTRAN_PARSER_MESSAGE_H_ |
1 | //===-- include/flang/Common/reference-counted.h ----------------*- C++ -*-===// | ||||||||||||
2 | // | ||||||||||||
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||||||||||
4 | // See https://llvm.org/LICENSE.txt for license information. | ||||||||||||
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||||||||||
6 | // | ||||||||||||
7 | //===----------------------------------------------------------------------===// | ||||||||||||
8 | |||||||||||||
9 | #ifndef FORTRAN_COMMON_REFERENCE_COUNTED_H_ | ||||||||||||
10 | #define FORTRAN_COMMON_REFERENCE_COUNTED_H_ | ||||||||||||
11 | |||||||||||||
12 | // A class template of smart pointers to objects with their own | ||||||||||||
13 | // reference counting object lifetimes that's lighter weight | ||||||||||||
14 | // than std::shared_ptr<>. Not thread-safe. | ||||||||||||
15 | |||||||||||||
16 | namespace Fortran::common { | ||||||||||||
17 | |||||||||||||
18 | // A base class for reference-counted objects. Must be public. | ||||||||||||
19 | template <typename A> class ReferenceCounted { | ||||||||||||
20 | public: | ||||||||||||
21 | ReferenceCounted() {} | ||||||||||||
22 | int references() const { return references_; } | ||||||||||||
23 | void TakeReference() { ++references_; } | ||||||||||||
24 | void DropReference() { | ||||||||||||
25 | if (--references_ == 0) { | ||||||||||||
26 | delete static_cast<A *>(this); | ||||||||||||
27 | } | ||||||||||||
28 | } | ||||||||||||
29 | |||||||||||||
30 | private: | ||||||||||||
31 | int references_{0}; | ||||||||||||
32 | }; | ||||||||||||
33 | |||||||||||||
34 | // A reference to a reference-counted object. | ||||||||||||
35 | template <typename A> class CountedReference { | ||||||||||||
36 | public: | ||||||||||||
37 | using type = A; | ||||||||||||
38 | CountedReference() {} | ||||||||||||
39 | CountedReference(type *m) : p_{m} { Take(); } | ||||||||||||
40 | CountedReference(const CountedReference &c) : p_{c.p_} { Take(); } | ||||||||||||
41 | CountedReference(CountedReference &&c) : p_{c.p_} { c.p_ = nullptr; } | ||||||||||||
42 | CountedReference &operator=(const CountedReference &c) { | ||||||||||||
43 | c.Take(); | ||||||||||||
44 | Drop(); | ||||||||||||
45 | p_ = c.p_; | ||||||||||||
46 | return *this; | ||||||||||||
47 | } | ||||||||||||
48 | CountedReference &operator=(CountedReference &&c) { | ||||||||||||
49 | A *p{c.p_}; | ||||||||||||
50 | c.p_ = nullptr; | ||||||||||||
51 | Drop(); | ||||||||||||
52 | p_ = p; | ||||||||||||
53 | return *this; | ||||||||||||
54 | } | ||||||||||||
55 | ~CountedReference() { Drop(); } | ||||||||||||
56 | operator bool() const { return p_ != nullptr; } | ||||||||||||
57 | type *get() const { return p_; } | ||||||||||||
58 | type &operator*() const { return *p_; } | ||||||||||||
59 | type *operator->() const { return p_; } | ||||||||||||
60 | |||||||||||||
61 | private: | ||||||||||||
62 | void Take() const { | ||||||||||||
63 | if (p_
| ||||||||||||
64 | p_->TakeReference(); | ||||||||||||
| |||||||||||||
65 | } | ||||||||||||
66 | } | ||||||||||||
67 | void Drop() { | ||||||||||||
68 | if (p_
| ||||||||||||
69 | p_->DropReference(); | ||||||||||||
70 | p_ = nullptr; | ||||||||||||
71 | } | ||||||||||||
72 | } | ||||||||||||
73 | |||||||||||||
74 | type *p_{nullptr}; | ||||||||||||
75 | }; | ||||||||||||
76 | } // namespace Fortran::common | ||||||||||||
77 | #endif // FORTRAN_COMMON_REFERENCE_COUNTED_H_ |