lispLexer.java
No OneTemporary

File Metadata

Created
Sun, Apr 19, 5:10 AM

lispLexer.java

// $ANTLR 3.4 /private/prg/code/xreate/antlr/lisp.g 2012-04-07 17:57:03
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
@SuppressWarnings({"all", "warnings", "unchecked"})
public class lispLexer extends Lexer {
public static final int EOF=-1;
public static final int T__6=6;
public static final int T__7=7;
public static final int T__8=8;
public static final int WHITESPACE=4;
public static final int WORD=5;
// delegates
// delegators
public Lexer[] getDelegates() {
return new Lexer[] {};
}
public lispLexer() {}
public lispLexer(CharStream input) {
this(input, new RecognizerSharedState());
}
public lispLexer(CharStream input, RecognizerSharedState state) {
super(input,state);
}
public String getGrammarFileName() { return "/private/prg/code/xreate/antlr/lisp.g"; }
// $ANTLR start "T__6"
public final void mT__6() throws RecognitionException {
try {
int _type = T__6;
int _channel = DEFAULT_TOKEN_CHANNEL;
// /private/prg/code/xreate/antlr/lisp.g:2:6: ( '(' )
// /private/prg/code/xreate/antlr/lisp.g:2:8: '('
{
match('(');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__6"
// $ANTLR start "T__7"
public final void mT__7() throws RecognitionException {
try {
int _type = T__7;
int _channel = DEFAULT_TOKEN_CHANNEL;
// /private/prg/code/xreate/antlr/lisp.g:3:6: ( ')' )
// /private/prg/code/xreate/antlr/lisp.g:3:8: ')'
{
match(')');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__7"
// $ANTLR start "T__8"
public final void mT__8() throws RecognitionException {
try {
int _type = T__8;
int _channel = DEFAULT_TOKEN_CHANNEL;
// /private/prg/code/xreate/antlr/lisp.g:4:6: ( ',' )
// /private/prg/code/xreate/antlr/lisp.g:4:8: ','
{
match(',');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "T__8"
// $ANTLR start "WHITESPACE"
public final void mWHITESPACE() throws RecognitionException {
try {
int _type = WHITESPACE;
int _channel = DEFAULT_TOKEN_CHANNEL;
// /private/prg/code/xreate/antlr/lisp.g:3:12: ( ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' )+ )
// /private/prg/code/xreate/antlr/lisp.g:3:14: ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' )+
{
// /private/prg/code/xreate/antlr/lisp.g:3:14: ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' )+
int cnt1=0;
loop1:
do {
int alt1=2;
int LA1_0 = input.LA(1);
if ( ((LA1_0 >= '\t' && LA1_0 <= '\n')||(LA1_0 >= '\f' && LA1_0 <= '\r')||LA1_0==' ') ) {
alt1=1;
}
switch (alt1) {
case 1 :
// /private/prg/code/xreate/antlr/lisp.g:
{
if ( (input.LA(1) >= '\t' && input.LA(1) <= '\n')||(input.LA(1) >= '\f' && input.LA(1) <= '\r')||input.LA(1)==' ' ) {
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);
_channel = HIDDEN;
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "WHITESPACE"
// $ANTLR start "WORD"
public final void mWORD() throws RecognitionException {
try {
int _type = WORD;
int _channel = DEFAULT_TOKEN_CHANNEL;
// /private/prg/code/xreate/antlr/lisp.g:5:6: ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )+ )
// /private/prg/code/xreate/antlr/lisp.g:5:8: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )+
{
// /private/prg/code/xreate/antlr/lisp.g:5:8: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )+
int cnt2=0;
loop2:
do {
int alt2=2;
int LA2_0 = input.LA(1);
if ( ((LA2_0 >= '0' && LA2_0 <= '9')||(LA2_0 >= 'A' && LA2_0 <= 'Z')||LA2_0=='_'||(LA2_0 >= 'a' && LA2_0 <= 'z')) ) {
alt2=1;
}
switch (alt2) {
case 1 :
// /private/prg/code/xreate/antlr/lisp.g:
{
if ( (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 ( cnt2 >= 1 ) break loop2;
EarlyExitException eee =
new EarlyExitException(2, input);
throw eee;
}
cnt2++;
} while (true);
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "WORD"
public void mTokens() throws RecognitionException {
// /private/prg/code/xreate/antlr/lisp.g:1:8: ( T__6 | T__7 | T__8 | WHITESPACE | WORD )
int alt3=5;
switch ( input.LA(1) ) {
case '(':
{
alt3=1;
}
break;
case ')':
{
alt3=2;
}
break;
case ',':
{
alt3=3;
}
break;
case '\t':
case '\n':
case '\f':
case '\r':
case ' ':
{
alt3=4;
}
break;
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':
{
alt3=5;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 3, 0, input);
throw nvae;
}
switch (alt3) {
case 1 :
// /private/prg/code/xreate/antlr/lisp.g:1:10: T__6
{
mT__6();
}
break;
case 2 :
// /private/prg/code/xreate/antlr/lisp.g:1:15: T__7
{
mT__7();
}
break;
case 3 :
// /private/prg/code/xreate/antlr/lisp.g:1:20: T__8
{
mT__8();
}
break;
case 4 :
// /private/prg/code/xreate/antlr/lisp.g:1:25: WHITESPACE
{
mWHITESPACE();
}
break;
case 5 :
// /private/prg/code/xreate/antlr/lisp.g:1:36: WORD
{
mWORD();
}
break;
}
}
}

Event Timeline