<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A New Life for Legacy Language De nition Approaches??</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Mikhail Barash</string-name>
          <email>mikhail.barash@uib.no</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Attempts to Specify Algol</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Bergen Language Design Laboratory, University of Bergen</institution>
          ,
          <addr-line>N-5020 Bergen</addr-line>
          ,
          <country country="NO">Norway</country>
        </aff>
      </contrib-group>
      <fpage>75</fpage>
      <lpage>84</lpage>
      <abstract>
        <p>When syntax of software languages is communicated, contextfree grammars are a lingua franca. They de ne structure of syntax, but cannot express static semantics. The paper gives an overview of other successful models (attribute, two-level, parsing expression, conjunctive, Boolean grammars) in relation to de ning software languages. Author's model|grammars with contexts|can naturally express that \a valid identi er is an identi er that was declared before", and was used to dene static semantics of a small typed language. This paper discusses what prevents the practical use of the model in SLE and states open problems for further research.</p>
      </abstract>
      <kwd-group>
        <kwd>Boolean grammars</kwd>
        <kwd>Grammars with contexts</kwd>
        <kwd>Parsing ex- pression grammars</kwd>
        <kwd>Syntax de nition</kwd>
        <kwd>Language workbenches</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>is symbol x repeated n times.</p>
      <p>begin real x x ; x x := x x ; end</p>
      <p>| {nz } | {nz } | {nz }
For this program to be valid, number n should be the same in all its three
occurrences. Under certain encoding, such programs can be represented as strings
of the form anbncn, for some symbols a; b; c; these strings form a well-known
non-context-free language. Nevertheless, context-free grammars are capable of
de ning the structure of such programs: indeed, as required by Algol's syntax,
statements are separated by semicolons, there is an identi er in the left-hand
side of the assignment operator, sequence of statements is framed with correctly
spelled keywords begin/end, etc. Below is an example of a program that satis es
these conditions.</p>
      <p>begin real x; xx:=xxx; end
This program will be considered correct despite containing undeclared identi ers.</p>
      <p>Context-free grammars de ne structural syntax of languages, but cannot
express any facts about their static semantics (what is called context conditions ).
It is impossible to specify in a context-free grammar that every identi er should
be declared before use, or that the number of formal parameters and actual
arguments in a function call should agree. Context-sensitive grammars (initially
proposed by Chomsky to describe syntax of natural languages) are powerful
enough to de ne these conditions, but they are equivalent to nondeterministic
linear-bounded Turing machines, in which the \nonterminal symbols", meant to
represent syntactic categories, could be freely manipulated as tape symbols. No
parsing algorithms with polynomial time complexity exist for such grammars1.</p>
      <p>
        Subsequent research was done in two main directions: to embed \checking
actions" into rules of a context-free grammar, and to come up with an entirely
new grammatical model. The rst approach led to attribute grammars [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ] and
syntax-directed translation. In a grammar, every rule is associated with semantic
actions, which, for example, may use symbol tables to look up whether a certain
variable has been previously declared.
      </p>
    </sec>
    <sec id="sec-2">
      <title>VariableDecl</title>
      <p>::=</p>
      <p>
        \var" ident JsymbTable.safeAdd($1);K \;"
