Re: What stage should entities be resolved?

Martin Ward <martin@gkc.org.uk>
Sat, 19 Mar 2022 18:17:14 +0000

          From comp.compilers

Related articles
Re: What stage should entities be resolved? christopher.f.clark@compiler-resources.com (Christopher F Clark) (2022-03-12)
Re: What stage should entities be resolved? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2022-03-14)
Re: What stage should entities be resolved? costello@mitre.org (Roger L Costello) (2022-03-15)
Re: What stage should entities be resolved? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2022-03-18)
Re: What stage should entities be resolved? gah4@u.washington.edu (gah4) (2022-03-17)
Re: What stage should entities be resolved? 480-992-1380@kylheku.com (Kaz Kylheku) (2022-03-18)
Re: What stage should entities be resolved? gah4@u.washington.edu (gah4) (2022-03-18)
Re: What stage should entities be resolved? martin@gkc.org.uk (Martin Ward) (2022-03-19)
Re: What stage should entities be resolved? matt.timmermans@gmail.com (matt.ti...@gmail.com) (2022-03-20)
| List of all articles for this month |
From: Martin Ward <martin@gkc.org.uk>
Newsgroups: comp.compilers
Date: Sat, 19 Mar 2022 18:17:14 +0000
Organization: Compilers Central
References: 22-03-019 22-03-025 22-03-032 22-03-037
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="63378"; mail-complaints-to="abuse@iecc.com"
Keywords: parse, design
Posted-Date: 19 Mar 2022 17:50:09 EDT
In-Reply-To: 22-03-037
Content-Language: en-GB

On 2022-03-15, Roger L Costello <costello@mitre.org> wrote:
> 1. How much knowledge of the language should the preprocessor stage have?


In general, the preprocessor processes one language and passes
the result to a compiler which processes a different (but often
closely related) language. So the preprocessor can be thought of
as a text to text language translator (the first C++ compiler
was implemented as macros in the C preprocessor which accepted
C++ source code and generated C source code). As a language
tranlslator it should ideally know all about the input language
that it is processing and only generate valid output. In practice,
of course, many preprocessors have a very limited understanding
of the source language they are processing and pass on syntax errors
to the compiler (perhaps with hints about which line of the original
source file this line of code came from).


--
Martin


Dr Martin Ward | Email: martin@gkc.org.uk | http://www.gkc.org.uk
G.K.Chesterton site: http://www.gkc.org.uk/gkc | Erdos number: 4


Post a followup to this message

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