0

Is there a succinct term for the phase of a compiler or interpreter which identifies special methods, such as constructors and destructors? I think it probably fits under semantic analysis somewhere but I am wondering if there is a more specific term which may be helpful when naming a function which performs such a duty.

Levi Morrison
  • 19,116
  • 7
  • 65
  • 85
  • 2
    Generally between the initial parsing and semantic analysis and the final code generation there are several steps, some of which are generic (data flow analysis, eg) and some which are quite specialized. Simply recognizing a component such as a "constructor" would generally be semantic analysis, but doing anything special for such a method would be a separate step. – Hot Licks Sep 20 '14 at 02:48
  • 1
    There wouldn't be such a phase. It would happen as part of semantic analysis. – user207421 Sep 20 '14 at 07:47
  • You need to assume that they are just not very special. This is easily discovered when you parse the code, a direct consequence of the language syntax. So can be directly marked in the symbol table. – Hans Passant Sep 20 '14 at 11:32

2 Answers2

1

I am not aware of a standard name. What about Special Method Tagging?

Note that constructors/destructors can in many languages be identified by grammar alone, so there is no need for a phase or name to identify them.

Alexander Gessler
  • 45,603
  • 7
  • 82
  • 122
0

A 'phase' in compiler construction correponds to a complete pass over the source text or the parse tree. There is no need for such a 'phase' to process constructors, destructors, overloaded operators, etc. It happens as part of the semantic analysis and code generation phases.

user207421
  • 305,947
  • 44
  • 307
  • 483