Grammar REParser
ANTLR-generated HTML file from ./expandedRE.g

Terence Parr, MageLang Institute
ANTLR Version 2.7.4; 1989-1999


Definition of parser REParser, which is a subclass of LLkParser.


toRE
	:	(	name 
		|	
		) 
		(	description 
		|	
		) 
		alphabet regularExpression EOF 
	;


name
	:	NAME COLON 
		(	aQuotedString 
		|	
		) 
	;


description
	:	DESCRIPTION COLON 
		(	aQuotedString 
		|	
		) 
	;


alphabet
	:	FOR EVENTS LBRACE labelList RBRACE 
	;


regularExpression
	:	EMPTY 
	|	expression 
	;


aQuotedString
	:	QUOTED_STRING 
	;


labelList
	:	label ( COMMA label )* 
	;


expression
	:	term ( CHOICE term )* 
	;


term
	:	modifiedExpression ( CONCAT modifiedExpression )* 
	;


modifiedExpression
	:	leafExpression 
		(	modifier 
		|	
		) 
	;


leafExpression
	:	DOT 
	|	label 
	|	classSet 
	|	LPAREN expression RPAREN 
	|	EPSILON 
	;


modifier
	:	KLEENESTAR 
	|	KLEENEPLUS 
	|	OPTION 
	|	EXPONENT exponent 
	;


label
	:	aQuotedString 
	;


classSet
	:	LBRACKET labelList RBRACKET 
	|	TILDE LBRACKET labelList RBRACKET 
	;


exponent
	:	aPosInt 
	|	LBRACE aPosInt 
		(	DASH 
			(	aPosInt 
			|	
			) 
		|	
		) 
		RBRACE 
	;


aPosInt
	:	POSINT 
	;