This is the grammar for parsers, without any Python code mixed in. The complete grammar can be found in parsedesc.g in the Yapps distribution.
parser ParserDescription: ignore: "\\s+" ignore: "#.*?\r?\n" token END: "$" # $ means end of string token ATTR: "<<.+?>>" token STMT: "{{.+?}}" token ID: '[a-zA-Z_][a-zA-Z_0-9]*' token STR: '[rR]?\'([^\\n\'\\\\]|\\\\.)*\'|[rR]?"([^\\n"\\\\]|\\\\.)*"' rule Parser: "parser" ID ":" Options Tokens Rules END rule Options: ( "option" ":" STR )* rule Tokens: ( "token" ID ":" STR | "ignore" ":" STR )* rule Rules: ( "rule" ID OptParam ":" ClauseA )* rule ClauseA: ClauseB ( '[|]' ClauseB )* rule ClauseB: ClauseC* rule ClauseC: ClauseD [ '[+]' | '[*]' ] rule ClauseD: STR | ID [ATTR] | STMT | '\\(' ClauseA '\\) | '\\[' ClauseA '\\]'