// $ANTLR 3.4 RoleDef.g 2012-03-27 12:55:40
package org.antlr.roledef;
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
@SuppressWarnings({"all", "warnings", "unchecked"})
public class RoleDefLexer extends Lexer {
public static final int EOF=-1;
public static final int COLON=4;
public static final int COMMA=5;
public static final int COMMENT=6;
public static final int GEQ=7;
public static final int STR=8;
public static final int WS=9;
// delegates
// delegators
public Lexer[] getDelegates() {
return new Lexer[] {};
}
public RoleDefLexer() {}
public RoleDefLexer(CharStream input) {
this(input, new RecognizerSharedState());
}
public RoleDefLexer(CharStream input, RecognizerSharedState state) {
super(input,state);
}
public String getGrammarFileName() { return "RoleDef.g"; }
// $ANTLR start "COLON"
public final void mCOLON() throws RecognitionException {
try {
int _type = COLON;
int _channel = DEFAULT_TOKEN_CHANNEL;
// RoleDef.g:4:7: ( ':' )
// RoleDef.g:4:9: ':'
{
match(':');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "COLON"
// $ANTLR start "COMMA"
public final void mCOMMA() throws RecognitionException {
try {
int _type = COMMA;
int _channel = DEFAULT_TOKEN_CHANNEL;
// RoleDef.g:5:7: ( ',' )
// RoleDef.g:5:9: ','
{
match(',');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "COMMA"
// $ANTLR start "GEQ"
public final void mGEQ() throws RecognitionException {
try {
int _type = GEQ;
int _channel = DEFAULT_TOKEN_CHANNEL;
// RoleDef.g:6:5: ( '>' )
// RoleDef.g:6:7: '>'
{
match('>');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "GEQ"
// $ANTLR start "STR"
public final void mSTR() throws RecognitionException {
try {
int _type = STR;
int _channel = DEFAULT_TOKEN_CHANNEL;
// RoleDef.g:35:5: ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '-' )+ )
// RoleDef.g:35:7: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '-' )+
{
// RoleDef.g:35:7: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '-' )+
int cnt1=0;
loop1:
do {
int alt1=2;
int LA1_0 = input.LA(1);
if ( (LA1_0=='-'||(LA1_0 >= '0' && LA1_0 <= '9')||(LA1_0 >= 'A' && LA1_0 <= 'Z')||LA1_0=='_'||(LA1_0 >= 'a' && LA1_0 <= 'z')) ) {
alt1=1;
}
switch (alt1) {
case 1 :
// RoleDef.g:
{
if ( input.LA(1)=='-'||(input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'Z')||input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;
}
}
break;
default :
if ( cnt1 >= 1 ) break loop1;
EarlyExitException eee =
new EarlyExitException(1, input);
throw eee;
}
cnt1++;
} while (true);
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "STR"
// $ANTLR start "COMMENT"
public final void mCOMMENT() throws RecognitionException {
try {
int _type = COMMENT;
int _channel = DEFAULT_TOKEN_CHANNEL;
// RoleDef.g:39:5: ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' | '/*' ( options {greedy=false; } : . )* '*/' )
int alt5=2;
int LA5_0 = input.LA(1);
if ( (LA5_0=='/') ) {
int LA5_1 = input.LA(2);
if ( (LA5_1=='/') ) {
alt5=1;
}
else if ( (LA5_1=='*') ) {
alt5=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 5, 1, input);
throw nvae;
}
}
else {
NoViableAltException nvae =
new NoViableAltException("", 5, 0, input);
throw nvae;
}
switch (alt5) {
case 1 :
// RoleDef.g:39:9: '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'
{
match("//");
// RoleDef.g:39:14: (~ ( '\\n' | '\\r' ) )*
loop2:
do {
int alt2=2;
int LA2_0 = input.LA(1);
if ( ((LA2_0 >= '\u0000' && LA2_0 <= '\t')||(LA2_0 >= '\u000B' && LA2_0 <= '\f')||(LA2_0 >= '\u000E' && LA2_0 <= '\uFFFF')) ) {
alt2=1;
}
switch (alt2) {
case 1 :
// RoleDef.g:
{
if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '\t')||(input.LA(1) >= '\u000B' && input.LA(1) <= '\f')||(input.LA(1) >= '\u000E' && input.LA(1) <= '\uFFFF') ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;
}
}
break;
default :
break loop2;
}
} while (true);
// RoleDef.g:39:28: ( '\\r' )?
int alt3=2;
int LA3_0 = input.LA(1);
if ( (LA3_0=='\r') ) {
alt3=1;
}
switch (alt3) {
case 1 :
// RoleDef.g:39:28: '\\r'
{
match('\r');
}
break;
}
match('\n');
_channel=HIDDEN;
}
break;
case 2 :
// RoleDef.g:40:9: '/*' ( options {greedy=false; } : . )* '*/'
{
match("/*");
// RoleDef.g:40:14: ( options {greedy=false; } : . )*
loop4:
do {
int alt4=2;
int LA4_0 = input.LA(1);
if ( (LA4_0=='*') ) {
int LA4_1 = input.LA(2);
if ( (LA4_1=='/') ) {
alt4=2;
}
else if ( ((LA4_1 >= '\u0000' && LA4_1 <= '.')||(LA4_1 >= '0' && LA4_1 <= '\uFFFF')) ) {
alt4=1;
}
}
else if ( ((LA4_0 >= '\u0000' && LA4_0 <= ')')||(LA4_0 >= '+' && LA4_0 <= '\uFFFF')) ) {
alt4=1;
}
switch (alt4) {
case 1 :
// RoleDef.g:40:42: .
{
matchAny();
}
break;
default :
break loop4;
}
} while (true);
match("*/");
_channel=HIDDEN;
}
break;
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "COMMENT"
// $ANTLR start "WS"
public final void mWS() throws RecognitionException {
try {
int _type = WS;
int _channel = DEFAULT_TOKEN_CHANNEL;
// RoleDef.g:43:5: ( ( ' ' | '\\t' | '\\r' | '\\n' ) )
// RoleDef.g:43:9: ( ' ' | '\\t' | '\\r' | '\\n' )
{
if ( (input.LA(1) >= '\t' && input.LA(1) <= '\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;
}
_channel=HIDDEN;
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "WS"
public void mTokens() throws RecognitionException {
// RoleDef.g:1:8: ( COLON | COMMA | GEQ | STR | COMMENT | WS )
int alt6=6;
switch ( input.LA(1) ) {
case ':':
{
alt6=1;
}
break;
case ',':
{
alt6=2;
}
break;
case '>':
{
alt6=3;
}
break;
case '-':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
{
alt6=4;
}
break;
case '/':
{
alt6=5;
}
break;
case '\t':
case '\n':
case '\r':
case ' ':
{
alt6=6;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 6, 0, input);
throw nvae;
}
switch (alt6) {
case 1 :
// RoleDef.g:1:10: COLON
{
mCOLON();
}
break;
case 2 :
// RoleDef.g:1:16: COMMA
{
mCOMMA();
}
break;
case 3 :
// RoleDef.g:1:22: GEQ
{
mGEQ();
}
break;
case 4 :
// RoleDef.g:1:26: STR
{
mSTR();
}
break;
case 5 :
// RoleDef.g:1:30: COMMENT
{
mCOMMENT();
}
break;
case 6 :
// RoleDef.g:1:38: WS
{
mWS();
}
break;
}
}
}