Motion Grammar Parser for JastAdd Examples

A testbed for a potential motion grammar1 implementation using JastAdd. For the source code, check out the git repository.


This is an implementation of motion grammars from Dantam1 using Reference Attribute Grammars. In this implementation, both the context model and the motion grammar are described using attribute grammars.

Motion Grammars in JastAdd

A JastAdd motion grammar comprises three parts. MotionGrammar contains generic nonterminals present in every motion grammar, a second, use-case-specific grammar has the actual nonterminals of the grammar as well as additonal information to construct a parser, and finally a third context grammar that describes the context within which the motion grammar is parsed.

Use cases

  • Very simple Load-Unload grammar taken from the original paper 1 to show a minimal proof-of-concept.
  • A robotic use case sorting dynamically appearing objects into boxes by colour.


  1. Dantam, N., Stilman, M., 2013. The Motion Grammar: Analysis of a Linguistic Method for Robot Control. IEEE Trans. Robot. 29, 704–718.