Re: Languages with optional spaces

"Ev. Drikos" <drikosev@gmail.com>
Sun, 23 Feb 2020 12:33:36 +0200

          From comp.compilers

Related articles
Languages with optional spaces maury.markowitz@gmail.com (Maury Markowitz) (2020-02-19)
Re: Languages with optional spaces awanderin@gmail.com (Jerry) (2020-02-20)
Re: Languages with optional spaces drikosev@gmail.com (Ev. Drikos) (2020-02-23)
Re: Languages with optional spaces maury.markowitz@gmail.com (Maury Markowitz) (2020-02-25)
Re: Languages with optional spaces maury.markowitz@gmail.com (Maury Markowitz) (2020-02-25)
Re: Languages with optional spaces martin@gkc.org.uk (Martin Ward) (2020-02-25)
Re: Languages with optional spaces 493-878-3164@kylheku.com (Kaz Kylheku) (2020-02-26)
Re: Languages with optional spaces awanderin@gmail.com (awanderin) (2020-02-26)
Re: Languages with optional spaces drikosev@gmail.com (Ev. Drikos) (2020-02-28)
[12 later articles]
| List of all articles for this month |

From: "Ev. Drikos" <drikosev@gmail.com>
Newsgroups: comp.compilers
Date: Sun, 23 Feb 2020 12:33:36 +0200
Organization: Aioe.org NNTP Server
References: 20-02-015
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="60628"; mail-complaints-to="abuse@iecc.com"
Keywords: lex, comment
Posted-Date: 23 Feb 2020 21:15:38 EST
Content-Language: en-US

On 19/02/2020 17:35, Maury Markowitz wrote:
> ... Likewise, one might modify the variable name
> pattern, but I'm not sure how one says "everything that doesn't start with one
> of these other 110 patterns".
>


This should be relatively simple with a scanner generator that supports
intersection and negation operators (or difference operators), but IMHO
such a rule would work ie if FORI wasn't a valid variable name. Still I
can't propose to you a specific tool though.


With a tool like flex, I'd try to see if different start states do work:
https://www.cs.virginia.edu/~cr4bd/flex-manual/Start-Conditions.html


Ev. Drikos
[You can try start states but in my experience if the tokenizing rules
are very context sensitive, it's easier to give up and hand-code the
lexer. The lexical syntax of Basic isn't that big. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.