Re: Unquoted strings in BASIC

Hans Ã…berg <[email protected]> Sun, 1 Dec 2024 17:52:05 +0100
Newsgroups gmane.comp.parsers.bison.general
Message-ID <[email protected]>
> On 1 Dec 2024, at 16:07, Maury Markowitz <[email protected]> =
wrote:
>=20
> But many dialects allow strings to be unquoted as long as they do not =
contain a line end, colon or comma:
>=20
> DATA 10,20,HELLO,WORLD!

One way is to use context switches; see the Flex and Bison manuals.

In the .l file one has say:

%x DATA_decl

%%

DATA { BEGIN(DATA_decl); }

<DATA_decl>{
  =E2=80=A6
  \n { BEGIN(INITIAL); }
}
with =E2=80=A6 being special syntax for this context, and exiting the =
context on \n.