Sunday, 11 March 2012

Syntactic preprocessors

yntactic preprocessors were alien with the Lisp ancestors of languages. Their role is to transform syntax copse according to a cardinal of user-defined rules. For some programming languages, the rules are accounting in the aforementioned accent as the affairs (compile-time reflection). This is the case with Lisp and OCaml. Some added languages await on a absolutely alien accent to ascertain the transformations, such as the XSLT preprocessor for XML, or its statically typed analogue CDuce.

Syntactic preprocessors are about acclimated to adapt the syntax of a language, extend a accent by abacus fresh primitives, or bury a Domain-Specific Programming Accent central a accepted purpose language.

Customizing syntax

A acceptable archetype of syntax customization is the actuality of two altered syntaxes in the Objective Caml programming language.1 Programs may be accounting agilely application the "normal syntax" or the "revised syntax", and may be pretty-printed with either syntax on demand.

Similarly, a cardinal of programs accounting in OCaml adapt the syntax of the accent by the accession of fresh operators.

No comments:

Post a Comment