Gfortran internal tree structure
Paul Richard Thomas
paul.richard.thomas@gmail.com
Wed Jun 18 15:33:00 GMT 2008
Daniel,
> What do you think about writing a (maybe just quite summarizing)
> documentation about how gfc_code statements and gfc_expr expressions have to
> be structured for IF, DO, things like "a+5" or "ALLOCATED(arr)" and whatever
> comes to mind? Or is there already such documentation and I missed it?
Don't think, just do! yes, yes!
>
> If you want and I find time, I volunteer to start this in parallel to my
> coding; but I think for that I need at least a good reviewer as I'm not
> myself a guru on this topic :) Additionally, if you think that's a good
> idea, I could write builder-functions (maybe in a new code file
> build-tree.c); for instance, given a code-block and a condition, build a
> complete (resolved?) IF-gfc_code block; and similar for other constructs and
> expressions (build a less-than expression given two operands or a
> function-call given the list of actual argument expressions and the
> symbl/symtree/name. These could serve both as a secondary documentation on
> how such an expression really looks like and be used to combine this logic
> where it's used in the code (during parsing and at places like my
> finalization routines during resolution).
This is done, of course, in the parser. Whether it would be
worthwhile to extract builder functions from the parser, both for
maintainability and clarity, I do not know. This is effictively done
in array.c and arith.c.
Incidentally, dump-parse-tree.c could do with updating and, I have no
doubt, could always stand some improvement in the format.
Cheers
Paul
More information about the Fortran
mailing list