This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Gfortran internal tree structure
- From: "Paul Richard Thomas" <paul dot richard dot thomas at gmail dot com>
- To: "Daniel Kraft" <domob1812 at gmail dot com>
- Cc: "Fortran List" <fortran at gcc dot gnu dot org>
- Date: Wed, 18 Jun 2008 17:32:14 +0200
- Subject: Re: Gfortran internal tree structure
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=znKy9qBrSlrOTHR5NgYhHo24lJwRUEWf0OG5XDhm3Rw=; b=RSWpHT3fhc9r80xABInm0P261vWDEoNjXTHaYHEijB8IGqnPJUrgPZteCjYR7t23OB vy3nDARJaYFfaQK7D8/XTs39W3jEJUThi3Xzwg19qU3PrIAbFpmssG9il3ftBRDsZ3re eGtqvOmHz19HYgOdqYDXtw9sumNkIdwjeILII=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=PNcaKENYImqxCNHzm+DdWNcLPgD3PMKP3NScCgcS1LAaKVpS7bpdRysPNVinDwLP7N bHbIbx/dLe9huV/wc4CVWWjKoNc0KwylHhZ0jXChR8EfFHEzpo+mPnPUL3dztd8w88ot w/2CCSu/M2hPn3Mb2Dmz+6GetJvYnlbfUrl6g=
- References: <4859268E.5040908@domob.eu>
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