Re: Unquoted strings in BASIC
Hans Ã…berg <[email protected]> Wed, 4 Dec 2024 20:00:08 +0100
| Newsgroups | gmane.comp.parsers.bison.general |
|---|---|
| Message-ID | <[email protected]> |
> On 3 Dec 2024, at 21:24, James K. Lowden <[email protected]> = wrote: >=20 > On Tue, 3 Dec 2024 17:57:13 +0100 > Hans =C3=85berg <[email protected]> wrote: >=20 >> In general, one tries to exploit tokens to do special things, which >> is also useful in a Bison parser when adding mid-rule actions. >=20 > That's good advice, hard-won. =20 >=20 >>> it seems it is much easier to parse everything in the data section >>> as a string >=20 > I think you mean to lex each element in the DATA line, removing the > quotes, but not distinguish between number and string? IIUC that will > work fine. Those elements don't *have* a type until they're assigned > to a variable; until then, they're just data, just as is true for > any other kind of input. =20 I meant trying to first write a correct DATA line with the strings = without quotes, and then add a start condition for the strings with = quotes. This is more in line with use in say Scheme, and the example I = gave. It could be the numbers can be distinguished from strings without = quotes, it depends on what you want to put in them.