Vadim Zaytsev aka @grammarware

(Un)Parsing in a Broad Sense Parsing in a Broad Sense


Having multiple representations of the same instance is common in software language engineering: models can be visualised as graphs, edited as text, serialised as XML. When mappings between such representations are considered, many terms are used with incompatible meanings and varying sets of underlying assumptions:

This is the (mega)model of 12 classes of artefacts found in software language processing (dotted lines denote mappings that rely on either lexical or syntactic definitions; solid lines denote universally defined mappings. The loops are examples of transformations):

Bidirectional megamodel of parsing and unparsing

It can be used to systematically explore the technical research space of bidirectional mappings to build on top of the existing body of work and discover as of yet unused relationships.

Artefacts

BX mega, logo by Vadim Zaytsev

STR
a string, a file, a byte stream
TOK
a finite sequence of strings (called tokens) which, when concatenated, yields STR; includes spaces, line breaks, comments, etc — collectively, layout
TTK
a finite sequence of typed tokens, possibly with layout removed, some classified as numbers, strings, etc
LEX
a lexical source model that addes grouping to typing; in fact a possibly incomplete tree connecting most tokens together in one structure
FOR
a forest of parse trees, a parse graph or an ambiguous parse tree with sharing; a tree-like structure that models STR according to a syntactic definition
PTR
an unambiguous parse tree where the leaves can be concatenated to form STR
CST
a parse tree with concrete syntax information; structurally similar to PTR, but abstracted from layout and other minor details; comments could still be a part of the CST model, depending on the use case
AST
a tree which contains only abstract syntax information
PIC
a picture, which can be an ad hoc model, a “natural model” or a rendering of a formal model
DRA
a graphical representation of a model (not necessarily a tree), a drawing in the sense of GraphML or SVG, or a metamodel-indepenent syntax but metametamodel-specific syntax like OMG HUTN
DIA
a diagram, a graphical model in the sense of EMF or UML, a model with an explicit advanced metamodel

Publications / presentations



The page is maintained by Dr. Vadim Zaytsev a.k.a. @grammarware. Last updated: May 2015.
XHTML 1.0 CSS 2.1