Refactored so that simple definitions (one-liners like Pos X Y Z) are
the base class and compound definitions (group name definition* end) are
derived.