Re: Context sensitive scanner ?

"Scott Stanchfield" <thetick@magelang.com>
30 Nov 1997 22:51:58 -0500

          From comp.compilers

Related articles
[4 earlier articles]
Re: Context sensitive scanner ? genew@vip.net (1997-11-23)
Re: Context sensitive scanner ? thetick@magelang.com (Scott Stanchfield) (1997-11-24)
Re: Context sensitive scanner ? cfc@world.std.com (Chris F Clark) (1997-11-28)
Re: Context sensitive scanner ? henry@zoo.toronto.edu (Henry Spencer) (1997-11-28)
Re: Context sensitive scanner ? ok@cs.rmit.edu.au (1997-11-29)
Re: Context sensitive scanner ? hat@se-46.wpa.wtb.tue.nl (Albert Theo Hofkamp) (1997-11-29)
Re: Context sensitive scanner ? thetick@magelang.com (Scott Stanchfield) (1997-11-30)
Re: Context sensitive scanner ? johnm@non.net (1997-11-30)
Re: Context sensitive scanner ? thetick@magelang.com (Scott Stanchfield) (1997-11-30)
Re: Context sensitive scanner ? clark@quarry.zk3.dec.com (Chris Clark USG) (1997-12-05)
Re: Context sensitive scanner ? mark@research.techforce.nl (Mark Thiehatten) (1997-12-07)
Re: Context sensitive scanner ? qjackson@direct.ca (1997-12-07)
| List of all articles for this month |
From: "Scott Stanchfield" <thetick@magelang.com>
Newsgroups: comp.compilers
Date: 30 Nov 1997 22:51:58 -0500
Organization: MageLang Institute - http://www.MageLang.com
References: 97-11-117 97-11-127 97-11-151
Keywords: lex, PCCTS

In ANTLR 2.0, scanners and parsers are both recursive-desecent.


Scanners, parsers and tree walkers all share a very similar grammar syntax.


Terence Parr and I were discussing the idea that we could generalize this
even more, defining ANTLR-generated recursive-descent parsers as having


    input: character OR token OR AST
    output: character OR token OR AST


In other words, you can take any of the input "types" and pump out one of
the output "types". Scanners and parsers already act like pipes (with
character/token buffers in between) so this would lead to a very easy method
of layering scanners/screeners.


I'll have to see where we left this...


-- Scott


=============================================
Scott Stanchfield - http://www.scruz.net/~thetick
MageLang Institute - http://www.magelang.com


VisualAge for Java Tips & Tricks
        http://www.jguru.com/Partners/VAJ/tips


Henry Spencer wrote...
>I do not recall seeing the idea of pushing little coroutines, one per
>syntactic blemish, before. However, the idea that there might be more
>than one layer of scanner is quite old.
--


Post a followup to this message

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