Class CpcLexer

java.lang.Object
  |
  +--antlr.CharScanner
        |
        +--CpcLexer
All Implemented Interfaces:
PseudocodiTokenTypes, antlr.TokenStream

public class CpcLexer
extends antlr.CharScanner
implements PseudocodiTokenTypes, antlr.TokenStream

Classe que incorpora l'analisis lèxica del compilador. La funció principal é analitzar el fitxer d'entrada i proveir de tokens a la classe CpcParser, que es comunica amb el constructor: CpcParser(antlr.TokenStream).

Version:
1.0 - Data: 18/06/2003
Author:
Carles Royan Salvatella

Field Summary
static antlr.collections.impl.BitSet _tokenSet_0
           
private static long[] _tokenSet_0_data_
           
static antlr.collections.impl.BitSet _tokenSet_1
           
private static long[] _tokenSet_1_data_
           
static antlr.collections.impl.BitSet _tokenSet_2
           
private static long[] _tokenSet_2_data_
           
static antlr.collections.impl.BitSet _tokenSet_3
           
private static long[] _tokenSet_3_data_
           
 
Fields inherited from class antlr.CharScanner
_returnToken, caseSensitive, caseSensitiveLiterals, commitToPath, EOF_CHAR, hashString, inputState, literals, saveConsumedInput, text, tokenObjectClass, traceDepth
 
Fields inherited from interface PseudocodiTokenTypes
ACCIO, ALGORISME, ALTRAMENT, ATRIBUTS, ATRIBUTS_CLASSE, BOOLEA, CARACTER, CAS, CERT, CLASS_DEF, CLASS_TYPE, CLASSE, COMA, COMENTARI1, COMENTARI2, CONST, CONSTRUCTOR, CORXET_DRET, CORXET_ESQ, CREAR, DE, DESTRUCTOR, DESTRUIR, DIV, DOSPUNTS, ELEMENTAL_TYPE, ENTER, EOF, ESCRIURE, ESCRIURELN, ESPAIS_BLANC, EXPONENT, FALGORISME, FALS, FATRIBUTS, FATRIBUTS_CLASSE, FCAS, FCLASSE, FCONST, FCONSTRUCTOR, FDESTRUCTOR, FER, FFUNCIO, FIMPLEMENTACIO, FINS, FINTERFICIE, FMENTRE, FMETODE, FMETODE_CLASSE, FMETODES, FMETODES_CLASSE, FPER, FSI, FUNCIO, FVAR, HERETA, IDENTIFICADOR, IMPLEMENTACIO, INTERFICIE, JO, LITERAL_CADENA, LITERAL_CARACTER, LLAVORS, LLEGIR, MEMBRE_CLASSE, MENTRE, METODE, METODE_CLASSE, METODES, METODES_CLASSE, MOD, NULL, NULL_TREE_LOOKAHEAD, NUMERO, NUMERO_ENTER, NUMERO_REAL, OP_ASSIGNACIO, OP_CAS, OP_DIFERENT, OP_DIV, OP_I, OP_IGUAL, OP_MGRAN, OP_MGRAN_IGUAL, OP_MPETIT, OP_MPETIT_IGUAL, OP_MULT, OP_NO, OP_O, OP_RESTA, OP_SUMA, PAREN_DRET, PAREN_ESQ, PAS, PER, PRIVATE, PUBLIC, PUNT, PUNTCOMA, REAL, RES, RETORNA, SALT_LINIA, SI, SUPER, SUPER_CLASS, TAULA, VAR
 
Constructor Summary
CpcLexer(antlr.InputBuffer ib)
           
CpcLexer(java.io.InputStream in)
           
CpcLexer(antlr.LexerSharedInputState state)
           
CpcLexer(java.io.Reader in)
           
 
Method Summary
 void mCOMA(boolean _createToken)
           
 void mCOMENTARI1(boolean _createToken)
          Comentari d'una linia: aquest excepcionalment no s'ignora
 void mCOMENTARI2(boolean _createToken)
          Comentari d'una o mes linies: es ignorat per l'anàlisi lèxica.
 void mCORXET_DRET(boolean _createToken)
           
 void mCORXET_ESQ(boolean _createToken)
           
 void mDOSPUNTS(boolean _createToken)
           
 void mESPAIS_BLANC(boolean _createToken)
          Espais en blanc i tabuladors: só ignorats per l'anàlisi lèxica.
