// $ANTLR 2.7.0: "action.g" -> "ActionLexer.java"$
package org.jostraca;
import org.jostraca.util.UserErrorHandler;
import org.jostraca.util.UserErrorStore;
import java.util.Vector;
import java.io.StringReader;
import java.io.InputStream;
import antlr.TokenStreamException;
import antlr.TokenStreamIOException;
import antlr.TokenStreamRecognitionException;
import antlr.CharStreamException;
import antlr.CharStreamIOException;
import antlr.ANTLRException;
import java.io.Reader;
import java.util.Hashtable;
import antlr.CharScanner;
import antlr.InputBuffer;
import antlr.ByteBuffer;
import antlr.CharBuffer;
import antlr.Token;
import antlr.CommonToken;
import antlr.RecognitionException;
import antlr.NoViableAltForCharException;
import antlr.MismatchedCharException;
import antlr.TokenStream;
import antlr.ANTLRHashString;
import antlr.LexerSharedInputState;
import antlr.collections.impl.BitSet;
import antlr.SemanticException;
public class ActionLexer extends antlr.CharScanner implements ActionLexerTokenTypes, TokenStream
{
UserErrorHandler iUserErrorHandler = new UserErrorHandler();
public void reportError(RecognitionException rRecognitionException) {
iUserErrorHandler.addUserError( ""+rRecognitionException );
}
public void reportError(String rErrorMsg) {
iUserErrorHandler.addUserError( rErrorMsg );
}
public void reportWarning(String rWarningMsg) {
iUserErrorHandler.addUserError( rWarningMsg );
}
public void init() {
iUserErrorHandler.clearUserErrors();
}
public boolean hasUserErrors() {
return iUserErrorHandler.hasUserErrors();
}
public Vector getUserErrors() {
return iUserErrorHandler.getUserErrors();
}
public ActionLexer(InputStream in) {
this(new ByteBuffer(in));
}
public ActionLexer(Reader in) {
this(new CharBuffer(in));
}
public ActionLexer(InputBuffer ib) {
this(new LexerSharedInputState(ib));
}
public ActionLexer(LexerSharedInputState state) {
super(state);
literals = new Hashtable();
caseSensitiveLiterals = true;
setCaseSensitive(true);
}
public Token nextToken() throws TokenStreamException {
Token theRetToken=null;
tryAgain:
for (;;) {
Token _token = null;
int _ttype = Token.INVALID_TYPE;
resetText();
try { // for char stream error handling
try { // for lexical error handling
if ((LA(1)=='[') && (LA(2)=='#')) {
mMARKED(true);
theRetToken=_returnToken;
}
else if ((_tokenSet_0.member(LA(1)))) {
mWHITESPACE(true);
theRetToken=_returnToken;
}
else if ((_tokenSet_1.member(LA(1))) && (true)) {
mARGUMENT(true);
theRetToken=_returnToken;
}
else {
if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);}
else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
}
if ( _returnToken==null ) continue tryAgain; // found SKIP token
_ttype = _returnToken.getType();
_ttype = testLiteralsTable(_ttype);
_returnToken.setType(_ttype);
return _returnToken;
}
catch (RecognitionException e) {
throw new TokenStreamRecognitionException(e);
}
}
catch (CharStreamException cse) {
if ( cse instanceof CharStreamIOException ) {
throw new TokenStreamIOException(((CharStreamIOException)cse).io);
}
else {
throw new TokenStreamException(cse.getMessage());
}
}
}
}
public final void mWHITESPACE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = WHITESPACE;
int _saveIndex;
{
int _cnt3=0;
_loop3:
do {
switch ( LA(1)) {
case ' ':
{
match(' ');
break;
}
case '\t':
{
match('\t');
break;
}
case '\n':
{
match('\n');
break;
}
case '\r':
{
match('\r');
break;
}
case '\14':
{
match('\f');
break;
}
default:
{
if ( _cnt3>=1 ) { break _loop3; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
}
}
_cnt3++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
_token = makeToken(_ttype);
_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
}
_returnToken = _token;
}
public final void mARGUMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = ARGUMENT;
int _saveIndex;
if ((LA(1)=='"') && ((LA(2) >= '\3' && LA(2) <= '\377'))) {
match('"');
{
_loop6:
do {
if ((_tokenSet_2.member(LA(1)))) {
matchNot('"');
}
else {
break _loop6;
}
} while (true);
}
match('"');
}
else if ((_tokenSet_1.member(LA(1))) && (true)) {
{
int _cnt8=0;
_loop8:
do {
if ((_tokenSet_1.member(LA(1)))) {
mARGUMENT_PART(false);
}
else {
if ( _cnt8>=1 ) { break _loop8; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
}
_cnt8++;
} while (true);
}
}
else {
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
_token = makeToken(_ttype);
_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
}
_returnToken = _token;
}
protected final void mARGUMENT_PART(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = ARGUMENT_PART;
int _saveIndex;
switch ( LA(1)) {
case '[':
{
match('[');
break;
}
case '#':
{
match('#');
break;
}
case ']':
{
match(']');
break;
}
case '\3': case '\4': case '\5': case '\6':
case '\7': case '\10': case '\13': case '\16':
case '\17': case '\20': case '\21': case '\22':
case '\23': case '\24': case '\25': case '\26':
case '\27': case '\30': case '\31': case '\32':
case '\33': case '\34': case '\35': case '\36':
case '\37': case '!': case '"': case '$':
case '%': case '&': case '\'': case '(':
case ')': case '*': case '+': case ',':
case '-': case '.': case '/': case '0':
case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8':
case '9': case ':': case ';': case '<':
case '=': case '>': case '?': 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': case '\\': case '^':
case '_': 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':
case '{': case '|': case '}': case '~':
case '\177': case '\200': case '\201': case '\202':
case '\203': case '\204': case '\205': case '\206':
case '\207': case '\210': case '\211': case '\212':
case '\213': case '\214': case '\215': case '\216':
case '\217': case '\220': case '\221': case '\222':
case '\223': case '\224': case '\225': case '\226':
case '\227': case '\230': case '\231': case '\232':
case '\233': case '\234': case '\235': case '\236':
case '\237': case '\240': case '\241': case '\242':
case '\243': case '\244': case '\245': case '\246':
case '\247': case '\250': case '\251': case '\252':
case '\253': case '\254': case '\255': case '\256':
case '\257': case '\260': case '\261': case '\262':
case '\263': case '\264': case '\265': case '\266':
case '\267': case '\270': case '\271': case '\272':
case '\273': case '\274': case '\275': case '\276':
case '\277': case '\300': case '\301': case '\302':
case '\303': case '\304': case '\305': case '\306':
case '\307': case '\310': case '\311': case '\312':
case '\313': case '\314': case '\315': case '\316':
case '\317': case '\320': case '\321': case '\322':
case '\323': case '\324': case '\325': case '\326':
case '\327': case '\330': case '\331': case '\332':
case '\333': case '\334': case '\335': case '\336':
case '\337': case '\340': case '\341': case '\342':
case '\343': case '\344': case '\345': case '\346':
case '\347': case '\350': case '\351': case '\352':
case '\353': case '\354': case '\355': case '\356':
case '\357': case '\360': case '\361': case '\362':
case '\363': case '\364': case '\365': case '\366':
case '\367': case '\370': case '\371': case '\372':
case '\373': case '\374': case '\375': case '\376':
case '\377':
{
mEVERYTHING_ELSE(false);
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
}
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
_token = makeToken(_ttype);
_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
}
_returnToken = _token;
}
protected final void mEVERYTHING_ELSE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = EVERYTHING_ELSE;
int _saveIndex;
{
int _cnt17=0;
_loop17:
do {
if ((_tokenSet_3.member(LA(1))) && (true)) {
{
match(_tokenSet_3);
}
}
else {
if ( _cnt17>=1 ) { break _loop17; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());}
}
_cnt17++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
_token = makeToken(_ttype);
_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
}
_returnToken = _token;
}
protected final void mOPEN_MARKER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = OPEN_MARKER;
int _saveIndex;
match("[#");
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
_token = makeToken(_ttype);
_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
}
_returnToken = _token;
}
protected final void mCLOSE_MARKER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = CLOSE_MARKER;
int _saveIndex;
match("#]");
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
_token = makeToken(_ttype);
_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
}
_returnToken = _token;
}
public final void mMARKED(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = MARKED;
int _saveIndex;
mOPEN_MARKER(false);
{
switch ( LA(1)) {
case '\t': case '\n': case '\14': case '\r':
case ' ':
{
mWHITESPACE(false);
break;
}
case '\3': case '\4': case '\5': case '\6':
case '\7': case '\10': case '\13': case '\16':
case '\17': case '\20': case '\21': case '\22':
case '\23': case '\24': case '\25': case '\26':
case '\27': case '\30': case '\31': case '\32':
case '\33': case '\34': case '\35': case '\36':
case '\37': case '!': case '"': case '#':
case '$': case '%': case '&': case '\'':
case '(': case ')': case '*': case '+':
case ',': case '-': case '.': case '/':
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
case '8': case '9': case ':': case ';':
case '<': case '=': case '>': case '?':
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': case '[':
case '\\': case ']': case '^': case '_':
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': case '{':
case '|': case '}': case '~': case '\177':
case '\200': case '\201': case '\202': case '\203':
case '\204': case '\205': case '\206': case '\207':
case '\210': case '\211': case '\212': case '\213':
case '\214': case '\215': case '\216': case '\217':
case '\220': case '\221': case '\222': case '\223':
case '\224': case '\225': case '\226': case '\227':
case '\230': case '\231': case '\232': case '\233':
case '\234': case '\235': case '\236': case '\237':
case '\240': case '\241': case '\242': case '\243':
case '\244': case '\245': case '\246': case '\247':
case '\250': case '\251': case '\252': case '\253':
case '\254': case '\255': case '\256': case '\257':
case '\260': case '\261': case '\262': case '\263':
case '\264': case '\265': case '\266': case '\267':
case '\270': case '\271': case '\272': case '\273':
case '\274': case '\275': case '\276': case '\277':
case '\300': case '\301': case '\302': case '\303':
case '\304': case '\305': case '\306': case '\307':
case '\310': case '\311': case '\312': case '\313':
case '\314': case '\315': case '\316': case '\317':
case '\320': case '\321': case '\322': case '\323':
case '\324': case '\325': case '\326': case '\327':
case '\330': case '\331': case '\332': case '\333':
case '\334': case '\335': case '\336': case '\337':
case '\340': case '\341': case '\342': case '\343':
case '\344': case '\345': case '\346': case '\347':
case '\350': case '\351': case '\352': case '\353':
case '\354': case '\355': case '\356': case '\357':
case '\360': case '\361': case '\362': case '\363':
case '\364': case '\365': case '\366': case '\367':
case '\370': case '\371': case '\372': case '\373':
case '\374': case '\375': case '\376': case '\377':
{
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
}
}
}
{
if ((_tokenSet_1.member(LA(1))) && (_tokenSet_4.member(LA(2)))) {
mARGUMENT_PART(false);
{
_loop24:
do {
if ((_tokenSet_0.member(LA(1)))) {
mWHITESPACE(false);
mARGUMENT_PART(false);
}
else {
break _loop24;
}
} while (true);
}
}
else if ((LA(1)=='#') && (LA(2)==']')) {
}
else {
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine());
}
}
mCLOSE_MARKER(false);
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
_token = makeToken(_ttype);
_token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
}
_returnToken = _token;
}
private static final long _tokenSet_0_data_[] = { 4294981120L, 0L, 0L, 0L, 0L };
public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
private static final long _tokenSet_1_data_[] = { -4294981128L, -1L, -1L, -1L, 0L, 0L, 0L, 0L };
public static final BitSet _tokenSet_1 = new BitSet(_tokenSet_1_data_);
private static final long _tokenSet_2_data_[] = { -17179869192L, -1L, -1L, -1L, 0L, 0L, 0L, 0L };
public static final BitSet _tokenSet_2 = new BitSet(_tokenSet_2_data_);
private static final long _tokenSet_3_data_[] = { -38654719496L, -671088641L, -1L, -1L, 0L, 0L, 0L, 0L };
public static final BitSet _tokenSet_3 = new BitSet(_tokenSet_3_data_);
private static final long _tokenSet_4_data_[] = { -8L, -671088641L, -1L, -1L, 0L, 0L, 0L, 0L };
public static final BitSet _tokenSet_4 = new BitSet(_tokenSet_4_data_);
}