[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Parsing a language with optional spaces
From: |
John P. Hartmann |
Subject: |
Re: Parsing a language with optional spaces |
Date: |
Tue, 7 Jul 2020 10:55:12 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 7/7/20 05:35, Akim Demaille wrote:
I believe you need to read again the documentation of /
'r/s'
It is not as simple as that. As I don't speak BASIC, let me rephrase
this problem in FORTRAN IV which is also "blank agnostic":
DO <number> <variable> = <expression> , <expression> [, <expression>]
It is not until you reach the comma after the first expression that you
know whether the statement is the beginning of a loop or it is an
assignment. And the expression can contain commas in function calls,
which defeats any trivial lookahead scanning. E.g.,
D O 17 6PQ R=FUN X(1 4, V 8)
is an assignment to variable DO176PQR. The function arguments can also
be expressions that contain function calls.
As you can see, this more or less defeats any attempt to write a lex
scanner. And you cannot just squeeze out all blanks in a front end
because "Hollerith fields" can contain blanks that are significant (must
remain).
- Re: Which lexer do people use?, (continued)
- Re: Which lexer do people use?, Maury Markowitz, 2020/07/06
- Re: Which lexer do people use?, Christian Schoenebeck, 2020/07/06
- Parsing a language with optional spaces, Maury Markowitz, 2020/07/06
- Re: Parsing a language with optional spaces, Christian Schoenebeck, 2020/07/06
- Re: Parsing a language with optional spaces, Maury Markowitz, 2020/07/06
- Re: Parsing a language with optional spaces, Christian Schoenebeck, 2020/07/06
- Re: Parsing a language with optional spaces, Akim Demaille, 2020/07/08
- Re: Parsing a language with optional spaces, Akim Demaille, 2020/07/06
- Re: Parsing a language with optional spaces, Maury Markowitz, 2020/07/06
- Re: Parsing a language with optional spaces, Akim Demaille, 2020/07/06
- Re: Parsing a language with optional spaces,
John P. Hartmann <=
- Re: Parsing a language with optional spaces, uxio prego, 2020/07/07
- Re: Parsing a language with optional spaces, Akim Demaille, 2020/07/08
- Re: Parsing a language with optional spaces, Christian Schoenebeck, 2020/07/08
- Re: Parsing a language with optional spaces, Akim Demaille, 2020/07/08
- Re: Parsing a language with optional spaces, Christian Schoenebeck, 2020/07/08
- Re: Parsing a language with optional spaces, Daniele Nicolodi, 2020/07/08
- Re: Parsing a language with optional spaces, Akim Demaille, 2020/07/09
- Re: Parsing a language with optional spaces, Akim Demaille, 2020/07/09
- Re: Parsing a language with optional spaces, uxio prego, 2020/07/11
- Re: Parsing a language with optional spaces, Christian Schoenebeck, 2020/07/12