Grammar GroovyLexer
ANTLR-generated HTML file from /home/users/jez/projects/groovy.head/groovy/jsr/ideas/parsers/antlr/src/org/codehaus/groovy/antlr/groovy.g

Terence Parr, MageLang Institute
ANTLR Version 2.7.5 (20050128); 1989-2005


Definition of lexer GroovyLexer, which is a subclass of CharScanner.

/** Lexer nextToken rule:
 *  The lexer nextToken rule is synthesized from all of the user-defined
 *  lexer rules.  It logically consists of one big alternative block with
 *  each user-defined rule being an alternative.
 */
mQUESTION 
|	mLPAREN 
|	mRPAREN 
|	mLBRACK 
|	mRBRACK 
|	mLCURLY 
|	mRCURLY 
|	mCOLON 
|	mCOMMA 
|	mDOT 
|	mASSIGN 
|	mCOMPARE_TO 
|	mEQUAL 
|	mLNOT 
|	mBNOT 
|	mNOT_EQUAL 
|	mPLUS 
|	mPLUS_ASSIGN 
|	mINC 
|	mMINUS 
|	mMINUS_ASSIGN 
|	mDEC 
|	mSTAR 
|	mSTAR_ASSIGN 
|	mMOD 
|	mMOD_ASSIGN 
|	mSR 
|	mSR_ASSIGN 
|	mBSR 
|	mBSR_ASSIGN 
|	mGE 
|	mGT 
|	mSL 
|	mSL_ASSIGN 
|	mLE 
|	mLT 
|	mBXOR 
|	mBXOR_ASSIGN 
|	mBOR 
|	mBOR_ASSIGN 
|	mLOR 
|	mBAND 
|	mBAND_ASSIGN 
|	mLAND 
|	mSEMI 
|	mDOLLAR 
|	mRANGE_INCLUSIVE 
|	mRANGE_EXCLUSIVE 
|	mTRIPLE_DOT 
|	mSPREAD_DOT 
|	mOPTIONAL_DOT 
|	mMEMBER_POINTER 
|	mREGEX_FIND 
|	mREGEX_MATCH 
|	mSTAR_STAR 
|	mSTAR_STAR_ASSIGN 
|	mCLOSURE_OP 
|	mWS 
|	mNLS 
|	mSL_COMMENT 
|	mML_COMMENT 
|	mSH_COMMENT 
|	mSTRING_LITERAL 
|	mREGEXP_LITERAL 
|	mIDENT 
|	mNUM_INT 
|	mAT 
mQUESTION
	:	'?' 
	;

mLPAREN
	:	'(' 
	;

mRPAREN
	:	')' 
	;

mLBRACK
	:	'[' 
	;

mRBRACK
	:	']' 
	;

mLCURLY
	:	'{' 
	;

mRCURLY
	:	'}' 
	;

mCOLON
	:	':' 
	;

mCOMMA
	:	',' 
	;

mDOT
	:	'.' 
	;

mASSIGN
	:	'=' 
	;

mCOMPARE_TO
	:	"<=>" 
	;

mEQUAL
	:	"==" 
	;

mLNOT
	:	'!' 
	;

mBNOT
	:	'~' 
	;

mNOT_EQUAL
	:	"!=" 
	;

protected mDIV
	:	'/' 
	;

protected mDIV_ASSIGN
	:	"/=" 
	;

mPLUS
	:	'+' 
	;

mPLUS_ASSIGN
	:	"+=" 
	;

mINC
	:	"++" 
	;

mMINUS
	:	'-' 
	;

mMINUS_ASSIGN
	:	"-=" 
	;

mDEC
	:	"--" 
	;

mSTAR
	:	'*' 
	;

mSTAR_ASSIGN
	:	"*=" 
	;

mMOD
	:	'%' 
	;

mMOD_ASSIGN
	:	"%=" 
	;

mSR
	:	">>" 
	;

mSR_ASSIGN
	:	">>=" 
	;

mBSR
	:	">>>" 
	;

mBSR_ASSIGN
	:	">>>=" 
	;

mGE
	:	">=" 
	;

mGT
	:	">" 
	;

mSL
	:	"<<" 
	;

mSL_ASSIGN
	:	"<<=" 
	;

mLE
	:	"<=" 
	;

mLT
	:	'<' 
	;

mBXOR
	:	'^' 
	;

mBXOR_ASSIGN
	:	"^=" 
	;

mBOR
	:	'|' 
	;

mBOR_ASSIGN
	:	"|=" 
	;

mLOR
	:	"||" 
	;

mBAND
	:	'&' 
	;

mBAND_ASSIGN
	:	"&=" 
	;

mLAND
	:	"&&" 
	;

mSEMI
	:	';' 
	;

mDOLLAR
	:	'$' 
	;

mRANGE_INCLUSIVE
	:	".." 
	;

mRANGE_EXCLUSIVE
	:	"..<" 
	;

mTRIPLE_DOT
	:	"..." 
	;

mSPREAD_DOT
	:	"*." 
	;

mOPTIONAL_DOT
	:	"?." 
	;

mMEMBER_POINTER
	:	".&" 
	;

mREGEX_FIND
	:	"=~" 
	;

mREGEX_MATCH
	:	"==~" 
	;

mSTAR_STAR
	:	"**" 
	;

mSTAR_STAR_ASSIGN
	:	"**=" 
	;

mCLOSURE_OP
	:	"->" 
	;

