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: Wed, 4 Dec 2024 20:00:08 +0100

> On 3 Dec 2024, at 21:24, James K. Lowden <jklowden@schemamania.org> wrote:
> 
> On Tue, 3 Dec 2024 17:57:13 +0100
> Hans Åberg <hans.aberg_1@icloud.com> wrote:
> 
>> In general, one tries to exploit tokens to do special things, which
>> is also useful in a Bison parser when adding mid-rule actions.
> 
> That's good advice, hard-won.   
> 
>>> it seems it is much easier to parse everything in the data section
>>> as a string
> 
> 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.  

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.





reply via email to

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