Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #2944

Re: What stage should entities be resolved?

From Martin Ward <martin@gkc.org.uk>
Newsgroups comp.compilers
Subject Re: What stage should entities be resolved?
Date 2022-03-19 18:17 +0000
Organization Compilers Central
Message-ID <22-03-042@comp.compilers> (permalink)
References <22-03-019@comp.compilers> <22-03-025@comp.compilers> <22-03-032@comp.compilers> <22-03-037@comp.compilers>

Show all headers | View raw


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

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

What stage should entities be resolved? Lexical analysis stage? Syntax analysis stage? Semantic analysis stage? Roger L Costello <costello@mitre.org> - 2022-03-09 17:22 +0000
  Re: What stage should entities be resolved? Lexical analysis stage? Syntax analysis stage? Semantic analysis stage? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2022-03-10 09:48 +0100
    Re: What stage should entities be resolved? Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2022-03-12 14:11 +0200
      Re: What stage should entities be resolved? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2022-03-14 19:43 +0100
    Re: What stage should entities be resolved? Roger L Costello <costello@mitre.org> - 2022-03-15 11:49 +0000
      Re: What stage should entities be resolved? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2022-03-18 00:31 +0100
      Re: What stage should entities be resolved? gah4 <gah4@u.washington.edu> - 2022-03-17 17:06 -0700
      Re: What stage should entities be resolved? Kaz Kylheku <480-992-1380@kylheku.com> - 2022-03-18 17:50 +0000
        Re: What stage should entities be resolved? gah4 <gah4@u.washington.edu> - 2022-03-18 14:08 -0700
        Re: What stage should entities be resolved? Martin Ward <martin@gkc.org.uk> - 2022-03-19 18:17 +0000
      Re: What stage should entities be resolved? "matt.ti...@gmail.com" <matt.timmermans@gmail.com> - 2022-03-20 07:32 -0700
  RE: What stage should entities be resolved? Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2022-03-10 12:54 +0200
  Re: What stage should entities be resolved? Lexical analysis stage? Syntax analysis stage? Semantic analysis stage? matt.timmermans@gmail.com - 2022-03-12 05:12 -0800

csiph-web