protected  void mEXPONENT(boolean _createToken)
          Subregla per els exponents dels números
 void mIDENTIFICADOR(boolean _createToken)
          Regla que detecta un identificador.
 void mLITERAL_CADENA(boolean _createToken)
          Regla per a detectar els literals de tipus cadena
 void mLITERAL_CARACTER(boolean _createToken)
          Regla per a detectar els literals de tipus caràcter
 void mNUMERO(boolean _createToken)
          Regla que engloba tant els números enters com els decimals
 void mOP_ASSIGNACIO(boolean _createToken)
           
 void mOP_CAS(boolean _createToken)
           
 void mOP_DIFERENT(boolean _createToken)
           
 void mOP_DIV(boolean _createToken)
           
 void mOP_IGUAL(boolean _createToken)
           
 void mOP_MGRAN_IGUAL(boolean _createToken)
           
 void mOP_MGRAN(boolean _createToken)
           
 void mOP_MPETIT_IGUAL(boolean _createToken)
           
 void mOP_MPETIT(boolean _createToken)
           
 void mOP_MULT(boolean _createToken)
           
 void mOP_RESTA(boolean _createToken)
           
 void mOP_SUMA(boolean _createToken)
           
 void mPAREN_DRET(boolean _createToken)
           
 void mPAREN_ESQ(boolean _createToken)
           
 void mPUNT(boolean _createToken)
           
 void mPUNTCOMA(boolean _createToken)
           
 void mSALT_LINIA(boolean _createToken)
           
 antlr.Token nextToken()
           
 
Methods inherited from class antlr.CharScanner
append, append, commit, consume, consumeUntil, consumeUntil, getCaseSensitive, getCaseSensitiveLiterals, getColumn, getCommitToPath, getFilename, getInputBuffer, getInputState, getLine, getText, getTokenObject, LA, makeToken, mark, match, match, match, matchNot, matchRange, newline, panic, panic, reportError, reportError, reportWarning, resetText, rewind, setCaseSensitive, setColumn, setCommitToPath, setFilename, setInputState, setLine, setText, setTokenObjectClass, tab, testLiteralsTable, testLiteralsTable, toLower, traceIn, traceIndent, traceOut, uponEOF
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_tokenSet_0_data_

private static final long[] _tokenSet_0_data_

_tokenSet_0

public static final antlr.collections.impl.BitSet _tokenSet_0

_tokenSet_1_data_

private static final long[] _tokenSet_1_data_

_tokenSet_1

public static final antlr.collections.impl.BitSet _tokenSet_1

_tokenSet_2_data_

private static final long[] _tokenSet_2_data_

_tokenSet_2

public static final antlr.collections.impl.BitSet _tokenSet_2

_tokenSet_3_data_

private static final long[] _tokenSet_3_data_

_tokenSet_3

public static final antlr.collections.impl.BitSet _tokenSet_3
Constructor Detail

CpcLexer

public CpcLexer(java.io.InputStream in)

CpcLexer

public CpcLexer(java.io.Reader in)

CpcLexer

public CpcLexer(antlr.InputBuffer ib)

CpcLexer

public CpcLexer(antlr.LexerSharedInputState state)
Method Detail

nextToken

public antlr.Token nextToken()
                      throws antlr.TokenStreamException
Specified by:
nextToken in interface antlr.TokenStream
Specified by:
nextToken in class antlr.CharScanner
antlr.TokenStreamException

mIDENTIFICADOR

public final void mIDENTIFICADOR(boolean _createToken)
                          throws antlr.RecognitionException,
                                 antlr.CharStreamException,
                                 antlr.TokenStreamException
Regla que detecta un identificador. El text parsejat que es guarda en el token manté les maj/minusc.

antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mNUMERO

public final void mNUMERO(boolean _createToken)
                   throws antlr.RecognitionException,
                          antlr.CharStreamException,
                          antlr.TokenStreamException
Regla que engloba tant els números enters com els decimals

antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mPUNT

public final void mPUNT(boolean _createToken)
                 throws antlr.RecognitionException,
                        antlr.CharStreamException,
                        antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mEXPONENT

protected final void mEXPONENT(boolean _createToken)
                        throws antlr.RecognitionException,
                               antlr.CharStreamException,
                               antlr.TokenStreamException
Subregla per els exponents dels números

antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mLITERAL_CARACTER

public final void mLITERAL_CARACTER(boolean _createToken)
                             throws antlr.RecognitionException,
                                    antlr.CharStreamException,
                                    antlr.TokenStreamException
Regla per a detectar els literals de tipus caràcter

antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mLITERAL_CADENA