mWS
	:	(	' ' 
		|	'\t' 
		|	'\f' 
		|	'\\' mONE_NL 
		)+ 
		
	;

protected mONE_NL
	:	(	"\r\n" 
		|	'\r' 
		|	'\n' 
		) 
		
	;

mNLS
	:	mONE_NL 
		(	(	mONE_NL 
			|	mWS 
			|	mSL_COMMENT 
			|	mML_COMMENT 
			)+ 
		|	
		) 
		
	;

mSL_COMMENT
	:	"//" ( (	'\n' 
			|	'\r' 
			|	'\uffff' 
			) )* 
	;

mML_COMMENT
	:	"/*" 
		(	'*' 
		|	mONE_NL 
		|	(	'*' 
			|	'\n' 
			|	'\r' 
			|	'\uffff' 
			) 
		)* 
		"*/" 
	;

mSH_COMMENT
	:	"#!" ( (	'\n' 
			|	'\r' 
			|	'\uffff' 
			) )* 
	;

mSTRING_LITERAL
	:	"'''" 
		(	mSTRING_CH 
		|	mESC 
		|	'"' 
		|	'$' 
		|	mSTRING_NL 
		|	'\'' 
		)* 
		"'''" 
	|	'\'' 
		(	mSTRING_CH 
		|	mESC 
		|	'"' 
		|	'$' 
		)* 
		'\'' 
	|	"\"\"\"" mSTRING_CTOR_END 
	|	'"' mSTRING_CTOR_END 
	;

protected mSTRING_CH
	:	(	'"' 
		|	'\'' 
		|	'\\' 
		|	'$' 
		|	'\n' 
		|	'\r' 
		|	'\uffff' 
		) 
	;

protected mESC
	:	'\\' 
		(	'n' 
		|	'r' 
		|	't' 
		|	'b' 
		|	'f' 
		|	'"' 
		|	'\'' 
		|	'\\' 
		|	'$' 
		|	( 'u' )+ mHEX_DIGIT mHEX_DIGIT mHEX_DIGIT mHEX_DIGIT 
		|				'0'..'3' 
			(					'0'..'7' 
				(						'0'..'7' 
				|	
				) 
			|	
			) 
			
		|				'4'..'7' 
			(					'0'..'7' 
			|	
			) 
			
		) 
	|	'\\' mONE_NL 
	;

protected mSTRING_NL
	:	mONE_NL 
	;

protected mSTRING_CTOR_END
	:	(	mSTRING_CH 
		|	mESC 
		|	'\'' 
		|	mSTRING_NL 
		|	'"' 
		)* 
		(	(	"\"" 
			|	"\"\"\"" 
			) 
			
		|	'$' 
		) 
		
	;

mREGEXP_LITERAL
	:	'/' 
		(	mREGEXP_SYMBOL mREGEXP_CTOR_END 
		|	'$' mREGEXP_CTOR_END 
		|	'$' 
		) 
		
	|	mDIV 
	|	mDIV_ASSIGN 
	;

protected mREGEXP_SYMBOL
	:	(	(	'*' 
			|	'/' 
			|	'$' 
			|	'\\' 
			|	'\n' 
			|	'\r' 
			|	'\uffff' 
			) 
		|	'\\' 
			(	'\n' 
			|	'\r' 
			) 
		|	'\\' mONE_NL 
		) 
		( '*' )* 
	;

protected mREGEXP_CTOR_END
	:	(	mREGEXP_SYMBOL 
		|	'$' 
		)* 
		(	'/' 
		|	'$' 
		) 
		
	;

protected mHEX_DIGIT
	:	(				'0'..'9' 
		|				'A'..'F' 
		|				'a'..'f' 
		) 
	;

protected mVOCAB
	:			'\3'..'\377' 
	;

mIDENT
	:	mLETTER 
		(	mLETTER 
		|	mDIGIT 
		)* 
		
	;

protected mLETTER
	:			'a'..'z' 
	|			'A'..'Z' 
	|			'\u0100'..'\uFFFE' 
	|	'_' 
	;

protected mDIGIT
	:			'0'..'9' 
	;

mNUM_INT
	:	(	'0' 
			(	(	'x' 
				|	'X' 
				) 
				( mHEX_DIGIT )+ 
			|	( 					'0'..'9' )+ 
			|	( 					'0'..'7' )+ 
			|	
			) 
		|	( 				'1'..'9' ) ( 				'0'..'9' )* 
		) 
		(	(	'l' 
			|	'L' 
			) 
			
		|	(	'i' 
			|	'I' 
			) 
			
		|	mBIG_SUFFIX 
		|	(	'.' ( 					'0'..'9' )+ 
				(	mEXPONENT 
				|	
				) 
				(	mFLOAT_SUFFIX 
				|	mBIG_SUFFIX 
				|	
				) 
			|	mEXPONENT 
				(	mFLOAT_SUFFIX 
				|	mBIG_SUFFIX 
				|	
				) 
			|	mFLOAT_SUFFIX 
			) 
			
		|	
		) 
	;

protected mEXPONENT
	:	(	'e' 
		|	'E' 
		) 
		(	'+' 
		|	'-' 
		|	
		) 
		( 			'0'..'9' )+ 
	;

protected mFLOAT_SUFFIX
	:	'f' 
	|	'F' 
	|	'd' 
	|	'D' 
	;

protected mBIG_SUFFIX
	:	'g' 
	|	'G' 
	;

mAT
	:	'@' 
	;