99 = TranslationUnit(symbol_table symtab, node* items)
1010
1111symbol
12- = Program(symbol_table symtab, identifier name, identifier* dependencies, stmt* body)
13- | Module(symbol_table symtab, identifier name, identifier* dependencies, bool loaded_from_mod, bool intrinsic)
14- | Function(symbol_table symtab, identifier name, ttype function_signature, identifier* dependencies, expr* args, stmt* body, expr? return_var, access access, bool deterministic, bool side_effect_free, string? module_file)
12+ = Program(symbol_table symtab, identifier name, identifier* dependencies, stmt* body, location start_name, location end_name )
13+ | Module(symbol_table symtab, identifier name, identifier* dependencies, bool loaded_from_mod, bool intrinsic, location start_name, location end_name )
14+ | Function(symbol_table symtab, identifier name, ttype function_signature, identifier* dependencies, expr* args, stmt* body, expr? return_var, access access, bool deterministic, bool side_effect_free, string? module_file, location start_name, location end_name )
1515 | GenericProcedure(symbol_table parent_symtab, identifier name, symbol* procs, access access)
1616 | CustomOperator(symbol_table parent_symtab, identifier name, symbol* procs, access access)
1717 | ExternalSymbol(symbol_table parent_symtab, identifier name, symbol external, identifier module_name, identifier* scope_names, identifier original_name, access access)
1818 | Struct(symbol_table symtab, identifier name, identifier* dependencies, identifier* members, identifier* member_functions, abi abi, access access, bool is_packed, bool is_abstract, call_arg* initializers, expr? alignment, symbol? parent)
19- | EnumType (symbol_table symtab, identifier name, identifier* dependencies, identifier* members, abi abi, access access, enumtype enum_value_type, ttype type, symbol? parent)
20- | UnionType (symbol_table symtab, identifier name, identifier* dependencies, identifier* members, abi abi, access access, call_arg* initializers, symbol? parent)
21- | Variable(symbol_table parent_symtab, identifier name, identifier* dependencies, intent intent, expr? symbolic_value, expr? value, storage_type storage, ttype type, symbol? type_declaration, abi abi, access access, presence presence, bool value_attr)
22- | ClassType (symbol_table symtab, identifier name, abi abi, access access)
19+ | Enum (symbol_table symtab, identifier name, identifier* dependencies, identifier* members, abi abi, access access, enumtype enum_value_type, ttype type, symbol? parent)
20+ | Union (symbol_table symtab, identifier name, identifier* dependencies, identifier* members, abi abi, access access, call_arg* initializers, symbol? parent)
21+ | Variable(symbol_table parent_symtab, identifier name, identifier* dependencies, intent intent, expr? symbolic_value, expr? value, storage_type storage, ttype type, symbol? type_declaration, abi abi, access access, presence presence, bool value_attr, bool target_attr )
22+ | Class (symbol_table symtab, identifier name, abi abi, access access)
2323 | ClassProcedure(symbol_table parent_symtab, identifier name, identifier? self_argument, identifier proc_name, symbol proc, abi abi, bool is_deferred, bool is_nopass)
2424 | AssociateBlock(symbol_table symtab, identifier name, stmt* body)
2525 | Block(symbol_table symtab, identifier name, stmt* body)
3535 | Cycle(identifier? stmt_name)
3636 | ExplicitDeallocate(expr* vars)
3737 | ImplicitDeallocate(expr* vars)
38- | DoConcurrentLoop(do_loop_head head, stmt* body)
38+ | DoConcurrentLoop(do_loop_head* head, expr* shared, expr* local, reduction_expr* reduction , stmt* body)
3939 | DoLoop(identifier? name, do_loop_head head, stmt* body, stmt* orelse)
4040 | ErrorStop(expr? code)
4141 | Exit(identifier? stmt_name)
4545 | GoToTarget(int id, identifier name)
4646 | If(expr test, stmt* body, stmt* orelse)
4747 | IfArithmetic(expr test, int lt_label, int eq_label, int gt_label)
48- | Print(expr* values, expr? separator, expr? end )
48+ | Print(expr text )
4949 | FileOpen(int label, expr? newunit, expr? filename, expr? status, expr? form)
5050 | FileClose(int label, expr? unit, expr? iostat, expr? iomsg, expr? err, expr? status)
5151 | FileRead(int label, expr? unit, expr? fmt, expr? iomsg, expr? iostat, expr? size, expr? id, expr* values, stmt? overloaded)
5252 | FileBackspace(int label, expr? unit, expr? iostat, expr? err)
5353 | FileRewind(int label, expr? unit, expr? iostat, expr? err)
54- | FileInquire(int label, expr? unit, expr? file, expr? iostat, expr? err, expr? exist, expr? opened, expr? number, expr? named, expr? name, expr? access, expr? sequential, expr? direct, expr? form, expr? formatted, expr? unformatted, expr? recl, expr? nextrec, expr? blank, expr? position, expr? action, expr? read, expr? write, expr? readwrite, expr? delim, expr? pad, expr? flen, expr? blocksize, expr? convert, expr? carriagecontrol, expr? iolength)
54+ | FileInquire(int label, expr? unit, expr? file, expr? iostat, expr? err, expr? exist, expr? opened, expr? number, expr? named, expr? name, expr? access, expr? sequential, expr? direct, expr? form, expr? formatted, expr? unformatted, expr? recl, expr? nextrec, expr? blank, expr? position, expr? action, expr? read, expr? write, expr? readwrite, expr? delim, expr? pad, expr? flen, expr? blocksize, expr? convert, expr? carriagecontrol, expr? size, expr? iolength)
5555 | FileWrite(int label, expr? unit, expr? iomsg, expr? iostat, expr? id, expr* values, expr? separator, expr? end, stmt? overloaded)
5656 | Return()
5757 | Select(expr test, case_stmt* body, stmt* default, bool enable_fall_through)
5858 | Stop(expr? code)
5959 | Assert(expr test, expr? msg)
6060 | SubroutineCall(symbol name, symbol? original_name, call_arg* args, expr? dt)
61- | IntrinsicImpureSubroutine(int intrinsic_id , expr* args, int overload_id)
61+ | IntrinsicImpureSubroutine(int sub_intrinsic_id , expr* args, int overload_id)
6262 | Where(expr test, stmt* body, stmt* orelse)
6363 | WhileLoop(identifier? name, expr test, stmt* body, stmt* orelse)
64- | Nullify(symbol * vars)
64+ | Nullify(expr * vars)
6565 | Flush(int label, expr unit, expr? err, expr? iomsg, expr? iostat)
6666 | ListAppend(expr a, expr ele)
6767 | AssociateBlockCall(symbol m)
8989 | IntrinsicImpureFunction(int impure_intrinsic_id, expr* args, int overload_id, ttype? type, expr? value)
9090 | TypeInquiry(int inquiry_id, ttype arg_type, expr? arg, ttype type, expr value)
9191 | StructConstructor(symbol dt_sym, call_arg* args, ttype type, expr? value)
92- | EnumTypeConstructor(symbol dt_sym, expr* args, ttype type, expr? value)
93- | UnionTypeConstructor(symbol dt_sym, expr* args, ttype type, expr? value)
92+ | StructConstant(symbol dt_sym, call_arg* args, ttype type)
93+ | EnumConstructor(symbol dt_sym, expr* args, ttype type, expr? value)
94+ | UnionConstructor(symbol dt_sym, expr* args, ttype type, expr? value)
9495 | ImpliedDoLoop(expr* values, expr var, expr start, expr end, expr? increment, ttype type, expr? value)
95- | IntegerConstant(int n, ttype type)
96- | IntegerBOZ(int v, integerboz intboz_type, ttype? type)
96+ | IntegerConstant(int n, ttype type, integerboz intboz_type)
9797 | IntegerBitNot(expr arg, ttype type, expr? value)
9898 | IntegerUnaryMinus(expr arg, ttype type, expr? value)
9999 | IntegerCompare(expr left, cmpop op, expr right, ttype type, expr? value)
@@ -139,15 +139,16 @@ expr
139139 | StringContains(expr substr, expr str, ttype type, expr? value)
140140 | StringOrd(expr arg, ttype type, expr? value)
141141 | StringChr(expr arg, ttype type, expr? value)
142- | StringFormat(expr fmt, expr* args, string_format_kind kind, ttype type, expr? value)
142+ | StringFormat(expr? fmt, expr* args, string_format_kind kind, ttype type, expr? value)
143+ | StringPhysicalCast(expr arg, string_physical_type old, string_physical_type new, ttype type, expr? value)
143144 | CPtrCompare(expr left, cmpop op, expr right, ttype type, expr? value)
144145 | SymbolicCompare(expr left, cmpop op, expr right, ttype type, expr? value)
145146 | DictConstant(expr* keys, expr* values, ttype type)
146147 | DictLen(expr arg, ttype type, expr? value)
147148 | Var(symbol v)
148149 | FunctionParam(int param_number, ttype type, expr? value)
149150 | ArrayConstructor(expr* args, ttype type, expr? value, arraystorage storage_format)
150- | ArrayConstant(expr* args , ttype type, arraystorage storage_format)
151+ | ArrayConstant(int n_data, void data , ttype type, arraystorage storage_format)
151152 | ArrayItem(expr v, array_index* args, ttype type, arraystorage storage_format, expr? value)
152153 | ArraySection(expr v, array_index* args, ttype type, expr? value)
153154 | ArraySize(expr v, expr? dim, ttype type, expr? value)
@@ -191,21 +192,22 @@ expr
191192 | PointerNullConstant(ttype type)
192193 | PointerAssociated(expr ptr, expr? tgt, ttype type, expr? value)
193194 | RealSqrt(expr arg, ttype type, expr? value)
195+ | ArrayIsContiguous(expr array, ttype type, expr? value)
194196
195197ttype
196198 = Integer(int kind)
197199 | UnsignedInteger(int kind)
198200 | Real(int kind)
199201 | Complex(int kind)
200- | Character (int kind, int len, expr? len_expr)
202+ | String (int kind, int len, expr? len_expr, string_physical_type physical_type )
201203 | Logical(int kind)
202204 | Set(ttype type)
203205 | List(ttype type)
204206 | Tuple(ttype* type)
205207 | StructType(ttype* data_member_types, ttype* member_function_types, bool is_cstruct, symbol derived_type)
206- | Enum (symbol enum_type)
207- | Union (symbol union_type)
208- | Class (symbol class_type)
208+ | EnumType (symbol enum_type)
209+ | UnionType (symbol union_type)
210+ | ClassType (symbol class_type)
209211 | Dict(ttype key_type, ttype value_type)
210212 | Pointer(ttype type)
211213 | Allocatable(ttype type)
@@ -215,7 +217,7 @@ ttype
215217 | Array(ttype type, dimension* dims, array_physical_type physical_type)
216218 | FunctionType(ttype* arg_types, ttype? return_var_type, abi abi, deftype deftype, string? bindc_name, bool elemental, bool pure, bool module, bool inline, bool static, symbol* restrictions, bool is_restriction)
217219
218- cast_kind = RealToInteger | IntegerToReal | LogicalToReal | RealToReal | IntegerToInteger | RealToComplex | IntegerToComplex | IntegerToLogical | RealToLogical | CharacterToLogical | CharacterToInteger | CharacterToList | ComplexToLogical | ComplexToComplex | ComplexToReal | ComplexToInteger | LogicalToInteger | RealToCharacter | IntegerToCharacter | LogicalToCharacter | UnsignedIntegerToInteger | UnsignedIntegerToUnsignedInteger | UnsignedIntegerToReal | UnsignedIntegerToLogical | IntegerToUnsignedInteger | RealToUnsignedInteger | CPtrToUnsignedInteger | UnsignedIntegerToCPtr | IntegerToSymbolicExpression | ListToArray | DerivedToBase
220+ cast_kind = RealToInteger | IntegerToReal | LogicalToReal | RealToReal | IntegerToInteger | RealToComplex | IntegerToComplex | IntegerToLogical | RealToLogical | StringToLogical | StringToInteger | StringToList | ComplexToLogical | ComplexToComplex | ComplexToReal | ComplexToInteger | LogicalToInteger | RealToString | IntegerToString | LogicalToString | UnsignedIntegerToInteger | UnsignedIntegerToUnsignedInteger | UnsignedIntegerToReal | UnsignedIntegerToLogical | IntegerToUnsignedInteger | RealToUnsignedInteger | CPtrToUnsignedInteger | UnsignedIntegerToCPtr | IntegerToSymbolicExpression | ListToArray
219221storage_type = Default | Save | Parameter
220222access = Public | Private
221223intent = Local | In | Out | InOut | ReturnVar | Unspecified
@@ -227,18 +229,21 @@ alloc_arg = (expr a, dimension* dims, expr? len_expr, ttype? type)
227229attribute = Attribute(identifier name, attribute_arg *args)
228230attribute_arg = (identifier arg)
229231call_arg = (expr? value)
232+ reduction_expr = (reduction_op op, expr arg)
230233tbind = Bind(string lang, string name)
231234array_index = (expr? left, expr? right, expr? step)
232235do_loop_head = (expr? v, expr? start, expr? end, expr? increment)
233236case_stmt = CaseStmt(expr* test, stmt* body, bool fall_through) | CaseStmt_Range(expr? start, expr? end, stmt* body)
234237type_stmt = TypeStmtName(symbol sym, stmt* body) | ClassStmt(symbol sym, stmt* body) | TypeStmtType(ttype type, stmt* body)
235238enumtype = IntegerConsecutiveFromZero | IntegerUnique | IntegerNotUnique | NonInteger
236239require_instantiation = Require(identifier name, identifier* args)
237- array_physical_type = DescriptorArray | PointerToDataArray | UnboundedPointerToDataArray | FixedSizeArray | CharacterArraySinglePointer | NumPyArray | ISODescriptorArray | SIMDArray
240+ array_physical_type = DescriptorArray | PointerToDataArray | UnboundedPointerToDataArray | FixedSizeArray | StringArraySinglePointer | NumPyArray | ISODescriptorArray | SIMDArray
241+ string_physical_type = PointerString | DescriptorString
238242binop = Add | Sub | Mul | Div | Pow | BitAnd | BitOr | BitXor | BitLShift | BitRShift
243+ reduction_op = ReduceAdd | ReduceSub | ReduceMul | ReduceMIN | ReduceMAX
239244logicalbinop = And | Or | Xor | NEqv | Eqv
240245cmpop = Eq | NotEq | Lt | LtE | Gt | GtE
241- integerboz = Binary | Hex | Octal
246+ integerboz = Binary | Hex | Octal | Decimal
242247arraybound = LBound | UBound
243248arraystorage = RowMajor | ColMajor
244249string_format_kind = FormatFortran | FormatC | FormatPythonPercent | FormatPythonFString | FormatPythonFormat
0 commit comments