Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
net.sf.jasperreports.engine.json.parser.JsonQueryLexer Maven / Gradle / Ivy
// $ANTLR 2.7.5 (20050128): "json_grammar.g" -> "JsonQueryLexer.java"$
/*
* JasperReports - Free Java Reporting Library.
* Copyright (C) 2001 - 2016 TIBCO Software Inc. All rights reserved.
* http://www.jaspersoft.com
*
* Unless you have purchased a commercial license agreement from Jaspersoft,
* the following license terms apply:
*
* This program is part of JasperReports.
*
* JasperReports is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* JasperReports is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with JasperReports. If not, see .
*/
package net.sf.jasperreports.engine.json.parser;
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;
/**
* @author Narcis Marcu ([email protected] )
*/
public class JsonQueryLexer extends antlr.CharScanner implements JsonQueryParserTokenTypes, TokenStream
{
@Override
public void reportError(RecognitionException re) {
throw new RuntimeException(re);
}
public JsonQueryLexer(InputStream in) {
this(new ByteBuffer(in));
}
public JsonQueryLexer(Reader in) {
this(new CharBuffer(in));
}
public JsonQueryLexer(InputBuffer ib) {
this(new LexerSharedInputState(ib));
}
public JsonQueryLexer(LexerSharedInputState state) {
super(state);
caseSensitiveLiterals = true;
setCaseSensitive(true);
literals = new Hashtable();
literals.put(new ANTLRHashString("null", this), new Integer(48));
literals.put(new ANTLRHashString("true", this), new Integer(49));
literals.put(new ANTLRHashString("false", this), new Integer(50));
}
@Override
public Token nextToken() throws TokenStreamException {
Token theRetToken=null;
tryAgain:
for (;;) {
Token _token = null;
int _ttype = Token.INVALID_TYPE;
setCommitToPath(false);
int _m;
_m = mark();
resetText();
try { // for char stream error handling
try { // for lexical error handling
switch ( LA(1)) {
case ':':
{
mSEMI(true);
theRetToken=_returnToken;
break;
}
case ',':
{
mCOMMA(true);
theRetToken=_returnToken;
break;
}
case '^':
{
mCARET(true);
theRetToken=_returnToken;
break;
}
case '{':
{
mLCURLY(true);
theRetToken=_returnToken;
break;
}
case '}':
{
mRCURLY(true);
theRetToken=_returnToken;
break;
}
case '[':
{
mLBRACKET(true);
theRetToken=_returnToken;
break;
}
case ']':
{
mRBRACKET(true);
theRetToken=_returnToken;
break;
}
case '(':
{
mLPAREN(true);
theRetToken=_returnToken;
break;
}
case ')':
{
mRPAREN(true);
theRetToken=_returnToken;
break;
}
case '&':
{
mAND(true);
theRetToken=_returnToken;
break;
}
case '|':
{
mOR(true);
theRetToken=_returnToken;
break;
}
case '=':
{
mEQ(true);
theRetToken=_returnToken;
break;
}
case '"':
{
mSTRING(true);
theRetToken=_returnToken;
break;
}
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 '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':
{
mID_OR_ABSOLUTE(true);
theRetToken=_returnToken;
break;
}
case '-': case '.': case '0': case '1':
case '2': case '3': case '4': case '5':
case '6': case '7': case '8': case '9':
{
mINT_OR_REAL_OR_DOTS(true);
theRetToken=_returnToken;
break;
}
case '\n': case '\r':
{
mNEWLINE(true);
theRetToken=_returnToken;
break;
}
default:
if ((LA(1)=='!') && (LA(2)=='=')) {
mNE(true);
theRetToken=_returnToken;
}
else if ((LA(1)=='*') && (LA(2)=='=')) {
mCONTAINS(true);
theRetToken=_returnToken;
}
else if ((LA(1)=='<') && (LA(2)=='=')) {
mLE(true);
theRetToken=_returnToken;
}
else if ((LA(1)=='>') && (LA(2)=='=')) {
mGE(true);
theRetToken=_returnToken;
}
else if ((LA(1)=='@') && (LA(2)=='s')) {
mAT_SIZE(true);
theRetToken=_returnToken;
}
else if ((LA(1)=='@') && (LA(2)=='v')) {
mAT_VALUE(true);
theRetToken=_returnToken;
}
else if ((LA(1)=='@') && (LA(2)=='i')) {
mTYPE_CHECK(true);
theRetToken=_returnToken;
}
else if ((LA(1)=='/') && (LA(2)=='/')) {
mSINGLE_LINE_COMMENT(true);
theRetToken=_returnToken;
}
else if ((LA(1)=='/') && (LA(2)=='*')) {
mMULTI_LINE_COMMENT(true);
theRetToken=_returnToken;
}
else if ((LA(1)=='*') && (true)) {
mWILDCARD(true);
theRetToken=_returnToken;
}
else if ((LA(1)=='!') && (true)) {
mNOT(true);
theRetToken=_returnToken;
}
else if ((LA(1)=='<') && (true)) {
mLT(true);
theRetToken=_returnToken;
}
else if ((LA(1)=='>') && (true)) {
mGT(true);
theRetToken=_returnToken;
}
else {
if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);}
else {
commit();
try {mWS(false);}
catch(RecognitionException e) {
// catastrophic failure
reportError(e);
consume();
}
continue tryAgain;
}
}
}
commit();
if ( _returnToken==null ) continue tryAgain; // found SKIP token
_ttype = _returnToken.getType();
_ttype = testLiteralsTable(_ttype);
_returnToken.setType(_ttype);
return _returnToken;
}
catch (RecognitionException e) {
if ( !getCommitToPath() ) {
rewind(_m);
resetText();
try {mWS(false);}
catch(RecognitionException ee) {
// horrendous failure: error in filter rule
reportError(ee);
consume();
}
continue tryAgain;
}
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 mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = SEMI;
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 mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = COMMA;
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 mWILDCARD(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = WILDCARD;
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 mCARET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = CARET;
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 mLCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = LCURLY;
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 mRCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = RCURLY;
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 mLBRACKET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = LBRACKET;
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 mRBRACKET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = RBRACKET;
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 mLPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = LPAREN;
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 mRPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = RPAREN;
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 mAND(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = AND;
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 mOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = OR;
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 mNOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = NOT;
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 mEQ(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = EQ;
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 mNE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = NE;
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 mCONTAINS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = CONTAINS;
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 mLT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = LT;
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 mLE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = LE;
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 mGT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = GT;
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 mGE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = GE;
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 mAT_SIZE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = AT_SIZE;
int _saveIndex;
match("@size");
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 mAT_VALUE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = AT_VALUE;
int _saveIndex;
match("@val");
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 mTYPE_CHECK(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = TYPE_CHECK;
int _saveIndex;
boolean synPredMatched150 = false;
if (((LA(1)=='@') && (LA(2)=='i'))) {
int _m150 = mark();
synPredMatched150 = true;
inputState.guessing++;
try {
{
match("@isNotNull");
}
}
catch (RecognitionException pe) {
synPredMatched150 = false;
}
rewind(_m150);
inputState.guessing--;
}
if ( synPredMatched150 ) {
mAT_IS_NOT_NULL(false);
if ( inputState.guessing==0 ) {
_ttype = AT_IS_NOT_NULL;
}
}
else {
boolean synPredMatched152 = false;
if (((LA(1)=='@') && (LA(2)=='i'))) {
int _m152 = mark();
synPredMatched152 = true;
inputState.guessing++;
try {
{
match("@isNull");
}
}
catch (RecognitionException pe) {
synPredMatched152 = false;
}
rewind(_m152);
inputState.guessing--;
}
if ( synPredMatched152 ) {
mAT_IS_NULL(false);
if ( inputState.guessing==0 ) {
_ttype = AT_IS_NULL;
}
}
else {
boolean synPredMatched154 = false;
if (((LA(1)=='@') && (LA(2)=='i'))) {
int _m154 = mark();
synPredMatched154 = true;
inputState.guessing++;
try {
{
match("@isArray");
}
}
catch (RecognitionException pe) {
synPredMatched154 = false;
}
rewind(_m154);
inputState.guessing--;
}
if ( synPredMatched154 ) {
mAT_IS_ARRAY(false);
if ( inputState.guessing==0 ) {
_ttype = AT_IS_ARRAY;
}
}
else {
boolean synPredMatched156 = false;
if (((LA(1)=='@') && (LA(2)=='i'))) {
int _m156 = mark();
synPredMatched156 = true;
inputState.guessing++;
try {
{
match("@isObject");
}
}
catch (RecognitionException pe) {
synPredMatched156 = false;
}
rewind(_m156);
inputState.guessing--;
}
if ( synPredMatched156 ) {
mAT_IS_OBJECT(false);
if ( inputState.guessing==0 ) {
_ttype = AT_IS_OBJECT;
}
}
else {
boolean synPredMatched158 = false;
if (((LA(1)=='@') && (LA(2)=='i'))) {
int _m158 = mark();
synPredMatched158 = true;
inputState.guessing++;
try {
{
match("@isValue");
}
}
catch (RecognitionException pe) {
synPredMatched158 = false;
}
rewind(_m158);
inputState.guessing--;
}
if ( synPredMatched158 ) {
mAT_IS_VALUE(false);
if ( inputState.guessing==0 ) {
_ttype = AT_IS_VALUE;
}
}
else {
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}}}}
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 mAT_IS_NOT_NULL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = AT_IS_NOT_NULL;
int _saveIndex;
match("@isNotNull");
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 mAT_IS_NULL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = AT_IS_NULL;
int _saveIndex;
match("@isNull");
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 mAT_IS_ARRAY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = AT_IS_ARRAY;
int _saveIndex;
match("@isArray");
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 mAT_IS_OBJECT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = AT_IS_OBJECT;
int _saveIndex;
match("@isObject");
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 mAT_IS_VALUE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = AT_IS_VALUE;
int _saveIndex;
match("@isValue");
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 mSTRING(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = STRING;
int _saveIndex;
_saveIndex=text.length();
match('"');
text.setLength(_saveIndex);
{
_loop162:
do {
if ((LA(1)=='\\')) {
mESC(false);
}
else if ((_tokenSet_0.member(LA(1)))) {
{
match(_tokenSet_0);
}
}
else {
break _loop162;
}
} while (true);
}
_saveIndex=text.length();
match('"');
text.setLength(_saveIndex);
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 mESC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = ESC;
int _saveIndex;
match('\\');
{
switch ( LA(1)) {
case 'n':
{
match('n');
if ( inputState.guessing==0 ) {
text.setLength(_begin); text.append("\n");
}
break;
}
case 'r':
{
match('r');
if ( inputState.guessing==0 ) {
text.setLength(_begin); text.append("\r");
}
break;
}
case 't':
{
match('t');
if ( inputState.guessing==0 ) {
text.setLength(_begin); text.append("\t");
}
break;
}
case '"':
{
match('"');
if ( inputState.guessing==0 ) {
text.setLength(_begin); text.append("\"");
}
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
}
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 mID_OR_ABSOLUTE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = ID_OR_ABSOLUTE;
int _saveIndex;
boolean synPredMatched165 = false;
if ((((_tokenSet_1.member(LA(1))) && (true))&&( getColumn() == 1 ))) {
int _m165 = mark();
synPredMatched165 = true;
inputState.guessing++;
try {
{
match('$');
mID_LETTER(false);
}
}
catch (RecognitionException pe) {
synPredMatched165 = false;
}
rewind(_m165);
inputState.guessing--;
}
if ( synPredMatched165 ) {
mID(false);
if ( inputState.guessing==0 ) {
_ttype = ID;
}
}
else if (((LA(1)=='$') && (true))&&( getColumn() == 1 && getLine() == 1 )) {
match('$');
if ( inputState.guessing==0 ) {
_ttype = ABSOLUTE;
}
}
else {
boolean synPredMatched169 = false;
if ((((_tokenSet_1.member(LA(1))) && (true))&&( getColumn() == 1 ))) {
int _m169 = mark();
synPredMatched169 = true;
inputState.guessing++;
try {
{
{
switch ( LA(1)) {
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':
{
matchRange('a','z');
break;
}
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':
{
matchRange('A','Z');
break;
}
case '_':
{
match('_');
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
}
{
if ((_tokenSet_2.member(LA(1)))) {
mID_LETTER(false);
}
else {
}
}
}
}
catch (RecognitionException pe) {
synPredMatched169 = false;
}
rewind(_m169);
inputState.guessing--;
}
if ( synPredMatched169 ) {
mID(false);
if ( inputState.guessing==0 ) {
_ttype = ID;
}
}
else if (((_tokenSet_1.member(LA(1))) && (true))&&( getColumn() == 1 && getLine() > 1 || getColumn() > 1 )) {
mID(false);
if ( inputState.guessing==0 ) {
_ttype = ID;
}
}
else {
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
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 mID_LETTER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = ID_LETTER;
int _saveIndex;
switch ( LA(1)) {
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 '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':
{
mID_START_LETTER(false);
break;
}
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
case '8': case '9':
{
mDIGIT(false);
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
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 mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = ID;
int _saveIndex;
mID_START_LETTER(false);
{
_loop191:
do {
if ((_tokenSet_2.member(LA(1)))) {
mID_LETTER(false);
}
else {
break _loop191;
}
} 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 mINT_OR_REAL_OR_DOTS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = INT_OR_REAL_OR_DOTS;
int _saveIndex;
boolean synPredMatched175 = false;
if (((_tokenSet_3.member(LA(1))) && (_tokenSet_4.member(LA(2))))) {
int _m175 = mark();
synPredMatched175 = true;
inputState.guessing++;
try {
{
{
switch ( LA(1)) {
case '-':
{
match('-');
break;
}
case '.': case '0': case '1': case '2':
case '3': case '4': case '5': case '6':
case '7': case '8': case '9':
{
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
}
{
_loop174:
do {
if (((LA(1) >= '0' && LA(1) <= '9'))) {
mDIGIT(false);
}
else {
break _loop174;
}
} while (true);
}
mFRAC(false);
}
}
catch (RecognitionException pe) {
synPredMatched175 = false;
}
rewind(_m175);
inputState.guessing--;
}
if ( synPredMatched175 ) {
mREAL(false);
if ( inputState.guessing==0 ) {
_ttype = REAL;
}
}
else {
boolean synPredMatched177 = false;
if (((LA(1)=='.') && (LA(2)=='.'))) {
int _m177 = mark();
synPredMatched177 = true;
inputState.guessing++;
try {
{
match("..");
}
}
catch (RecognitionException pe) {
synPredMatched177 = false;
}
rewind(_m177);
inputState.guessing--;
}
if ( synPredMatched177 ) {
mDOTDOT(false);
if ( inputState.guessing==0 ) {
_ttype = DOTDOT;
}
}
else if ((_tokenSet_5.member(LA(1))) && (true)) {
mINT(false);
if ( inputState.guessing==0 ) {
_ttype = INT;
}
}
else if ((LA(1)=='.') && (true)) {
mDOT(false);
if ( inputState.guessing==0 ) {
_ttype = DOT;
}
}
else {
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
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 mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = DIGIT;
int _saveIndex;
matchRange('0','9');
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 mFRAC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = FRAC;
int _saveIndex;
match('.');
{
int _cnt207=0;
_loop207:
do {
if (((LA(1) >= '0' && LA(1) <= '9'))) {
mDIGIT(false);
}
else {
if ( _cnt207>=1 ) { break _loop207; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
_cnt207++;
} 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 mREAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = REAL;
int _saveIndex;
{
switch ( LA(1)) {
case '-':
{
match('-');
break;
}
case '.': case '0': case '1': case '2':
case '3': case '4': case '5': case '6':
case '7': case '8': case '9':
{
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
}
{
_loop199:
do {
if (((LA(1) >= '0' && LA(1) <= '9'))) {
mDIGIT(false);
}
else {
break _loop199;
}
} while (true);
}
mFRAC(false);
{
if ((LA(1)=='E'||LA(1)=='e')) {
mEXP(false);
}
else {
}
}
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 mDOTDOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = DOTDOT;
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 mINT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = INT;
int _saveIndex;
{
switch ( LA(1)) {
case '-':
{
match('-');
break;
}
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
case '8': case '9':
{
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
}
{
int _cnt195=0;
_loop195:
do {
if (((LA(1) >= '0' && LA(1) <= '9'))) {
mDIGIT(false);
}
else {
if ( _cnt195>=1 ) { break _loop195; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
_cnt195++;
} 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 mDOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = DOT;
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 mNEWLINE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = NEWLINE;
int _saveIndex;
{
if ((LA(1)=='\r') && (LA(2)=='\n')) {
match("\r\n");
}
else if ((LA(1)=='\r') && (true)) {
match('\r');
}
else if ((LA(1)=='\n')) {
match('\n');
}
else {
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
if ( inputState.guessing==0 ) {
newline();
_ttype = Token.SKIP;
}
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 mSINGLE_LINE_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = SINGLE_LINE_COMMENT;
int _saveIndex;
match("//");
{
_loop183:
do {
if ((_tokenSet_6.member(LA(1)))) {
{
match(_tokenSet_6);
}
}
else {
break _loop183;
}
} while (true);
}
{
if ((LA(1)=='\r') && (LA(2)=='\n')) {
match("\r\n");
}
else if ((LA(1)=='\r') && (true)) {
match('\r');
}
else if ((LA(1)=='\n')) {
match('\n');
}
else {
}
}
if ( inputState.guessing==0 ) {
newline();
_ttype = Token.SKIP;
}
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 mMULTI_LINE_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = MULTI_LINE_COMMENT;
int _saveIndex;
match("/*");
{
_loop187:
do {
// nongreedy exit test
if ((LA(1)=='*') && (LA(2)=='/')) break _loop187;
if (((LA(1) >= '\u0000' && LA(1) <= '\ufffe')) && ((LA(2) >= '\u0000' && LA(2) <= '\ufffe'))) {
matchNot(EOF_CHAR);
}
else {
break _loop187;
}
} while (true);
}
match("*/");
if ( inputState.guessing==0 ) {
_ttype = Token.SKIP;
}
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 mABSOLUTE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = ABSOLUTE;
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 mID_START_LETTER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = ID_START_LETTER;
int _saveIndex;
switch ( LA(1)) {
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':
{
matchRange('a','z');
break;
}
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':
{
matchRange('A','Z');
break;
}
case '$':
{
match('$');
break;
}
case '_':
{
match('_');
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
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 mEXP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = EXP;
int _saveIndex;
{
switch ( LA(1)) {
case 'e':
{
match('e');
break;
}
case 'E':
{
match('E');
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
}
{
switch ( LA(1)) {
case '+':
{
match('+');
break;
}
case '-':
{
match('-');
break;
}
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
case '8': case '9':
{
break;
}
default:
{
throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
}
}
}
{
int _cnt212=0;
_loop212:
do {
if (((LA(1) >= '0' && LA(1) <= '9'))) {
mDIGIT(false);
}
else {
if ( _cnt212>=1 ) { break _loop212; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
_cnt212++;
} 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 mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = WS;
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;
}
private static final long[] mk_tokenSet_0() {
long[] data = new long[2048];
data[0]=-17179869185L;
data[1]=-268435457L;
for (int i = 2; i<=1022; i++) { data[i]=-1L; }
data[1023]=9223372036854775807L;
return data;
}
public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
private static final long[] mk_tokenSet_1() {
long[] data = new long[1025];
data[0]=68719476736L;
data[1]=576460745995190270L;
return data;
}
public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
private static final long[] mk_tokenSet_2() {
long[] data = new long[1025];
data[0]=287948969894477824L;
data[1]=576460745995190270L;
return data;
}
public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
private static final long[] mk_tokenSet_3() {
long[] data = new long[1025];
data[0]=288054454291267584L;
return data;
}
public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
private static final long[] mk_tokenSet_4() {
long[] data = new long[1025];
data[0]=288019269919178752L;
return data;
}
public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4());
private static final long[] mk_tokenSet_5() {
long[] data = new long[1025];
data[0]=287984085547089920L;
return data;
}
public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5());
private static final long[] mk_tokenSet_6() {
long[] data = new long[2048];
data[0]=-9217L;
for (int i = 1; i<=1022; i++) { data[i]=-1L; }
data[1023]=9223372036854775807L;
return data;
}
public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6());
}