[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Parsing a language with optional spaces
From: |
Maury Markowitz |
Subject: |
Re: Parsing a language with optional spaces |
Date: |
Mon, 6 Jul 2020 16:01:11 -0400 |
> On Jul 6, 2020, at 3:23 PM, Akim Demaille <akim@lrde.epita.fr> wrote:
>
> FOR/{sp}{id}{sp}={sp}{num}{sp}TO{sp}{num} { printf("for: %s\n", yytext); }
This is a very different style than what I have seen in the past. In the past,
most examples of flex tend to match against the tokens as individual items and
return immediately so that bison can do the grammar check and generation. So in
my existing (semi-working) .l, I followed this style and produced:
FOR { return FOR; }
...
TO { return TO; }
Then over in my .y I have:
FOR variable '=' expression TO expression
Using your method, what would the associated bison look like? Just a single
item matching the entire line?
- Re: Which lexer do people use?, (continued)
- Re: Which lexer do people use?, Christian Schoenebeck, 2020/07/04
- Re: Which lexer do people use?, Akim Demaille, 2020/07/06
- 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 <=
- Re: Parsing a language with optional spaces, Akim Demaille, 2020/07/06
- Re: Parsing a language with optional spaces, John P. Hartmann, 2020/07/07
- 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