Abstract syntax

An abstract syntax describes the generic structure of the data types regardless of the encoding technique that is used to represent these types of data.

Programming languages

Abstract syntax is also found in compilers for programming languages. The concrete syntax of a language is what the programmer must tap. For example, could be defined in a programming language:

If-statement :: = "if" condition "then" statements " endif " In another programming language which might look quite different:

If-statement :: = " ( " "if" conditional statements " ) " A translator who understands both languages ​​, will treat such instructions internally exactly the same, namely as a data structure with two fields: Condition and instructions. This representation is called the abstract syntax. The keywords like "if", "then", "endif " are no longer needed after parsing and therefore omitted. They are only part of the concrete syntax, but not the abstract.

  • Compiler
  • Type theory
25840
de