⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dqlbaselexer.java

📁 OBPM是一个开源
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
// $ANTLR 2.7.6 (2005-12-22): "/C:/Java/jboss-4.0.1sp1/server/test/deploy/webapp.war/WEB-INF/classes/cn/myapps/core/dynaform/document/dql/dql.g" -> "DqlBaseLexer.java"$

package cn.myapps.core.dynaform.document.dql;
import org.hibernate.hql.ast.*;
import org.hibernate.hql.ast.util.*;
import cn.myapps.base.action.ParamsTable;

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 DqlBaseLexer extends antlr.CharScanner implements DqlTokenTypes, TokenStream
 {

	// NOTE: The real implementations are in the subclass.
	protected void setPossibleID(boolean possibleID) {}
public DqlBaseLexer(InputStream in) {
	this(new ByteBuffer(in));
}
public DqlBaseLexer(Reader in) {
	this(new CharBuffer(in));
}
public DqlBaseLexer(InputBuffer ib) {
	this(new LexerSharedInputState(ib));
}
public DqlBaseLexer(LexerSharedInputState state) {
	super(state);
	caseSensitiveLiterals = false;
	setCaseSensitive(false);
	literals = new Hashtable();
	literals.put(new ANTLRHashString("between", this), new Integer(10));
	literals.put(new ANTLRHashString("case", this), new Integer(55));
	literals.put(new ANTLRHashString("delete", this), new Integer(13));
	literals.put(new ANTLRHashString("new", this), new Integer(38));
	literals.put(new ANTLRHashString("end", this), new Integer(56));
	literals.put(new ANTLRHashString("object", this), new Integer(66));
	literals.put(new ANTLRHashString("insert", this), new Integer(29));
	literals.put(new ANTLRHashString("distinct", this), new Integer(16));
	literals.put(new ANTLRHashString("where", this), new Integer(54));
	literals.put(new ANTLRHashString("trailing", this), new Integer(68));
	literals.put(new ANTLRHashString("then", this), new Integer(58));
	literals.put(new ANTLRHashString("select", this), new Integer(46));
	literals.put(new ANTLRHashString("and", this), new Integer(6));
	literals.put(new ANTLRHashString("outer", this), new Integer(43));
	literals.put(new ANTLRHashString("not", this), new Integer(39));
	literals.put(new ANTLRHashString("fetch", this), new Integer(21));
	literals.put(new ANTLRHashString("from", this), new Integer(22));
	literals.put(new ANTLRHashString("null", this), new Integer(40));
	literals.put(new ANTLRHashString("count", this), new Integer(12));
	literals.put(new ANTLRHashString("like", this), new Integer(34));
	literals.put(new ANTLRHashString("when", this), new Integer(59));
	literals.put(new ANTLRHashString("class", this), new Integer(11));
	literals.put(new ANTLRHashString("inner", this), new Integer(28));
	literals.put(new ANTLRHashString("leading", this), new Integer(64));
	literals.put(new ANTLRHashString("with", this), new Integer(61));
	literals.put(new ANTLRHashString("set", this), new Integer(47));
	literals.put(new ANTLRHashString("escape", this), new Integer(18));
	literals.put(new ANTLRHashString("join", this), new Integer(32));
	literals.put(new ANTLRHashString("elements", this), new Integer(17));
	literals.put(new ANTLRHashString("of", this), new Integer(67));
	literals.put(new ANTLRHashString("is", this), new Integer(31));
	literals.put(new ANTLRHashString("member", this), new Integer(65));
	literals.put(new ANTLRHashString("or", this), new Integer(41));
	literals.put(new ANTLRHashString("any", this), new Integer(5));
	literals.put(new ANTLRHashString("full", this), new Integer(23));
	literals.put(new ANTLRHashString("min", this), new Integer(37));
	literals.put(new ANTLRHashString("as", this), new Integer(7));
	literals.put(new ANTLRHashString("all", this), new Integer(4));
	literals.put(new ANTLRHashString("union", this), new Integer(51));
	literals.put(new ANTLRHashString("order", this), new Integer(42));
	literals.put(new ANTLRHashString("both", this), new Integer(62));
	literals.put(new ANTLRHashString("some", this), new Integer(48));
	literals.put(new ANTLRHashString("properties", this), new Integer(44));
	literals.put(new ANTLRHashString("false", this), new Integer(20));
	literals.put(new ANTLRHashString("exists", this), new Integer(19));
	literals.put(new ANTLRHashString("asc", this), new Integer(8));
	literals.put(new ANTLRHashString("left", this), new Integer(33));
	literals.put(new ANTLRHashString("desc", this), new Integer(14));
	literals.put(new ANTLRHashString("max", this), new Integer(36));
	literals.put(new ANTLRHashString("ilike", this), new Integer(35));
	literals.put(new ANTLRHashString("empty", this), new Integer(63));
	literals.put(new ANTLRHashString("sum", this), new Integer(49));
	literals.put(new ANTLRHashString("on", this), new Integer(60));
	literals.put(new ANTLRHashString("into", this), new Integer(30));
	literals.put(new ANTLRHashString("else", this), new Integer(57));
	literals.put(new ANTLRHashString("right", this), new Integer(45));
	literals.put(new ANTLRHashString("versioned", this), new Integer(53));
	literals.put(new ANTLRHashString("in", this), new Integer(26));
	literals.put(new ANTLRHashString("avg", this), new Integer(9));
	literals.put(new ANTLRHashString("update", this), new Integer(52));
	literals.put(new ANTLRHashString("true", this), new Integer(50));
	literals.put(new ANTLRHashString("group", this), new Integer(24));
	literals.put(new ANTLRHashString("having", this), new Integer(25));
	literals.put(new ANTLRHashString("indices", this), new Integer(27));
}

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
				switch ( LA(1)) {
				case '=':
				{
					mEQ(true);
					theRetToken=_returnToken;
					break;
				}
				case '!':  case '^':
				{
					mNE(true);
					theRetToken=_returnToken;
					break;
				}
				case ',':
				{
					mCOMMA(true);
					theRetToken=_returnToken;
					break;
				}
				case '(':
				{
					mOPEN(true);
					theRetToken=_returnToken;
					break;
				}
				case ')':
				{
					mCLOSE(true);
					theRetToken=_returnToken;
					break;
				}
				case '[':
				{
					mOPEN_BRACKET(true);
					theRetToken=_returnToken;
					break;
				}
				case ']':
				{
					mCLOSE_BRACKET(true);
					theRetToken=_returnToken;
					break;
				}
				case '|':
				{
					mCONCAT(true);
					theRetToken=_returnToken;
					break;
				}
				case '+':
				{
					mPLUS(true);
					theRetToken=_returnToken;
					break;
				}
				case '-':
				{
					mMINUS(true);
					theRetToken=_returnToken;
					break;
				}
				case '*':
				{
					mSTAR(true);
					theRetToken=_returnToken;
					break;
				}
				case '/':
				{
					mDIV(true);
					theRetToken=_returnToken;
					break;
				}
				case ':':
				{
					mCOLON(true);
					theRetToken=_returnToken;
					break;
				}
				case '?':
				{
					mPARAM(true);
					theRetToken=_returnToken;
					break;
				}
				case '\'':
				{
					mQUOTED_STRING(true);
					theRetToken=_returnToken;
					break;
				}
				case '\t':  case '\n':  case '\r':  case ' ':
				{
					mWS(true);
					theRetToken=_returnToken;
					break;
				}
				case '.':  case '0':  case '1':  case '2':
				case '3':  case '4':  case '5':  case '6':
				case '7':  case '8':  case '9':
				{
					mNUM_INT(true);
					theRetToken=_returnToken;
					break;
				}
				default:
					if ((LA(1)=='<') && (LA(2)=='>')) {
						mSQL_NE(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)=='<') && (true)) {
						mLT(true);
						theRetToken=_returnToken;
					}
					else if ((LA(1)=='>') && (true)) {
						mGT(true);
						theRetToken=_returnToken;
					}
					else if ((_tokenSet_0.member(LA(1)))) {
						mIDENT(true);
						theRetToken=_returnToken;
					}
				else {
					if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);}
				else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
				}
				}
				if ( _returnToken==null ) continue tryAgain; // found SKIP token
				_ttype = _returnToken.getType();
				_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 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 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 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 mSQL_NE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
		int _ttype; Token _token=null; int _begin=text.length();
		_ttype = SQL_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 mNE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
		int _ttype; Token _token=null; int _begin=text.length();
		_ttype = NE;
		int _saveIndex;
		
		switch ( LA(1)) {
		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;
	}
	
	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 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 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;
	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -