Commit graph

76 commits

Author SHA1 Message Date
peter klausler
20364f0351 [flang] Ensure that the parse tree visitation Walk template works on FORMAT.
The classes that were segregated into format-specification.h have
also been grouped into a new Fortran::format namespace.
Code added to tools/f18/f18.cc to run a minimal visitor over
the parse trees resulting from successful parses so that any
future build problems with Walk() will be caught earlier.

Rearrange Walk instances, keep format:: ones together.

Original-commit: flang-compiler/f18@685ddb91ce
Reviewed-on: https://github.com/flang-compiler/f18/pull/22
2018-03-01 13:35:58 -08:00
peter klausler
1b0705ca0f [flang] Fix parsing error on PROCEDURE statement in derived type definition.
Improve error recovery in that context.

Original-commit: flang-compiler/f18@b9e48504e6
Reviewed-on: https://github.com/flang-compiler/f18/pull/21
2018-03-01 11:28:13 -08:00
peter klausler
03aecfc336 [flang] Preserve some minor changes that accumulated as I was implementing
an unparsing feature.

Enum classes in parse tree node class types are now defined with
a macro so that the names of the enumerations can be captured for
formatting purposes.

Add a TODO comment.

Rebase to new master with parse tree traversal code.

Original-commit: flang-compiler/f18@d6bfcfd526
Reviewed-on: https://github.com/flang-compiler/f18/pull/16
2018-02-26 15:31:46 -08:00
Tim Keith
2af29bc1e2 [flang] Add Unparse function.
Unparse takes a parse tree and converts it back to Fortran.
class UnparseVisitor implements a parse tree visitor that emits
the appropriate Fortran source for each node that it visits.
It is only partially implemented so far.

Change f18 to dump the parse tree using Unparse.

Original-commit: flang-compiler/f18@e80c13ec88
Reviewed-on: https://github.com/flang-compiler/f18/pull/15
2018-02-26 14:52:27 -08:00
Tim Keith
2ca306abe1 [flang] Rename "visit" to "Walk" to avoid conflict with std::visit.
The thing called on each parse tree node during the walk is still
referred to as a visitor.

Change "pre" to "Pre" and "post" to "Post" to follow the naming
conventions.

Original-commit: flang-compiler/f18@a6ea1296b1
Reviewed-on: https://github.com/flang-compiler/f18/pull/15
Tree-same-pre-rewrite: false
2018-02-26 14:52:27 -08:00
Tim Keith
9f07a4a3d8 [flang] First implementation of a parse tree visitor
Original-commit: flang-compiler/f18@0b441831f4
Reviewed-on: https://github.com/flang-compiler/f18/pull/15
Tree-same-pre-rewrite: false
2018-02-26 14:52:27 -08:00
Stephane Chauveau
8f6f23fc54 [flang] Add simple recursive CMake directory structure
Original-commit: flang-compiler/f18@a021b2ca76
Reviewed-on: https://github.com/flang-compiler/f18/pull/13
Tree-same-pre-rewrite: false
2018-02-19 14:28:12 +01:00
peter klausler
7af9dd8736 [flang] Remove old character "cooking" parser combinators that handled Fortran
comments, continuations, &c. that have become obsolete with the use
of the new C++-coded prescanner module.  Clean out members from
ParseState that were used only by cookedNextChar and its sub-parsers.

Original-commit: flang-compiler/f18@41717531e5
Reviewed-on: https://github.com/flang-compiler/f18/pull/11
Tree-same-pre-rewrite: false
2018-02-16 10:41:16 -08:00
peter klausler
fcb6b2a558 [flang] Remove a temporary #include <iostream> and auto-detect -Mfixed from a .f suffix.
Original-commit: flang-compiler/f18@962c7ed0ef
Reviewed-on: https://github.com/flang-compiler/f18/pull/10
2018-02-15 17:12:50 -08:00
peter klausler
6595462268 [flang] Complete merge of provenance feature.
Original-commit: flang-compiler/f18@646f68be61
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler
edbec459fb [flang] Complete provenance tracking through macro calls.
Original-commit: flang-compiler/f18@8c05a6543b
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler
67d916f8ba [flang] More precise source locations on error messages. Anticipate module file scanning.
Original-commit: flang-compiler/f18@f4faadd389
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler
10a36336df [flang] Implement a directory search path for INCLUDE lines.
Original-commit: flang-compiler/f18@62129e5600
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler
fe04c3a02f [flang] Implement Fortran INCLUDE lines.
Original-commit: flang-compiler/f18@d01af89506
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler
5b61beaa12 [flang] Preparatory work for file inclusion.
Original-commit: flang-compiler/f18@1cbbd4a357
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler
97a7c501dc [flang] Forge provenances for compiler-inserted text.
Original-commit: flang-compiler/f18@dbdd01aa25
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler
3bca5d088e [flang] Restructure inter-class references for clarity.
Original-commit: flang-compiler/f18@1836cd5d06
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler
90c3cad9a7 [flang] Debugging new provenance support.
Original-commit: flang-compiler/f18@1233f666da
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
peter klausler
09865ffe7b [flang] Replace Position with Provenance everywhere.
Original-commit: flang-compiler/f18@8c2da3f8cc
Reviewed-on: https://github.com/flang-compiler/f18/pull/9
Tree-same-pre-rewrite: false
2018-02-15 15:58:44 -08:00
Tim Keith
4a735b61c6 [flang] Rename methods with uppercase names.
Original-commit: flang-compiler/f18@00fec54e5a
Reviewed-on: https://github.com/flang-compiler/f18/pull/8
2018-02-15 08:27:19 -08:00
Tim Keith
e8707d3706 [flang] Add test-type.cc to build types from parse tree.
Original-commit: flang-compiler/f18@47101317fb
Reviewed-on: https://github.com/flang-compiler/f18/pull/8
Tree-same-pre-rewrite: false
2018-02-14 15:29:18 -08:00
Steve Scalpone
ac364b1786 [flang] Revert "Schauveau cmake"
Original-commit: flang-compiler/f18@be33dc182a
Reviewed-on: https://github.com/flang-compiler/f18/pull/7
2018-02-14 09:06:47 -08:00
Stephane Chauveau
ab1dbce5a4 [flang] after clang-format
Original-commit: flang-compiler/f18@7e464a7c33
Reviewed-on: https://github.com/flang-compiler/f18/pull/6
Tree-same-pre-rewrite: false
2018-02-09 10:09:20 +01:00
Stephane Chauveau
c27603ec9c [flang] Add new global CMakefile infrastructure with examples
Original-commit: flang-compiler/f18@81b91f3270
Reviewed-on: https://github.com/flang-compiler/f18/pull/6
Tree-same-pre-rewrite: false
2018-02-09 10:09:20 +01:00
peter klausler
14322536e3 [flang] Tweaked .clang-format, then ran it.
Original-commit: flang-compiler/f18@e10e43b691
Reviewed-on: https://github.com/flang-compiler/f18/pull/4
2018-02-07 12:27:36 -08:00
peter klausler
0ba1a14be2 [flang] Impose a directory structure. Move files around. Introduce
an intermediate "parser" namespace.

Original-commit: flang-compiler/f18@690b6f0d1e
Reviewed-on: https://github.com/flang-compiler/f18/pull/4
Tree-same-pre-rewrite: false
2018-02-07 12:04:42 -08:00