Talk:Transformation language

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Sugestion: merge article Data transformation here. --Krauss (talk) 11:09, 8 March 2011 (UTC)

Other types of transformational languages[edit]

Why is this only about text transformational languages. As an example the TREE-META unparse transformation rules. They transform a tree structure into sequential instruction code.

A lexer transform a string into tokens. A parser transforms token lists into a tree structure.

Many transformational languages have a form of pattern and action rule structure:

 <pattern> -> <action>

or

 <pattern> -> <replacement>

Some use imbeaded actions. TREE-META's syntax rules transform input into tree structures.

 EXPR = TERM $(('+':ADD/'-':SUB) TERM [2]);
 TERM = FACTOR $(('*':MPY/'/':DIV) FACTOR [2]);
 FACTOR = .ID / .NUMBER / '(' EXPR ')';

The above rules recognize an arithmetic expression in text form and transform it into an abstract syntax tree:

a*(b+c) >> MPY[a,ADD[b,c]]

     MPY
    /   \
   a    ADD
       /   \
      b     c

The unparse rules are of the form:

 <tree pattern> -> <action>

Chomsky grammars are an example of the pattern replacement type. Steamerandy (talk) 12:40, 11 November 2015 (UTC)