> On 2 Dec 2024, at 03:10, Maury Markowitz <maury.markow...@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