Finding various structures within rule lists.
Some rules or groups of rules can be used to help automate defining an abstract syntax corresponding to the concrete syntax defined in a grammar.
We begin by observing that if there is only one rule for a given rulename, and if the right hand side is a simple alternation of rulenames, then the rule names could correspond to a type/subtype relationship. This relationship can be used to help generate an abstract syntax model of the language, and to help simplify code that processes values of the abstract syntax.