public final void mLITERAL_CADENA(boolean _createToken)
                           throws antlr.RecognitionException,
                                  antlr.CharStreamException,
                                  antlr.TokenStreamException
Regla per a detectar els literals de tipus cadena

antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mPAREN_ESQ

public final void mPAREN_ESQ(boolean _createToken)
                      throws antlr.RecognitionException,
                             antlr.CharStreamException,
                             antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mPAREN_DRET

public final void mPAREN_DRET(boolean _createToken)
                       throws antlr.RecognitionException,
                              antlr.CharStreamException,
                              antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mCORXET_ESQ

public final void mCORXET_ESQ(boolean _createToken)
                       throws antlr.RecognitionException,
                              antlr.CharStreamException,
                              antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mCORXET_DRET

public final void mCORXET_DRET(boolean _createToken)
                        throws antlr.RecognitionException,
                               antlr.CharStreamException,
                               antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mCOMA

public final void mCOMA(boolean _createToken)
                 throws antlr.RecognitionException,
                        antlr.CharStreamException,
                        antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mPUNTCOMA

public final void mPUNTCOMA(boolean _createToken)
                     throws antlr.RecognitionException,
                            antlr.CharStreamException,
                            antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mDOSPUNTS

public final void mDOSPUNTS(boolean _createToken)
                     throws antlr.RecognitionException,
                            antlr.CharStreamException,
                            antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mSALT_LINIA

public final void mSALT_LINIA(boolean _createToken)
                       throws antlr.RecognitionException,
                              antlr.CharStreamException,
                              antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mOP_SUMA

public final void mOP_SUMA(boolean _createToken)
                    throws antlr.RecognitionException,
                           antlr.CharStreamException,
                           antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mOP_RESTA

public final void mOP_RESTA(boolean _createToken)
                     throws antlr.RecognitionException,
                            antlr.CharStreamException,
                            antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mOP_MULT

public final void mOP_MULT(boolean _createToken)
                    throws antlr.RecognitionException,
                           antlr.CharStreamException,
                           antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mOP_DIV

public final void mOP_DIV(boolean _createToken)
                   throws antlr.RecognitionException,
                          antlr.CharStreamException,
                          antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mOP_IGUAL

public final void mOP_IGUAL(boolean _createToken)
                     throws antlr.RecognitionException,
                            antlr.CharStreamException,
                            antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mOP_DIFERENT

public final void mOP_DIFERENT(boolean _createToken)
                        throws antlr.RecognitionException,
                               antlr.CharStreamException,
                               antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mOP_MPETIT

public final void mOP_MPETIT(boolean _createToken)
                      throws antlr.RecognitionException,
                             antlr.CharStreamException,
                             antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mOP_MPETIT_IGUAL

public final void mOP_MPETIT_IGUAL(boolean _createToken)
                            throws antlr.RecognitionException,
                                   antlr.CharStreamException,
                                   antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mOP_MGRAN_IGUAL

public final void mOP_MGRAN_IGUAL(boolean _createToken)
                           throws antlr.RecognitionException,
                                  antlr.CharStreamException,
                                  antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mOP_MGRAN

public final void mOP_MGRAN(boolean _createToken)
                     throws antlr.RecognitionException,
                            antlr.CharStreamException,
                            antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mOP_ASSIGNACIO

public final void mOP_ASSIGNACIO(boolean _createToken)
                          throws antlr.RecognitionException,
                                 antlr.CharStreamException,
                                 antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mOP_CAS

public final void mOP_CAS(boolean _createToken)
                   throws antlr.RecognitionException,
                          antlr.CharStreamException,
                          antlr.TokenStreamException
antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mESPAIS_BLANC

public final void mESPAIS_BLANC(boolean _createToken)
                         throws antlr.RecognitionException,
                                antlr.CharStreamException,
                                antlr.TokenStreamException
Espais en blanc i tabuladors: só ignorats per l'anàlisi lèxica.

antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mCOMENTARI1

public final void mCOMENTARI1(boolean _createToken)
                       throws antlr.RecognitionException,
                              antlr.CharStreamException,
                              antlr.TokenStreamException
Comentari d'una linia: aquest excepcionalment no s'ignora

antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException

mCOMENTARI2

public final void mCOMENTARI2(boolean _createToken)
                       throws antlr.RecognitionException,
                              antlr.CharStreamException,
                              antlr.TokenStreamException
Comentari d'una o mes linies: es ignorat per l'anàlisi lèxica.

antlr.RecognitionException
antlr.CharStreamException
antlr.TokenStreamException