%start Parol
%title "Parol grammar"
%comment "Parol's own grammar"
%line_comment "//"
%block_comment "/\*" "\*/"
%nt_type ScannerState = crate::parser::parol_grammar::ScannerConfig
%nt_type ScannerStateDirectives = crate::parser::parol_grammar::ScannerStateSwitch
%nt_type UserTypeName = crate::parser::parol_grammar::UserDefinedTypeName
%%
/* 0 */ Parol: Prolog GrammarDefinition;
/* 1 */ Prolog: StartDeclaration PrologList /* Vec */ PrologList0 /* Vec */;
/* 2 */ PrologList0 /* Vec<T>::Push */: ScannerState PrologList0;
/* 3 */ PrologList0 /* Vec<T>::New */: ;
/* 4 */ PrologList /* Vec<T>::Push */: Declaration PrologList;
/* 5 */ PrologList /* Vec<T>::New */: ;
/* 6 */ StartDeclaration: '%start'^ /* Clipped */ Identifier;
/* 7 */ Declaration: '%title'^ /* Clipped */ String;
/* 8 */ Declaration: '%comment'^ /* Clipped */ String;
/* 9 */ Declaration: '%user_type'^ /* Clipped */ Identifier '='^ /* Clipped */ UserTypeName;
/* 10 */ Declaration: "%nt_type"^ /* Clipped */ Identifier@nt_name '='^ /* Clipped */ UserTypeName@nt_type;
/* 11 */ Declaration: "%t_type"^ /* Clipped */ UserTypeName@t_type;
/* 12 */ Declaration: '%grammar_type'^ /* Clipped */ RawString;
/* 13 */ Declaration: ScannerDirectives;
/* 14 */ ScannerDirectives: '%line_comment'^ /* Clipped */ TokenLiteral;
/* 15 */ ScannerDirectives: '%block_comment'^ /* Clipped */ TokenLiteral TokenLiteral;
/* 16 */ ScannerDirectives: '%auto_newline_off'^ /* Clipped */;
/* 17 */ ScannerDirectives: '%auto_ws_off'^ /* Clipped */;
/* 18 */ ScannerDirectives: '%skip'^ /* Clipped */ IdentifierList;
/* 19 */ ScannerDirectives: '%on'^ /* Clipped */ IdentifierList ScannerStateDirectives;
/* 20 */ ScannerDirectives: '%allow_unmatched'^ /* Clipped */;
/* 21 */ ScannerStateDirectives: '%enter'^ /* Clipped */ Identifier;
/* 22 */ ScannerStateDirectives: '%push'^ /* Clipped */ Identifier;
/* 23 */ ScannerStateDirectives: '%pop';
/* 24 */ GrammarDefinition: '%%'^ /* Clipped */ Production GrammarDefinitionList /* Vec */;
/* 25 */ GrammarDefinitionList /* Vec<T>::Push */: Production GrammarDefinitionList;
/* 26 */ GrammarDefinitionList /* Vec<T>::New */: ;
/* 27 */ DoubleColon: '::';
/* 28 */ Production: Identifier ':'^ /* Clipped */ Alternations ';'^ /* Clipped */;
/* 29 */ Alternations: Alternation AlternationsList /* Vec */;
/* 30 */ AlternationsList /* Vec<T>::Push */: '|'^ /* Clipped */ Alternation AlternationsList;
/* 31 */ AlternationsList /* Vec<T>::New */: ;
/* 32 */ Alternation: AlternationList /* Vec */;
/* 33 */ AlternationList /* Vec<T>::Push */: Factor AlternationList;
/* 34 */ AlternationList /* Vec<T>::New */: ;
/* 35 */ Factor: Group;
/* 36 */ Factor: Repeat;
/* 37 */ Factor: Optional;
/* 38 */ Factor: Symbol;
/* 39 */ Symbol: NonTerminal;
/* 40 */ Symbol: SimpleToken;
/* 41 */ Symbol: TokenWithStates;
/* 42 */ TokenLiteral: String;
/* 43 */ TokenLiteral: RawString;
/* 44 */ TokenLiteral: Regex;
/* 45 */ TokenExpression: TokenLiteral TokenExpressionOpt /* Option */;
/* 46 */ TokenExpressionOpt /* Option<T>::Some */: LookAhead;
/* 47 */ TokenExpressionOpt /* Option<T>::None */: ;
/* 48 */ SimpleToken: TokenExpression SimpleTokenOpt /* Option */;
/* 49 */ SimpleTokenOpt /* Option<T>::Some */: ASTControl;
/* 50 */ SimpleTokenOpt /* Option<T>::None */: ;
/* 51 */ TokenWithStates: '<'^ /* Clipped */ IdentifierList '>'^ /* Clipped */ TokenExpression TokenWithStatesOpt /* Option */;
/* 52 */ TokenWithStatesOpt /* Option<T>::Some */: ASTControl;
/* 53 */ TokenWithStatesOpt /* Option<T>::None */: ;
/* 54 */ String: /"(\\.|[^"])*"/;
/* 55 */ RawString: /'(\\.|[^'])*'/;
/* 56 */ Regex: "/(\\.|[^\/])*/";
/* 57 */ Group: '(' Alternations ')';
/* 58 */ Optional: '[' Alternations ']';
/* 59 */ Repeat: '{' Alternations '}';
/* 60 */ NonTerminal: Identifier NonTerminalOpt /* Option */;
/* 61 */ NonTerminalOpt /* Option<T>::Some */: ASTControl;
/* 62 */ NonTerminalOpt /* Option<T>::None */: ;
/* 63 */ Identifier: /[a-zA-Z_][a-zA-Z0-9_]*/;
/* 64 */ ScannerState: '%scanner'^ /* Clipped */ Identifier@state_name '{'^ /* Clipped */ ScannerStateList /* Vec */ '}'^ /* Clipped */;
/* 65 */ ScannerStateList /* Vec<T>::Push */: ScannerDirectives ScannerStateList;
/* 66 */ ScannerStateList /* Vec<T>::New */: ;
/* 67 */ IdentifierList: Identifier IdentifierListList /* Vec */;
/* 68 */ IdentifierListList /* Vec<T>::Push */: ','^ /* Clipped */ Identifier IdentifierListList;
/* 69 */ IdentifierListList /* Vec<T>::New */: ;
/* 70 */ ASTControl: CutOperator;
/* 71 */ ASTControl: MemberName ASTControlOpt /* Option */;
/* 72 */ ASTControl: UserTypeDeclaration;
/* 73 */ ASTControlOpt /* Option<T>::Some */: UserTypeDeclaration;
/* 74 */ ASTControlOpt /* Option<T>::None */: ;
/* 75 */ MemberName: '@'^ /* Clipped */ Identifier;
/* 76 */ CutOperator: '^'^ /* Clipped */;
/* 77 */ UserTypeDeclaration: ':'^ /* Clipped */ UserTypeName;
/* 78 */ UserTypeName: Identifier UserTypeNameList /* Vec */;
/* 79 */ UserTypeNameList /* Vec<T>::Push */: DoubleColon^ /* Clipped */ Identifier UserTypeNameList;
/* 80 */ UserTypeNameList /* Vec<T>::New */: ;
/* 81 */ LookAhead: LookAheadGroup TokenLiteral;
/* 82 */ LookAheadGroup: PositiveLookahead;
/* 83 */ LookAheadGroup: NegativeLookahead;
/* 84 */ PositiveLookahead: '?='^ /* Clipped */;
/* 85 */ NegativeLookahead: '?!'^ /* Clipped */;