Screener (computer science)

from Wikipedia, the free encyclopedia

Screener ( engl. , Dt "Sieber".) Referred to in the computer science a component of a compiler . He receives a sequence of tokens from the scanner together with their type and processes them further according to specified rules.

  • White space and comments are usually completely removed because they are no longer required for further processing by the program. Languages ​​like Haskell or Python , which use indentation as a syntactic element, are an exception .
  • Compiler instructions (pragmas) are not part of the program and are passed on to the compiler separately.
  • Keywords are symbols with special meaning in the respective programming language (for example begin, end, var, int) and are received by the screener.
  • Variable names would be too inefficient as identifiers in further processing. They are therefore coded in unique numbers. Since the compiler still has to have access to the external names, they are stored in a data structure that can be efficiently addressed by the assigned codes .

The output of the screener is passed to the parser as input .

The screener is usually combined with the scanner in one module, but it can also be implemented as a separate software component. Nevertheless, it should be seen as a separate concept. The screener should be designed as independently of the target language as possible.

Usually the screener is implemented as a simple state machine .

literature