Re: recursive comments and Re: Techniques for writing an interpreter

pilz@ifi.unizh.ch (\"Markus Pilz\")
24 Mar 1998 22:38:28 -0500

          From comp.compilers

Related articles
[3 earlier articles]
Re: Techniques for writing an interpreter fjh@cs.mu.OZ.AU (1998-03-15)
Re: Techniques for writing an interpreter hgg9140@heckle.ca.boeing.com (1998-03-18)
recursive comments and Re: Techniques for writing an interpreter monnier+comp/compilers/news/@tequila.cs.yale.edu (Stefan Monnier) (1998-03-20)
Re: recursive comments and Re: Techniques for writing an interpreter sestoft@ellemose.dina.kvl.dk (1998-03-20)
Re: recursive comments and Re: Techniques for writing an interpreter monnier+comp/compilers/news/@tequila.cs.yale.edu (Stefan Monnier) (1998-03-20)
Re: recursive comments and Re: Techniques for writing an interpreter bjartem@idi.ntnu.no (Bjarte MayanjaƘstvold) (1998-03-24)
Re: recursive comments and Re: Techniques for writing an interpreter pilz@ifi.unizh.ch (1998-03-24)
Re: recursive comments and Re: Techniques for writing an interpreter sethml@ugcs.caltech.edu (1998-03-24)
| List of all articles for this month |
From: pilz@ifi.unizh.ch (\"Markus Pilz\")
Newsgroups: comp.compilers
Date: 24 Mar 1998 22:38:28 -0500
Organization: Department of Computer Science, University of Zurich
References: 98-03-032 98-03-098 98-03-141 98-03-147 98-03-159 98-03-183
Keywords: syntax

> What languages allow recursive comments ?
> What languages enforce a "lexing" of the content of comments (so that an
> end-comment inside a string inside a comment is ignored) ?


All Oberon implementations I am aware of allow the nesting of comments,
but they do no "lexing" of the contents of comments.


In the scanner, there is a procedure that "consumes" the comment; if
you come accros another start comment ("(*" in Oberon), recursively call
this procedure again. It would be simple to extend the procedure in
order to take care of start/end comments in strings.


Markus


--
  email: pilz@ifi.unizh.ch Markus Pilz, University of Zurich
  voice: +41-1-635 67 12 Department of Computer Science
  fax: +41-1-635 68 09 Winterthurerstr. 190, CH-8057 Zurich
  www: http://www.ifi.unizh.ch/~pilz
--


Post a followup to this message

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