/**
* Copyright (C) The MOMENT project, 2004-2006.
* http://moment.dsic.upv.es
*
* This file is part of the Maude Daemon plug-in.
* Contributed by Abel G�mez, <agomez@dsic.upv.es>.
*
* The Maude Simple GUI plug-in is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* The Maude Simple GUI plug-in 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with the Maude Development Tools plugin, see the file license.txt.
* If not, write to the Free Software Foundation, Inc., 51 Franklin Street,
* Fifth Floor, Boston, MA 02110-1301 USA
*
*/
// $ANTLR : "fm.g" -> "FullMaudeCommandsLexer.java"$
package es.upv.dsic.issi.moment.maudedaemon.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;
public class FullMaudeCommandsLexer extends antlr.CharScanner implements FullMaudeVocabTokenTypes, TokenStream
{
public FullMaudeCommandsLexer(InputStream in) {
this(new ByteBuffer(in));
}
public FullMaudeCommandsLexer(Reader in) {
this(new CharBuffer(in));
}
public FullMaudeCommandsLexer(InputBuffer ib) {
this(new LexerSharedInputState(ib));
}
public FullMaudeCommandsLexer(LexerSharedInputState state) {
super(state);
caseSensitiveLiterals = true;
setCaseSensitive(true);
literals = new Hashtable();
}
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 '(':
{
mPARENT_AB(true);
theRetToken=_returnToken;
break;
}
case ')':
{
mPARENT_CE(true);
theRetToken=_returnToken;
break;
}
default:
if ((_tokenSet_0.member(LA(1)))) {
mTODO_MENOS_LOS_COMENTARIOS(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();
_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 mTODO_MENOS_LOS_COMENTARIOS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = TODO_MENOS_LOS_COMENTARIOS;
int _saveIndex;
boolean synPredMatched15 = false;
if (((LA(1)=='*'))) {
int _m15 = mark();
synPredMatched15 = true;
inputState.guessing++;
try {
{
match("***");
}
}
catch (RecognitionException pe) {
synPredMatched15 = false;
}
rewind(_m15);
inputState.guessing--;
}
if ( synPredMatched15 ) {
mCOMENTARIO(false);
if ( inputState.guessing==0 ) {
_ttype = Token.SKIP;
}
}
else if ((_tokenSet_0.member(LA(1)))) {
mTODO(false);
if ( inputState.guessing==0 ) {
_ttype = TODO;
}
}
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 mCOMENTARIO(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = COMENTARIO;
int _saveIndex;
match("***");
{
_loop19:
do {
if ((_tokenSet_1.member(LA(1)))) {
{
match(_tokenSet_1);
}
}
else {
break _loop19;
}
} while (true);
}
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 mTODO(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = TODO;
int _saveIndex;
{
match(_tokenSet_0);
}
{
_loop24:
do {
if ((_tokenSet_2.member(LA(1)))) {
{
match(_tokenSet_2);
}
}
else {
break _loop24;
}
} 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;
switch ( LA(1)) {
case ' ':
{
match(' ');
break;
}
case '\t':
{
match('\t');
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 mNL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = NL;
int _saveIndex;
{
boolean synPredMatched29 = false;
if (((LA(1)=='\r'))) {
int _m29 = mark();
synPredMatched29 = true;
inputState.guessing++;
try {
{
match("\r\n");
}
}
catch (RecognitionException pe) {
synPredMatched29 = false;
}
rewind(_m29);
inputState.guessing--;
}
if ( synPredMatched29 ) {
match("\r\n");
}
else if ((LA(1)=='\r')) {
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 mPARENT_AB(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = PARENT_AB;
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 mPARENT_CE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = PARENT_CE;
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[8];
data[0]=-3298534883336L;
for (int i = 1; i<=3; i++) { data[i]=-1L; }
return data;
}
public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
private static final long[] mk_tokenSet_1() {
long[] data = new long[8];
data[0]=-9224L;
for (int i = 1; i<=3; i++) { data[i]=-1L; }
return data;
}
public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
private static final long[] mk_tokenSet_2() {
long[] data = new long[8];
data[0]=-7696581394440L;
for (int i = 1; i<=3; i++) { data[i]=-1L; }
return data;
}
public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
}