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: Sun, 1 Dec 2024 17:52:05 +0100

> On 1 Dec 2024, at 16:07, Maury Markowitz <maury.markowitz@gmail.com> wrote:
> 
> But many dialects allow strings to be unquoted as long as they do not contain 
> a line end, colon or comma:
> 
> 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>{
  …
  \n { BEGIN(INITIAL); }
}
with … being special syntax for this context, and exiting the context on \n.





reply via email to

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