help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Flex help anyone ?


From: Vincent Zweije
Subject: RE: Flex help anyone ?
Date: Tue, 13 Jan 2004 19:35:11 +0100

Wim Delvaux wrote:

> Subject: Re: Flex help anyone ?

> On Tuesday 13 January 2004 16:56, Mike Aubury wrote:
> > Yes - I know this is a bison list - but someone might know...

Well... there *is* a flex list too...

> > In the language I'm trying to parse - its permissible to embed
> > quotes within a string if you double up..

> >     "Hello ""World"" would be ok"
> > 
> > Obviously - I'm getting this back as three strings ("Hello " ,
> > "World"  & "would be ok") which is messing up the parser...

> \"(\"\"|[^"])*\"

Also define one without the closing quote; flex will use it as
fallback when the closing quote is missing, for instance at end
of line or end of file.

It improves the error message you can give, because the whole
unterminated string can be flagged as an error.

If you don't do this, flex will (depending on your default rule)
complain that the opening quote is an invalid character, or do
even weirder things when there are embedded quotes in the
unterminated string.
-- 
Answer: no.
Question: should I reply before the quote?




reply via email to

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