aboutsummaryrefslogtreecommitdiff
path: root/flang/docs/C++17.md
diff options
context:
space:
mode:
Diffstat (limited to 'flang/docs/C++17.md')
-rw-r--r--flang/docs/C++17.md16
1 files changed, 8 insertions, 8 deletions
diff --git a/flang/docs/C++17.md b/flang/docs/C++17.md
index f36110a..9137827 100644
--- a/flang/docs/C++17.md
+++ b/flang/docs/C++17.md
@@ -6,7 +6,7 @@
-->
-# C++14/17 features used in f18
+# C++14/17 features used in Flang
```{contents}
---
@@ -27,7 +27,7 @@ out the details of how our C++ code should look and gives
guidance about feature usage.
We have chosen to use some features of the recent C++17
-language standard in f18.
+language standard in Flang.
The most important of these are:
* sum types (discriminated unions) in the form of `std::variant`
* `using` template parameter packs
@@ -41,7 +41,7 @@ in this list because it's not particularly well known.)
## Sum types
First, some background information to explain the need for sum types
-in f18.
+in Flang.
Fortran is notoriously problematic to lex and parse, as tokenization
depends on the state of the partial parse;
@@ -57,7 +57,7 @@ a unified lexer/parser.
We have chosen to do so because it is simpler and should reduce
both initial bugs and long-term maintenance.
-Specifically, f18's parser uses the technique of recursive descent with
+Specifically, Flang's parser uses the technique of recursive descent with
backtracking.
It is constructed as the incremental composition of pure parsing functions
that each, when given a context (location in the input stream plus some state),
@@ -73,7 +73,7 @@ of Fortran.
The specification of Fortran uses a form of BNF with alternatives,
optional elements, sequences, and lists. Each of these constructs
-in the Fortran grammar maps directly in the f18 parser to both
+in the Fortran grammar maps directly in Flang's parser to both
the means of combining other parsers as alternatives, &c., and to
the declarations of the parse tree data structures that represent
the results of successful parses.
@@ -87,10 +87,10 @@ The bounded polymorphism supplied by the C++17 `std::variant` fits
those needs exactly.
For example, production R502 in Fortran defines the top-level
program unit of Fortran as being a function, subroutine, module, &c.
-The `struct ProgramUnit` in the f18 parse tree header file
+`struct ProgramUnit` in the Flang parse tree header file
represents each program unit with a member that is a `std::variant`
over the six possibilities.
-Similarly, the parser for that type in the f18 grammar has six alternatives,
+Similarly, the parser for that type in Flang's grammar has six alternatives,
each of which constructs an instance of `ProgramUnit` upon the result of
parsing a `Module`, `FunctionSubprogram`, and so on.
@@ -99,7 +99,7 @@ parse is typically implemented with overloaded functions.
A function instantiated on `ProgramUnit` will use `std::visit` to
identify the right alternative and perform the right actions.
The call to `std::visit` must pass a visitor that can handle all
-of the possibilities, and f18 will fail to build if one is missing.
+of the possibilities, and Flang will fail to build if one is missing.
Were we unable to use `std::variant` directly, we would likely
have chosen to implement a local `SumType` replacement; in the