This project maintains and develops a Fortran parser called fparser2 written purely in Python which supports Fortran 2003 and some Fortran 2008. A legacy parser fparser1 is also available but is not supported. The parsers were originally part of the f2py project by Pearu Peterson.
yields node == Type_Declaration_Stmt(Intrinsic_Type_Spec('INTEGER', None), Attr_Spec_List(',', (Attr_Spec('POINTER'),)), Entity_Decl_List(',', (Entity_Decl(Name('l1'), None, None, Initialization('=>', Function_Reference(Name('null'), None))),)))
where Function_Reference(Name('null'), None) should I think be Intrinsic_Function_Reference(Name('null'), None) instead.
For now this requires redirecting these explicitly from Fparser2Reader()._call_handler to Fparser2Reader()._intrinsic_handler in branch PSyclone 2586_fparser_function_reference.
Using e.g. (see src/psyclone/tests/psyir/frontend/fparser2_test.py in PSyclone)
yields
node == Type_Declaration_Stmt(Intrinsic_Type_Spec('INTEGER', None), Attr_Spec_List(',', (Attr_Spec('POINTER'),)), Entity_Decl_List(',', (Entity_Decl(Name('l1'), None, None, Initialization('=>', Function_Reference(Name('null'), None))),)))
whereFunction_Reference(Name('null'), None)
should I think beIntrinsic_Function_Reference(Name('null'), None)
instead.For now this requires redirecting these explicitly from
Fparser2Reader()._call_handler
toFparser2Reader()._intrinsic_handler
in branch PSyclone 2586_fparser_function_reference.