In this example, method safeAdd could check whether an identi er with the
same name (the name of the \current" identi er is referred to by $1) has been
declared and, if so, raise an exception. Otherwise, the new identi er is added to
the symbol table. Such essentially ad hoc techniques are still used in
industrylevel compiler compilers [
        <xref ref-type="bibr" rid="ref18 ref40">18,40</xref>
        ].
      </p>
      <p>
        The other direction of research was to develop a reasonable (that is, e ciently
parsable) model, which would be able to specify the desired context conditions.
Of many such attempts, two-level grammars by van Wijngaarden received some
1 It is worth noting here context-sensitive parsing algorithms by Kuno [
        <xref ref-type="bibr" rid="ref27">27</xref>
        ] and
Woods [
        <xref ref-type="bibr" rid="ref47">47</xref>
        ] that avoid producing several equivalent derivations of the input string|
which is an issue with other parsing algorithms for context-sensitive grammars.
attention: they were used to formally specify syntax and static semantics of Algol
68 [
        <xref ref-type="bibr" rid="ref43 ref44">44,43</xref>
        ]. Unfortunately, two-level grammars soon turned out to be
Turingcomplete: this makes impossible any practical parsing algorithms for them.
2
      </p>
      <sec id="sec-2-1">
        <title>Logics and Order for Static Semantics</title>
        <p>
          Parsing expression grammars by Ford [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ] introduce ordering of rules in a
contextfree grammar2: the choices are tried in order and the rst one to succeed is used
to parse the string. This is useful in disambiguating constructs like if-then-else
statements.
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>IfStmt \if" Expr \then" Stmts \else" Stmts = \if" Expr \then" Stmts</title>
      <p>This rule matches a conditional statement in a way that the optional else clause
always binds to the innermost if. Without priority of rules, the rule would lead
to dangling else ambiguity.</p>
      <p>Parsing expression grammars also provide predicates for Boolean conjunction
(&amp;) and negation (!). The following rules de ne nested comments in Pascal [20,
p. 509].</p>
    </sec>
    <sec id="sec-4">
      <title>Comment \(*" CommentedText \*)"</title>
    </sec>
    <sec id="sec-5">
      <title>CommentedText Comment = ! \*)" .</title>
      <p>A comment consists of an opening token \(*", some commented text, and a
closing token \*)". This construct is non-trivial to recognize because the commented
text may contain symbols \*" and \)", but not the sequence \*)". Moreover,
comments may again contain comments: (* a:=b; (* comment *) *) is a
correct statement. This construct can be recognized by the given rules: the idea
is that CommentedText is either a complete comment or any symbol (expressed
as \." in parsing expression grammars) provided that it does not start with
the string \*)" (this is expressed by the negation predicate !\*)"). Similarly to
negation, conjunction in parsing expression grammars is used as a mechanism
of lookahead.</p>
    </sec>
    <sec id="sec-6">
      <title>BulletList</title>
    </sec>
    <sec id="sec-7">
      <title>List</title>
      <p>&amp; BulletSymb List</p>
    </sec>
    <sec id="sec-8">
      <title>Item ! BulletSymb</title>
      <p>
        These rules de ne the structure of bullet lists in Markdown. Rule for BulletList
rst veri es whether the rst element of a list starts with a bullet symbol and
only then it tries to recognize the string according to the rule for List. In the
second rule, ! BulletSymb expresses that the list cannot end at a position where
there is still a bullet symbol to be consumed.
2 Recent work on extending parsing expression grammars towards context-sensitive
parsing includes, for example, principled stateful parsing [
        <xref ref-type="bibr" rid="ref29">29</xref>
        ] and parser
combinators [
        <xref ref-type="bibr" rid="ref28">28</xref>
        ].
      </p>
      <p>
        A systematic study of Boolean operations in grammars led to conjunctive [
        <xref ref-type="bibr" rid="ref37">37</xref>
        ]
and Boolean grammars [
        <xref ref-type="bibr" rid="ref26 ref31 ref34 ref42">34,42,26,31</xref>
        ]. In such grammars, a rule S ! A &amp; B
de nes all strings produced both by A and B, and a rule S ! A &amp; :B de nes
all strings produced by A but not produced by B at the same time.
      </p>
      <sec id="sec-8-1">
        <title>ValidIdentifier ! ident</title>
        <p>&amp;
: Keyword</p>
      </sec>
      <sec id="sec-8-2">
        <title>Keyword ! var j if j : : :</title>
        <p>These rules specify in a most natural way that an identi er cannot coincide with
a keyword.</p>
        <p>
          Conjunctive grammars can de ne sophisticated non-context-free languages [
          <xref ref-type="bibr" rid="ref32">32</xref>
          ],
for example, copy language with central marker fwcw j w 2 g, c 2= . This
language abstracts the condition of having each identi er declared before use, as
shown below.
        </p>
        <p>c
