help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unquoted strings in BASIC


From: Hans Åberg
Subject: Re: Unquoted strings in BASIC
Date: Mon, 2 Dec 2024 15:49:33 +0100

> On 2 Dec 2024, at 03:10, Maury Markowitz <maury.markowitz@gmail.com> wrote:
> 
> I had managed to get to this point for testing the conditional states:
> 
> <DATA>[^0-9][A-Za-z]*[,:\n] {
>           yytext[strlen(yytext) - 1] = '\0';
>           yylval.s = str_new(yytext + 1);
>           return STRING;
>         }

Notice that start conditions are implemented as defines in Flex, so give them 
unique names. Above you could not use “DATA” for something else.

As an example, I implemented arbitrary identifiers “…” using %x any_identifier 
here:
https://git.savannah.gnu.org/cgit/metalogic-inference.git/tree/src/database-lexer.ll





reply via email to

[Prev in Thread] Current Thread [Next in Thread]