[Coco] dbg.l

Stephen H. Fischer SFischer1 at Mindspring.com
Fri May 6 13:19:05 EDT 2011


Hi,

As OS-9 "C" is just K&R it must have been done on other platforms.

Are you saying something like an Urbane (DECB) to K&R "C", BasicO9 ... could 
be done automagically.

It has been decades since I read about 'yacc' or bison.

It was so far into my distant past that I misunderstood 'lint'.

SHF



----- Original Message ----- 
From: "Steven Hirsch" <snhirsch at gmail.com>
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Sent: Friday, May 06, 2011 4:50 AM
Subject: Re: [Coco] dbg.l


> On Thu, 5 May 2011, Stephen H. Fischer wrote:
>
>> Hi,
>>
>> Remind me of what LEX is. My idea perhaps matches something else I saw
>> during my searches.
>
> It's generically known as a token-scanner or "tokenizer".  Usually the
> first step in writing a language translator.  The tokenizer breaks up the
> original source into tokens (or "lexemes" in the literature) which may
> additionally have a value.  So, something like:
>
> if ( foo ) ..
>
> might become
>
> token value
>
> IF_SYM (none)
> '(' (none)
> IDENTIFIER_SYM "foo"
> ')' (none)
>
> etc.  Single characters are generally represented by their ASCII rank
> (integers in 0..255). Symbolic tokens (e.g. 'if') are defined as integers
>>255.
>
> That token stream is fed to the parser which tries to fit it into the
> defined grammar for the language in question.  In classic Unix
> environments the parser is generated from a grammar definition by 'yacc'
> (or 'bison' in the brave GNU world) which stands for "Yet Another Compiler
> Compiler"...
>
> Probably more than you wanted to know, but language translators are a
> favorite subject of mine.
>
> Steve




More information about the Coco mailing list