[flang] proofreading
Original-commit: flang-compiler/f18@2af5c40bc1 Reviewed-on: https://github.com/flang-compiler/f18/pull/229
This commit is contained in:
parent
d1cc618f2c
commit
6dd3b8b724
|
@ -31,7 +31,8 @@ the language has no reserved words in the sense that C++ does.
|
||||||
Fortran parsers implemented with distinct lexing and parsing phases
|
Fortran parsers implemented with distinct lexing and parsing phases
|
||||||
(generated by hand or with tools) need to implement them as
|
(generated by hand or with tools) need to implement them as
|
||||||
coroutines with complicated state, and experience has shown that
|
coroutines with complicated state, and experience has shown that
|
||||||
it's hard to get right and harder to extend as the language evolves.
|
it's hard to get them right and harder to extend them as the language
|
||||||
|
evolves.
|
||||||
|
|
||||||
Alternatively, with the use of backtracking, one can parse Fortran with
|
Alternatively, with the use of backtracking, one can parse Fortran with
|
||||||
a unified lexer/parser.
|
a unified lexer/parser.
|
||||||
|
@ -42,7 +43,7 @@ Specifically, f18's parser uses the technique of recursive descent with
|
||||||
backtracking.
|
backtracking.
|
||||||
It is constructed as the incremental composition of pure parsing functions
|
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),
|
that each, when given a context (location in the input stream plus some state),
|
||||||
either _succeed_ or _fail_ to recognize some piece of Fortran.
|
either _succeeds_ or _fails_ to recognize some piece of Fortran.
|
||||||
On success, they return a new state and some semantic value, and this is
|
On success, they return a new state and some semantic value, and this is
|
||||||
usually an instance of a C++ `struct` type that encodes the semantic
|
usually an instance of a C++ `struct` type that encodes the semantic
|
||||||
content of a production in the Fortran grammar.
|
content of a production in the Fortran grammar.
|
||||||
|
|
Loading…
Reference in New Issue