Skip to content

Graph Grammar Syntax

thnoll edited this page Mar 28, 2018 · 5 revisions

Graph grammars are specified as a JSON-array of rules having the following form:

{
  "nonterminal": String,
  "rank":Number,
  "reductionTentacles":[Boolean],
  "index":[String],
  "rules":[ HeapConfigurationObject ]
}
  • nonterminal: the nonterminal on the left hand side of this rule
  • rank see rank
  • reductionTentacles is true at position i if the i'th tentacle is a reduction tentacle
  • index is an optional attribute for indexed grammars. (For its syntax see here.)
  • rules is an array of heap configurations which form the right hand sides of this rule. (For their syntax see here.)

  • Here you can see an example of a grammar without indices modelling singly linked lists.
  • Here you can see an example of an indexed grammar modelling AVL trees.
Clone this wiki locally