-fdump-parse-tree
Tobias Schlüter
tobias.schlueter@physik.uni-muenchen.de
Mon Sep 12 19:39:00 GMT 2005
Christopher D. Rickett wrote:
>>Isn't the change in indentation levels sufficient for this? Output of the
>>code always starts at indentation level 0, whereas the symbol table output
>>starts at indentation level 1. (For the definition of this see in
>>code_indent(), and also the use of show_level in gfc_show_namespace. Also
>>note that gfc_show_code() is always called with level = 0 from there.)
>
>
> The indentation level change is sufficient, and is what we currently use.
> The use of braces would simplify the job though and could prevent us from
> relying on whitespace in the grammar.
There is no grammar :-) A possibly safer alternative would be a keyword-based
approach: there's only a small number of possible words a code line begins
with (they're enumerated in gfc_show_code_node), and likewise there's only a
small number of words that a line with namespace information begins with
("Array spec", "symtree", "symbol", "Namespace", and maybe the odd one I'm
missing in the random file I tried this with).
I don't know if it would be GNU-ically correct to provide a documented
intermediate representation, in the case of C-like languages the FSF is
strictly against this, unless they changed their mind since this came up the
last time.
- Tobi
More information about the Fortran
mailing list