wcw (w={\zamount")
int amount z; if (ha}s|Bonus){ amount += 100;</p>
        <p>| }</p>
        <p>
          The main parsing algorithms for context-free grammars, including
cubictime general parsing algorithm, Earley's algorithm, recursive descent and
Generalized LR, have been extended to the case of conjunctive and Boolean
grammars [
          <xref ref-type="bibr" rid="ref34 ref35 ref36">36,35,34</xref>
          ], have the same time complexity, and are implemented in a
prototype parser generator [
          <xref ref-type="bibr" rid="ref33">33</xref>
          ].
        </p>
        <p>
          A Boolean grammar was constructed to specify syntax and static semantics
(including scoping rules) of a programming language [
          <xref ref-type="bibr" rid="ref38">38</xref>
          ]. This was apparently
the rst such speci cation by an e ciently parsable grammatical model. Because
conjunction and negation operators work on entire strings, rather than merely
being a lookahead mechanism, the mentioned grammar is quite knotty [
          <xref ref-type="bibr" rid="ref38">38</xref>
          ].
this-func-not-declared-here !
different-func-name j
same-func-name &amp; different-number-of-args
Moreover, the programming language only had one data type and no approach
of how to implement type checking was suggested.
3
        </p>
        <p>
          A New Life for Cross-references and Scoping
Boolean predicates &amp; and ! in parsing expressions grammars are, in fact, positive
and negative lookahead predicates, respectively. In the rules for bullet lists in
Markdown, predicate &amp; BulletSymb succeeds if the next symbol of the input is
a bullet, and predicate ! BulletSymb succeeds if the next symbol is not a bullet.
Neither of the predicates consume any input: they are only used to check the
lookahead symbols in the input, and those lookahead symbols can be regarded as
the right context of a string [
          <xref ref-type="bibr" rid="ref10 ref13 ref22 ref24">10,13,22,24</xref>
          ]. Drawing upon both parsing expression
grammars and Boolean grammars, grammars with contexts [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] provide a built-in
mechanism to specify what left and right contexts should be.
        </p>
      </sec>
      <sec id="sec-8-3">
        <title>ValidIdentifier ! ident &amp;</title>
      </sec>
      <sec id="sec-8-4">
        <title>ValidIdentifier ! ident &amp;</title>
        <p>it was declared before
it will be declared later
These two informal rules state that whenever an identi er is used in a program,
its declaration should appear either to its left ( ) or to its right ( ).</p>
        <p>Consider the following fragment of a program in an assumed C-like language.</p>
        <p>copied string wcw; with w=min
z }| {
: : : int f() f int ms,sec, min ; : : : return 60 * min ;g
| }</p>
        <p>
          extended left context (P) of u{sze of identi er min (underlined)
To ensure that identi er min used in the return statement (underlined) is
declared, one can verify whether its left context contains a function header (int
f f), keyword \int", other identi ers (ms, sec), a comma, and the declaration
of identi er min, followed by any other constructs (; . . . return 60 *), all
the way up to the use of min itself. This can be expressed in a grammar with
contexts almost verbatim [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ].
        </p>
      </sec>
      <sec id="sec-8-5">
        <title>ValidIdentfier ! ident &amp; P Functions</title>
        <p>
          FuncHeader \int" Identifiers CopiedString
This rule nds the substring between two positions in the input: before the
declaration of an identi er and after its use. To include the use of the identi er
into this substring, a so called extended left context P is used (that is, extended
context of an identi er is its left context concatenated with that very identi er).
After the desired substring has been found by the rule, it remains to check
whether it forms a copy language wcw (copy language can be de ned by a
conjunctive grammar [
          <xref ref-type="bibr" rid="ref37">37</xref>
          ]).
        </p>
        <p>
          The standard restriction that forbids redeclaration of identi ers can be now
expressed by the following rules [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ].
        </p>
      </sec>
      <sec id="sec-8-6">
        <title>IntegerDeclaration ! \int" InvalidIdentifier</title>
      </sec>
      <sec id="sec-8-7">
        <title>InvalidIdentifier ! ident &amp; : ValidIdentifier</title>
        <p>It also becomes possible to distinguish between types of identi ers: the rule
for a valid identi er breaks up into several rules, one for each type in the
language.</p>
      </sec>
      <sec id="sec-8-8">
        <title>ValidIntIdentfier ! ident &amp; P Functions</title>
      </sec>
    </sec>
    <sec id="sec-9">
      <title>FuncHeader \int" Identifiers CopiedString</title>
      <p>The only di erence between these rules is in the keyword that should occur in
the left context of an identi er use.</p>
      <sec id="sec-9-1">
        <title>ValidBoolIdentfier ! ident &amp; P Functions</title>
      </sec>
    </sec>
    <sec id="sec-10">
      <title>FuncHeader \bool" Identifiers CopiedString</title>
      <p>Because identi ers are now distinguished according to their type, it makes
sense to embed type checking into a grammar with contexts.</p>
      <p>Assignment ! ValidIntIdentifier \=" IntExpr</p>
      <p>ValidBoolIdentifier \=" BoolExpr
These rules state that a variable of a certain type can only be assigned an
expression of the same type.</p>
      <p>
        Syntax and static semantics of a small typed programming language has
been de ned by a grammar with contexts [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. That grammar speci es standard
context conditions, such as: conditional expression of while loop is of type bool;
number and types of formal parameters and actual arguments in function calls
agree; type of expression in a return statement is the same as the returning type
of a function; and others. By a set of rather sophisticated rules, the grammar
also speci ed scopes of visibility: identi ers are visible in the block where they
are de ned, and in all its inner blocks.
      </p>
      <p>Grammars with right contexts can be used in a way similar to parsing
expression grammars|as a lookahead mechanism.</p>
      <sec id="sec-10-1">
        <title>BulletList ! Q BulletSymb anything &amp; List</title>
        <p>The extended right context Q BulletSymb anything corresponds to the positive
lookahead predicate &amp; BulletSymb in a parsing expression grammar discussed
earlier.</p>
        <p>
          Several parsing algorithms, including cubic-time general parsing algorithm [
          <xref ref-type="bibr" rid="ref41 ref5">5,41</xref>
          ],
(linear time) recursive descent [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ], and Generalized LR [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ], have been
successfully extended to grammars with contexts. These algorithms have the same time
complexity as their prototypes, and have been implemented in a parser
generator [
          <xref ref-type="bibr" rid="ref3 ref9">9,3</xref>
          ].
4
        </p>
        <p>
          Can Grammars with Contexts Be Used in Practice?
Grammars with contexts can de ne arbitrary cross-references within a string [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ].
They have been used to specify an abstract programming language where
identi ers can be declared before or after their use (example motivated by function
prototypes in C) [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ].
        </p>
        <p>
          Ability to de ne cross-references is what makes grammars with contexts
applicable to software languages. On a practical side, this ability is also distinctive
in parser-based language workbenches [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ], such as Eclipse Xtext [
          <xref ref-type="bibr" rid="ref11 ref15">15,11</xref>
          ]. De
nition of a language in Xtext starts with writing a grammar in a metalanguage
that is similar to that of ANTLR [
          <xref ref-type="bibr" rid="ref39 ref40">39,40</xref>
          ] and supports cross-references.
        </p>
        <p>Variable : 'var' name=ID ';' ;</p>
        <p>Assignment : [Variable] '=' Expression ';' ;
The rst rule de nes what a variable declaration is: it is keyword var followed
by an identi er and a semicolon. The identi er is to be \stored" in feature name
associated with this rule3. In the second rule, [Variable] speci es a reference
to an existing Variable, in particular, to its feature name (in the default setting,
references are associated with the feature called name)4.</p>
        <p>This is conceptually very similar to grammars with contexts, where
ValidVariable would be used to specify the idea of what [Variable] expresses in
Xtext. There is, however, an important di erence between the two approaches.
To perform static checking, Xtext bases on high-level programming language
code, which is either generated automatically by Xtext or is written later by
a user. In contrast, grammars with contexts are purely a syntactic formalism,
and after a language is de ned by a grammar, no additional code is required to
further de ne its static semantics. This clearly has its advantages: a language is
de ned solely by a very formal mechanism, and correctness of this de nition can
be proven in a formal way.</p>
        <p>
          De nition of a typed programming language by a grammar with contexts [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]
is heavily based on the copy language wcw that is used to check cross-references.
This language is de ned in a non-trivial manner, and would require a substantial
modi cation to accommodate possible changes to how identi ers are de ned in
a language. However, for small sublanguages of larger programming languages
(for example, a sublanguage of arithmetical expressions), it might make sense
to use pure grammatical models to achieve higher degree of certainty about the
correctness of the de nition [
          <xref ref-type="bibr" rid="ref30">30</xref>
          ].
        </p>
        <p>
          Can the formalism of grammars with contexts be made more
approachable? Answering this question might involve implementing an Xtext-like
language workbench based on these grammars (all necessary parsing algorithms
exist [
          <xref ref-type="bibr" rid="ref3 ref8">8,3</xref>
          ], they were proven to have decent time complexity, and are implemented
in a prototype parser generator [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]) and, most probably, introducing a
simplied \front-end" formalism [
          <xref ref-type="bibr" rid="ref21 ref43">43,21</xref>
          ] that would be then translated to a grammar
with contexts. For example, in such a formalism, concepts of a language can be
annotated with tags (\su x numbers" [43, p. 37] [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]) to de ne cross-references.
        </p>
      </sec>
    </sec>
    <sec id="sec-11">
      <title>NewIdent : ident &amp; ! DeclaredIdent</title>
    </sec>
    <sec id="sec-12">
      <title>DeclaredIdent : ident.1 &amp; &lt; 'var' ident.1</title>
      <p>
        In the rule for DeclaredIdent, both the ordinary (ident.1) and contextual (&lt;
. . . ident.1) occurrenes of ident have the same tag to express that these
identi ers should be identical. That is, this rule expresses that \a declared identi er
is any identi er that was declared before".
3 Xtext creates a model from a grammar using Eclipse Modeling Framework [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ].
      </p>
      <p>In a simpli ed setting, rules become classes (instances of EClass) and features of
rules become elds of those classes. The model is then populated during the parsing,
essentially resulting in an AST that can be further analyzed or transformed by the
user.
4 The reference is made to an instance of EClass Variable; if such an instance does
not exist, an error is reported. If the instance exists, the reference is associated with
the value of its eld name.</p>
      <p>Devising an adequate and convenient formalism on top of grammars with
contexts is a challenging task. If this task is solved then implementing a language
workbench based on these grammars would be a matter of technique.</p>
      <sec id="sec-12-1">
        <title>Acknowledgements</title>
        <p>The author is thankful to Alexander Okhotin and anonymous reviewers for their
comments on earlier versions of the paper.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>A. V.</given-names>
            <surname>Aho</surname>
          </string-name>
          , Indexed Grammars {
          <article-title>An Extension of Context-Free Grammars</article-title>
          ,
          <source>J. ACM</source>
          <volume>15</volume>
          (
          <issue>4</issue>
          ).
          <volume>647</volume>
          {
          <fpage>671</fpage>
          .
          <year>1968</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>American</given-names>
            <surname>National Standard COBOL. American National Standards Institute</surname>
          </string-name>
          .
          <year>1975</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>M.</given-names>
            <surname>Barash</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Okhotin</surname>
          </string-name>
          ,
          <article-title>Generalized LR Parsing Algorithm for Grammars with One-Sided Contexts</article-title>
          ,
          <source>Theory Comput. Syst</source>
          .
          <volume>61</volume>
          (
          <issue>2</issue>
          ).
          <volume>581</volume>
          {
          <fpage>605</fpage>
          .
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>M.</given-names>
            <surname>Barash</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Okhotin</surname>
          </string-name>
          ,
          <article-title>Two-sided context speci cations in formal grammars</article-title>
          ,
          <source>Theor. Comput. Sci. 591</source>
          . 134{
          <fpage>153</fpage>
          .
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>M.</given-names>
            <surname>Barash</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Okhotin</surname>
          </string-name>
          ,
          <article-title>An extension of context-free grammars with one-sided context speci cations</article-title>
          ,
          <source>Inf. Comput</source>
          .
          <volume>237</volume>
          . 268{
          <fpage>293</fpage>
          .
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>M.</given-names>
            <surname>Barash</surname>
          </string-name>
          ,
          <article-title>Programming language speci cation by a grammar with contexts</article-title>
          ,
          <source>NCMA</source>
          <year>2013</year>
          .
          <volume>51</volume>
          {
          <fpage>67</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>M.</given-names>
            <surname>Barash</surname>
          </string-name>
          ,
          <article-title>Recursive descent parsing for grammars with contexts</article-title>
          ,
          <source>SOFSEM 2013. Local Proceedings II. 10{21</source>
          .
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>M.</given-names>
            <surname>Barash</surname>
          </string-name>
          , Contexts in Recursive Descent Parsing,
          <source>TUCS Technical Reports 1151</source>
          .
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>M.</given-names>
            <surname>Barash</surname>
          </string-name>
          ,
          <article-title>Parser generator with grammars with right contexts</article-title>
          .
          <year>2012</year>
          . Available at: http://users.utu.fi/mikbar/gwrc/.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>M. E. Bermudez</surname>
          </string-name>
          ,
          <string-name>
            <surname>K. M. Schimpf</surname>
          </string-name>
          , Practical Arbitrary Lookahead LR Parsing,
          <source>J. Comput. Syst. Sci</source>
          .
          <volume>41</volume>
          :
          <fpage>2</fpage>
          .
          <year>1990</year>
          .
          <volume>230</volume>
          {
          <fpage>250</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11. L. Bettini,
          <article-title>Implementing Domain-Speci c Languages with Xtext and Xtend</article-title>
          , Packt Publishing.
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>N.</given-names>
            <surname>Chomsky</surname>
          </string-name>
          ,
          <source>A Note on Phrase Structure Grammars, Information and Control</source>
          <volume>2</volume>
          (
          <issue>4</issue>
          ).
          <volume>393</volume>
          {
          <fpage>395</fpage>
          .
          <year>1959</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>K. Culik</surname>
            <given-names>II</given-names>
          </string-name>
          , R. S. Cohen,
          <string-name>
            <surname>LR-Regular</surname>
            <given-names>Grammars -</given-names>
          </string-name>
          <article-title>an Extension of LR(k) Grammars</article-title>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Comput</surname>
          </string-name>
          .
          <source>Syst. Sci</source>
          .
          <volume>7</volume>
          :
          <fpage>1</fpage>
          .
          <year>1973</year>
          .
          <volume>66</volume>
          {
          <fpage>96</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14. S. Erdweg, T. van der Storm,
          <string-name>
            <given-names>M.</given-names>
            <surname>Voelter</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Tratt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Bosman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W. R.</given-names>
            <surname>Cook</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Gerritsen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hulshout</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Kelly</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Loh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G. D. P.</given-names>
            <surname>Konat</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. J.</given-names>
            <surname>Molina</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Palatnik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Pohjonen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Schindler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Schindler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Solmi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V. A.</given-names>
            <surname>Vergu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Visser</surname>
          </string-name>
          , K. van der Vlist, G. Wachsmuth,
          <string-name>
            <surname>J. van der Woning</surname>
          </string-name>
          ,
          <article-title>Evaluating and comparing language workbenches: Existing results and benchmarks for the future</article-title>
          .
          <source>Comput. Lang. Syst. Struct. 44</source>
          .
          <year>2015</year>
          .
          <volume>24</volume>
          {
          <fpage>47</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>M. Eysholdt</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Rupprecht</surname>
          </string-name>
          ,
          <article-title>Migrating a large modeling environment from XML/UML to Xtext/GMF</article-title>
          , SPLASH/OOPSLA
          <year>2010</year>
          .
          <volume>97</volume>
          {
          <fpage>104</fpage>
          .
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16. R. W. Floyd,
          <article-title>On the nonexistence of a phrase structure grammar for ALGOL 60, Commun</article-title>
          . ACM
          <volume>5</volume>
          (
          <issue>9</issue>
          ).
          <volume>483</volume>
          {
          <fpage>484</fpage>
          .
          <year>1962</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <given-names>B.</given-names>
            <surname>Ford</surname>
          </string-name>
          ,
          <article-title>Parsing expression grammars: a recognition-based syntactic foundation</article-title>
          ,
          <source>POPL</source>
          <year>2004</year>
          .
          <volume>111</volume>
          {
          <fpage>122</fpage>
          .
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <given-names>GNU</given-names>
            <surname>Bison</surname>
          </string-name>
          . Available at: https://www.gnu.org/software/bison/.
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19. R. C. Gronback, Eclipse Modeling Project {
          <string-name>
            <given-names>A</given-names>
            <surname>Domain-Speci c Language (DSL) Toolkit</surname>
          </string-name>
          , Addison-Wesley.
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <given-names>D.</given-names>
            <surname>Grune</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C. J. H.</given-names>
            <surname>Jacobs</surname>
          </string-name>
          ,
          <source>Parsing Techniques - A Practical Guide</source>
          . Springer.
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <given-names>Q. T.</given-names>
            <surname>Jackson</surname>
          </string-name>
          ,
          <article-title>E cient formalism-only parsing of XML/HTML using the scalculus</article-title>
          ,
          <source>SIGPLAN Notices 38(2)</source>
          .
          <volume>29</volume>
          {
          <fpage>35</fpage>
          .
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22. S. Jarzabek, T. Krawczyk,
          <string-name>
            <surname>LL-Regular</surname>
            <given-names>Grammars</given-names>
          </string-name>
          , Inf. Process.
          <source>Lett. 4:2</source>
          .
          <year>1975</year>
          .
          <volume>31</volume>
          {
          <fpage>37</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23. L.
          <string-name>
            <surname>C. L. Kats</surname>
          </string-name>
          , E. Visser, G. Wachsmuth, Pure and Declarative Syntax De nition: Paradise Lost and Regained, SIGPLAN Not.
          <volume>45</volume>
          (
          <issue>10</issue>
          ).
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <given-names>S. M.</given-names>
            <surname>Kearns</surname>
          </string-name>
          ,
          <article-title>Extending Regular Expressions with Context Operators and Parse Extraction, Softw</article-title>
          .,
          <string-name>
            <surname>Pract</surname>
          </string-name>
          . Exper.
          <volume>21</volume>
          (
          <issue>8</issue>
          ).
          <volume>787</volume>
          {
          <fpage>804</fpage>
          .
          <year>1991</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          25.
          <string-name>
            <surname>D</surname>
          </string-name>
          . E. Knuth,
          <source>The Genesis of Attribute Grammars, Attribute Grammars and their Applications</source>
          .
          <year>1990</year>
          .
          <volume>1</volume>
          {
          <fpage>12</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          26.
          <string-name>
            <given-names>V.</given-names>
            <surname>Kountouriotis</surname>
          </string-name>
          , Ch. Nomikos,
          <string-name>
            <given-names>P.</given-names>
            <surname>Rondogiannis</surname>
          </string-name>
          ,
          <article-title>Well-founded semantics for Boolean grammars</article-title>
          ,
          <source>Inf. Comput</source>
          .
          <volume>207</volume>
          (
          <issue>9</issue>
          ).
          <volume>945</volume>
          {
          <fpage>967</fpage>
          .
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          27.
          <string-name>
            <given-names>S.</given-names>
            <surname>Kuno</surname>
          </string-name>
          ,
          <article-title>A context sensitive recognition procedure</article-title>
          ,
          <source>In: Mathematical linguistics and automatic translation, Rep. NSF-18</source>
          , The Computation Lab.,
          <string-name>
            <surname>Harvard</surname>
            <given-names>U.</given-names>
          </string-name>
          , Cambridge, Mass.
          <year>1967</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          28.
          <string-name>
            <surname>J. Kurs</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Vrany</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Ghafari</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Lungu</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          <string-name>
            <surname>Nierstrasz</surname>
          </string-name>
          ,
          <article-title>E cient parsing with parser combinators</article-title>
          .
          <source>Sci. Comput</source>
          . Program.
          <volume>161</volume>
          . 57{
          <fpage>88</fpage>
          .
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          29.
          <string-name>
            <given-names>N.</given-names>
            <surname>Laurent</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Mens</surname>
          </string-name>
          ,
          <article-title>Taming context-sensitive languages with principled stateful parsing</article-title>
          .
          <source>SLE</source>
          <year>2016</year>
          .
          <volume>15</volume>
          {
          <fpage>27</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref30">
        <mixed-citation>
          30. R. Lammel, Grammar Testing,
          <string-name>
            <surname>ETAPS</surname>
          </string-name>
          <year>2001</year>
          .
          <volume>201</volume>
          {
          <fpage>216</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref31">
        <mixed-citation>
          31.
          <string-name>
            <given-names>A.</given-names>
            <surname>Megacz</surname>
          </string-name>
          , Scannerless Boolean Parsing,
          <source>Electr. Notes Theor. Comput. Sci</source>
          .
          <volume>164</volume>
          (
          <issue>2</issue>
          ).
          <volume>97</volume>
          {
          <fpage>102</fpage>
          .
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref32">
        <mixed-citation>
          32.
          <string-name>
            <given-names>A.</given-names>
            <surname>Okhotin</surname>
          </string-name>
          ,
          <article-title>Conjunctive and Boolean grammars: The true general case of the context-free grammars</article-title>
          ,
          <source>Computer Science Review 9</source>
          .
          <year>2013</year>
          .
          <volume>27</volume>
          {
          <fpage>59</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref33">
        <mixed-citation>
          33.
          <string-name>
            <given-names>A.</given-names>
            <surname>Okhotin</surname>
          </string-name>
          ,
          <article-title>Whale Calf, a Parser Generator for Conjunctive Grammars</article-title>
          ,
          <string-name>
            <surname>CIAA</surname>
          </string-name>
          <year>2002</year>
          .
          <volume>213</volume>
          {
          <fpage>220</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref34">
        <mixed-citation>
          34.
          <string-name>
            <given-names>A.</given-names>
            <surname>Okhotin</surname>
          </string-name>
          , Boolean grammars,
          <source>Inf. Comput</source>
          .
          <volume>194</volume>
          (
          <issue>1</issue>
          ),
          <volume>19</volume>
          {
          <fpage>48</fpage>
          .
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref35">
        <mixed-citation>
          35.
          <string-name>
            <given-names>A.</given-names>
            <surname>Okhotin</surname>
          </string-name>
          ,
          <article-title>Generalized LR Parsing Algorithm for Boolean Grammars</article-title>
          ,
          <source>Int. J. Found. Comput. Sci</source>
          .
          <volume>17</volume>
          (
          <issue>3</issue>
          ).
          <volume>629</volume>
          {
          <fpage>664</fpage>
          .
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref36">
        <mixed-citation>
          36.
          <string-name>
            <given-names>A.</given-names>
            <surname>Okhotin</surname>
          </string-name>
          ,
          <article-title>Recursive descent parsing for Boolean grammars</article-title>
          ,
          <source>Acta Inf</source>
          .
          <volume>44</volume>
          (
          <issue>3</issue>
          -
          <fpage>4</fpage>
          ).
          <volume>167</volume>
          {
          <fpage>189</fpage>
          .
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref37">
        <mixed-citation>
          37.
          <string-name>
            <given-names>A.</given-names>
            <surname>Okhotin</surname>
          </string-name>
          , Conjunctive Grammars, J. of Aut.,
          <source>Lang. and Comb</source>
          .
          <volume>6</volume>
          (
          <issue>4</issue>
          ).
          <volume>519</volume>
          {
          <fpage>535</fpage>
          .
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref38">
        <mixed-citation>
          38.
          <string-name>
            <given-names>A.</given-names>
            <surname>Okhotin</surname>
          </string-name>
          ,
          <article-title>On the existence of a Boolean grammar for a simple programming language</article-title>
          ,
          <source>AFL</source>
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref39">
        <mixed-citation>
          39.
          <string-name>
            <surname>T. J. Parr</surname>
            ,
            <given-names>R. W.</given-names>
          </string-name>
          <string-name>
            <surname>Quong</surname>
          </string-name>
          ,
          <article-title>ANTLR: A Predicated LL(k) Parser Generator</article-title>
          , Softw.,
          <string-name>
            <surname>Pract</surname>
          </string-name>
          . Exper.
          <volume>25</volume>
          :
          <fpage>7</fpage>
          .
          <year>1995</year>
          .
          <volume>789</volume>
          {
          <fpage>810</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref40">
        <mixed-citation>
          40.
          <string-name>
            <given-names>T.</given-names>
            <surname>Parr</surname>
          </string-name>
          , K. Fisher, LL(*
          <article-title>): the foundation of the ANTLR parser generator</article-title>
          ,
          <source>PLDI</source>
          <year>2011</year>
          .
          <volume>425</volume>
          {
          <fpage>436</fpage>
          .
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref41">
        <mixed-citation>
          41. M.
          <article-title>Rabkin, Recognizing Two-Sided Contexts in Cubic Time</article-title>
          ,
          <string-name>
            <surname>CSR</surname>
          </string-name>
          <year>2014</year>
          .
          <volume>314</volume>
          {
          <fpage>324</fpage>
          .
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref42">
        <mixed-citation>
          42.
          <string-name>
            <given-names>A.</given-names>
            <surname>Stevenson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. R.</given-names>
            <surname>Cordy</surname>
          </string-name>
          ,
          <article-title>Parse views with Boolean grammars</article-title>
          ,
          <source>Sci. Comput</source>
          . Program.
          <volume>97</volume>
          . 59{
          <fpage>63</fpage>
          .
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref43">
        <mixed-citation>
          43.
          <string-name>
            <surname>J. C. Cleaveland</surname>
            ,
            <given-names>R. C.</given-names>
          </string-name>
          <string-name>
            <surname>Uzgalis</surname>
          </string-name>
          ,
          <article-title>Grammars for Programming Languages</article-title>
          , Elsevier.
          <year>1977</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref44">
        <mixed-citation>
          44.
          <string-name>
            <surname>A. van Wijngaarden</surname>
            ,
            <given-names>B. J.</given-names>
          </string-name>
          <string-name>
            <surname>Mailloux</surname>
            ,
            <given-names>J. E. L.</given-names>
          </string-name>
          <string-name>
            <surname>Peck</surname>
            ,
            <given-names>C. H. A.</given-names>
          </string-name>
          <string-name>
            <surname>Koster</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Sintzo</surname>
            ,
            <given-names>C. H.</given-names>
          </string-name>
          <string-name>
            <surname>Lindsey</surname>
            ,
            <given-names>L. G. L. T.</given-names>
          </string-name>
          <string-name>
            <surname>Meertens</surname>
            ,
            <given-names>R. G.</given-names>
          </string-name>
          <string-name>
            <surname>Fisker</surname>
          </string-name>
          ,
          <source>Revised Report on the Algorithmic Language ALGOL 68</source>
          ,
          <string-name>
            <given-names>Acta</given-names>
            <surname>Inf</surname>
          </string-name>
          .
          <volume>5</volume>
          . 1{
          <fpage>236</fpage>
          .
          <year>1975</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref45">
        <mixed-citation>
          45.
          <string-name>
            <surname>A. van Wijngaarden</surname>
          </string-name>
          ,
          <article-title>The Generative Power of Two-Level Grammars</article-title>
          ,
          <string-name>
            <surname>ICALP</surname>
          </string-name>
          <year>1974</year>
          .
          <volume>9</volume>
          {
          <fpage>16</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref46">
        <mixed-citation>
          46.
          <string-name>
            <surname>M. H. Williams</surname>
            ,
            <given-names>A Flexible</given-names>
          </string-name>
          <string-name>
            <surname>Notation for Syntactic</surname>
          </string-name>
          <article-title>De nitions</article-title>
          ,
          <source>ACM Trans. Program. Lang. Syst</source>
          .
          <year>1982</year>
          .
          <volume>113</volume>
          {
          <fpage>119</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref47">
        <mixed-citation>
          47.
          <string-name>
            <given-names>W. A.</given-names>
            <surname>Woods</surname>
          </string-name>
          ,
          <article-title>Context-sensitive parsing</article-title>
          ,
          <source>Commun. ACM 13:7</source>
          .
          <year>1970</year>
          .
          <volume>437</volume>
          {
          <fpage>445</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref48">
        <mixed-citation>
          48.
          <string-name>
            <given-names>V.</given-names>
            <surname>Zaytsev</surname>
          </string-name>
          , Grammar Zoo:
          <article-title>A corpus of experimental grammarware</article-title>
          ,
          <source>Sci. Comput</source>
          . Program.
          <volume>98</volume>
          . 28{
          <fpage>51</fpage>
          .
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref49">
        <mixed-citation>
          49. V.
          <article-title>Zaytsev, BNF Was Here: What Have We Done About the Unnecessary Diversity of Notation for Syntactic De nitions</article-title>
          ,
          <year>SAC 2012</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>