cz.cuni.pogamut.Parser
Class Yylex

java.lang.Object
  extended by cz.cuni.pogamut.Parser.Yylex

 class Yylex
extends java.lang.Object

This class is a scanner generated by JFlex 1.4.1 on 29.8.08 21:33 from the specification file bot_msg.flex


Field Summary
protected  java.lang.Object actObj
           
static int EINV
           
static int GAM_DOM_POINTS
           
static int IINV
           
static int LIST_INT_DOUBLE
           
static int LIST_NAV
           
static int LIST_UNREALID_DOUBLE
           
protected  java.util.Map<java.lang.Integer,java.lang.Double> mapIntDouble
          Map for list of String, Double
protected  java.util.Map<java.lang.Integer,java.lang.Double> mapIntIDDouble
          Map for list of String, Double
static int MSG_ADG
           
static int MSG_AIN
           
static int MSG_ALIVE
           
static int MSG_ATR
           
static int MSG_BEG
           
static int MSG_BMP
           
static int MSG_CONFCH
           
static int MSG_CWP
           
static int MSG_DAM
           
static int MSG_DIE
           
static int MSG_DOM
           
static int MSG_END
           
static int MSG_FAL
           
static int MSG_FIN
           
static int MSG_FLG
           
static int MSG_FTR
           
static int MSG_GAM
           
static int MSG_HELLO_BOT
           
static int MSG_HELLO_CONTROL_SERVER
           
static int MSG_HIT
           
static int MSG_HRN
           
static int MSG_HRP
           
static int MSG_IINV
          lexical states
static int MSG_INAV
           
static int MSG_INV
           
static int MSG_JOIN
           
static int MSG_KIL
           
static int MSG_LEFT
           
static int MSG_MAP
           
static int MSG_MAPCHANGE
           
static int MSG_MOV
           
static int MSG_NAV
           
static int MSG_NFO
           
static int MSG_PLR
           
static int MSG_PRJ
           
static int MSG_PTH
           
static int MSG_RCH
           
static int MSG_SEE
           
static int MSG_SLF
           
static int MSG_TRC
           
static int MSG_VMS
           
static int MSG_VMT
           
static int MSG_WAL
           
static int MSG_ZCB
           
static int MSG_ZCF
           
static int MSG_ZCH
           
protected  boolean navList
           
static int NEIGH_LIST
           
protected  java.util.ArrayList<NeighNav> neighList
           
protected  NeighNav neighNav
           
protected  Parser parser
          parser reference, this parser will be used for translation of UnrealID to IntID
static int SINV
           
private  int[] stack
           
private  int stack_pos
           
private  java.lang.String tempStr
           
private  int yycolumn
          the number of characters from the last newline up to the start of the matched text
static int YYEOF
          This character denotes the end of file
private  int yychar
          the number of characters up to the start of the matched text
static int YYINITIAL
           
private  int yyline
          number of newlines encountered up to the start of the matched text
private static int[] ZZ_ACTION
          Translates DFA states to action switch labels.
private static java.lang.String ZZ_ACTION_PACKED_0
           
private static int[] ZZ_ATTRIBUTE
          ZZ_ATTRIBUTE[aState] contains the attributes of state aState
private static java.lang.String ZZ_ATTRIBUTE_PACKED_0
           
private static int ZZ_BUFFERSIZE
          initial size of the lookahead buffer
private static char[] ZZ_CMAP
          Translates characters to character classes
private static java.lang.String[] ZZ_ERROR_MSG
           
private static int ZZ_NO_MATCH
           
private static int ZZ_PUSHBACK_2BIG
           
private static int[] ZZ_ROWMAP
          Translates a state to a row index in the transition table
private static java.lang.String ZZ_ROWMAP_PACKED_0
           
private static int[] ZZ_TRANS
          The transition table of the DFA
private static java.lang.String ZZ_TRANS_PACKED_0
           
private static int ZZ_UNKNOWN_ERROR
           
private  boolean zzAtBOL
          zzAtBOL == true <=> the scanner is currently at the beginning of a line
private  boolean zzAtEOF
          zzAtEOF == true <=> the scanner is at the EOF
private  char[] zzBuffer
          this buffer contains the current text to be matched and is the source of the yytext() string
private  int zzCurrentPos
          the current text position in the buffer
private  int zzEndRead
          endRead marks the last character in the buffer, that has been read from input
private  int zzLexicalState
          the current lexical state
private  int zzMarkedPos
          the textposition at the last accepting state
private  int zzPushbackPos
          the textposition at the last state to be included in yytext
private  java.io.Reader zzReader
          the input device
private  int zzStartRead
          startRead marks the beginning of the yytext() string in the buffer
private  int zzState
          the current state of the DFA
 
Constructor Summary
Yylex(java.io.InputStream in)
          Creates a new scanner.
Yylex(java.io.Reader in)
          Creates a new scanner There is also a java.io.InputStream version of this constructor.
 
Method Summary
protected  boolean getBoolean(java.lang.String txt, int num)
          Return a boolean of this parameter.
protected  double getDouble(java.lang.String txt, int num)
          Return a double from num token in txt
protected  java.lang.String getIdent(java.lang.String txt, int num)
          Return a string from num token in txt.
protected  int getInt(java.lang.String txt, int num)
          Return an integer from num token in txt
protected  java.lang.String getText(java.lang.String txt, int num)
          Return text from first after space number num.
protected  Triple getTriple(java.lang.String txt, int num)
          Return a triple starting from num token(tokens are separated by space) in txt
static void main(java.lang.String[] argv)
          Runs the scanner on input files.
 void setParser(Parser p)
          Set parser translating UnrealID to IntID.
private  void state_go(int state)
          Change state to state and push original state to stack, so parser can return in state_return
private  void state_return()
          Return to previous state.
protected  int unrealID2intID(java.lang.String unrealID)
          Translate UnrealID to IntID
 void yybegin(int newState)
          Enters a new lexical state
 void yyclose()
          Closes the input stream.
 char yycharat(int pos)
          Returns the character at position pos from the matched text.
 int yylength()
          Returns the length of the matched text region.
 MessageObject yylex()
          Resumes scanning until the next regular expression is matched, the end of input is encountered or an I/O-Error occurs.
 void yypushback(int number)
          Pushes the specified amount of characters back into the input stream.
 void yyreset(java.io.Reader reader)
          Resets the scanner to read from a new input stream.
 int yystate()
          Returns the current lexical state.
 java.lang.String yytext()
          Returns the text matched by the current regular expression.
private  boolean zzRefill()
          Refills the input buffer.
private  void zzScanError(int errorCode)
          Reports an error that occured while scanning.
private static int[] zzUnpackAction()
           
private static int zzUnpackAction(java.lang.String packed, int offset, int[] result)
           
private static int[] zzUnpackAttribute()
           
private static int zzUnpackAttribute(java.lang.String packed, int offset, int[] result)
           
private static int[] zzUnpackRowMap()
           
private static int zzUnpackRowMap(java.lang.String packed, int offset, int[] result)
           
private static int[] zzUnpackTrans()
           
private static int zzUnpackTrans(java.lang.String packed, int offset, int[] result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

YYEOF

public static final int YYEOF
This character denotes the end of file

See Also:
Constant Field Values

ZZ_BUFFERSIZE

private static final int ZZ_BUFFERSIZE
initial size of the lookahead buffer

See Also:
Constant Field Values

MSG_IINV

public static final int MSG_IINV
lexical states

See Also:
Constant Field Values

LIST_INT_DOUBLE

public static final int LIST_INT_DOUBLE
See Also:
Constant Field Values

LIST_UNREALID_DOUBLE

public static final int LIST_UNREALID_DOUBLE
See Also:
Constant Field Values

MSG_ADG

public static final int MSG_ADG
See Also:
Constant Field Values

MSG_DOM

public static final int MSG_DOM
See Also:
Constant Field Values

MSG_PTH

public static final int MSG_PTH
See Also:
Constant Field Values

MSG_MAPCHANGE

public static final int MSG_MAPCHANGE
See Also:
Constant Field Values

IINV

public static final int IINV
See Also:
Constant Field Values

MSG_DIE

public static final int MSG_DIE
See Also:
Constant Field Values

MSG_FTR

public static final int MSG_FTR
See Also:
Constant Field Values

MSG_HELLO_CONTROL_SERVER

public static final int MSG_HELLO_CONTROL_SERVER
See Also:
Constant Field Values

SINV

public static final int SINV
See Also:
Constant Field Values

MSG_KIL

public static final int MSG_KIL
See Also:
Constant Field Values

MSG_GAM

public static final int MSG_GAM
See Also:
Constant Field Values

MSG_LEFT

public static final int MSG_LEFT
See Also:
Constant Field Values

YYINITIAL

public static final int YYINITIAL
See Also:
Constant Field Values

MSG_CONFCH

public static final int MSG_CONFCH
See Also:
Constant Field Values

MSG_TRC

public static final int MSG_TRC
See Also:
Constant Field Values

MSG_AIN

public static final int MSG_AIN
See Also:
Constant Field Values

NEIGH_LIST

public static final int NEIGH_LIST
See Also:
Constant Field Values

MSG_END

public static final int MSG_END
See Also:
Constant Field Values

MSG_SLF

public static final int MSG_SLF
See Also:
Constant Field Values

MSG_NAV

public static final int MSG_NAV
See Also:
Constant Field Values

MSG_JOIN

public static final int MSG_JOIN
See Also:
Constant Field Values

MSG_RCH

public static final int MSG_RCH
See Also:
Constant Field Values

MSG_FAL

public static final int MSG_FAL
See Also:
Constant Field Values

MSG_WAL

public static final int MSG_WAL
See Also:
Constant Field Values

EINV

public static final int EINV
See Also:
Constant Field Values

MSG_ZCH

public static final int MSG_ZCH
See Also:
Constant Field Values

MSG_HIT

public static final int MSG_HIT
See Also:
Constant Field Values

MSG_ZCF

public static final int MSG_ZCF
See Also:
Constant Field Values

MSG_CWP

public static final int MSG_CWP
See Also:
Constant Field Values

MSG_ZCB

public static final int MSG_ZCB
See Also:
Constant Field Values

MSG_MAP

public static final int MSG_MAP
See Also:
Constant Field Values

MSG_VMT

public static final int MSG_VMT
See Also:
Constant Field Values

MSG_VMS

public static final int MSG_VMS
See Also:
Constant Field Values

MSG_HRP

public static final int MSG_HRP
See Also:
Constant Field Values

MSG_PLR

public static final int MSG_PLR
See Also:
Constant Field Values

MSG_HRN

public static final int MSG_HRN
See Also:
Constant Field Values

GAM_DOM_POINTS

public static final int GAM_DOM_POINTS
See Also:
Constant Field Values

MSG_BEG

public static final int MSG_BEG
See Also:
Constant Field Values

MSG_DAM

public static final int MSG_DAM
See Also:
Constant Field Values

MSG_INAV

public static final int MSG_INAV
See Also:
Constant Field Values

MSG_ALIVE

public static final int MSG_ALIVE
See Also:
Constant Field Values

MSG_SEE

public static final int MSG_SEE
See Also:
Constant Field Values

MSG_INV

public static final int MSG_INV
See Also:
Constant Field Values

MSG_ATR

public static final int MSG_ATR
See Also:
Constant Field Values

MSG_PRJ

public static final int MSG_PRJ
See Also:
Constant Field Values

LIST_NAV

public static final int LIST_NAV
See Also:
Constant Field Values

MSG_FIN

public static final int MSG_FIN
See Also:
Constant Field Values

MSG_NFO

public static final int MSG_NFO
See Also:
Constant Field Values

MSG_FLG

public static final int MSG_FLG
See Also:
Constant Field Values

MSG_BMP

public static final int MSG_BMP
See Also:
Constant Field Values

MSG_MOV

public static final int MSG_MOV
See Also:
Constant Field Values

MSG_HELLO_BOT

public static final int MSG_HELLO_BOT
See Also:
Constant Field Values

ZZ_CMAP

private static final char[] ZZ_CMAP
Translates characters to character classes


ZZ_ACTION

private static final int[] ZZ_ACTION
Translates DFA states to action switch labels.


ZZ_ACTION_PACKED_0

private static final java.lang.String ZZ_ACTION_PACKED_0
See Also:
Constant Field Values

ZZ_ROWMAP

private static final int[] ZZ_ROWMAP
Translates a state to a row index in the transition table


ZZ_ROWMAP_PACKED_0

private static final java.lang.String ZZ_ROWMAP_PACKED_0
See Also:
Constant Field Values

ZZ_TRANS

private static final int[] ZZ_TRANS
The transition table of the DFA


ZZ_TRANS_PACKED_0

private static final java.lang.String ZZ_TRANS_PACKED_0
See Also:
Constant Field Values

ZZ_UNKNOWN_ERROR

private static final int ZZ_UNKNOWN_ERROR
See Also:
Constant Field Values

ZZ_NO_MATCH

private static final int ZZ_NO_MATCH
See Also:
Constant Field Values

ZZ_PUSHBACK_2BIG

private static final int ZZ_PUSHBACK_2BIG
See Also:
Constant Field Values

ZZ_ERROR_MSG

private static final java.lang.String[] ZZ_ERROR_MSG

ZZ_ATTRIBUTE

private static final int[] ZZ_ATTRIBUTE
ZZ_ATTRIBUTE[aState] contains the attributes of state aState


ZZ_ATTRIBUTE_PACKED_0

private static final java.lang.String ZZ_ATTRIBUTE_PACKED_0
See Also:
Constant Field Values

zzReader

private java.io.Reader zzReader
the input device


zzState

private int zzState
the current state of the DFA


zzLexicalState

private int zzLexicalState
the current lexical state


zzBuffer

private char[] zzBuffer
this buffer contains the current text to be matched and is the source of the yytext() string


zzMarkedPos

private int zzMarkedPos
the textposition at the last accepting state


zzPushbackPos

private int zzPushbackPos
the textposition at the last state to be included in yytext


zzCurrentPos

private int zzCurrentPos
the current text position in the buffer


zzStartRead

private int zzStartRead
startRead marks the beginning of the yytext() string in the buffer


zzEndRead

private int zzEndRead
endRead marks the last character in the buffer, that has been read from input


yyline

private int yyline
number of newlines encountered up to the start of the matched text


yychar

private int yychar
the number of characters up to the start of the matched text


yycolumn

private int yycolumn
the number of characters from the last newline up to the start of the matched text


zzAtBOL

private boolean zzAtBOL
zzAtBOL == true <=> the scanner is currently at the beginning of a line


zzAtEOF

private boolean zzAtEOF
zzAtEOF == true <=> the scanner is at the EOF


neighNav

protected NeighNav neighNav

neighList

protected java.util.ArrayList<NeighNav> neighList

navList

protected boolean navList

mapIntIDDouble

protected java.util.Map<java.lang.Integer,java.lang.Double> mapIntIDDouble
Map for list of String, Double


mapIntDouble

protected java.util.Map<java.lang.Integer,java.lang.Double> mapIntDouble
Map for list of String, Double


parser

protected Parser parser
parser reference, this parser will be used for translation of UnrealID to IntID


stack

private int[] stack

stack_pos

private int stack_pos

tempStr

private java.lang.String tempStr

actObj

protected java.lang.Object actObj
Constructor Detail

Yylex

Yylex(java.io.Reader in)
Creates a new scanner There is also a java.io.InputStream version of this constructor.

Parameters:
in - the java.io.Reader to read input from.

Yylex

Yylex(java.io.InputStream in)
Creates a new scanner. There is also java.io.Reader version of this constructor.

Parameters:
in - the java.io.Inputstream to read input from.
Method Detail

zzUnpackAction

private static int[] zzUnpackAction()

zzUnpackAction

private static int zzUnpackAction(java.lang.String packed,
                                  int offset,
                                  int[] result)

zzUnpackRowMap

private static int[] zzUnpackRowMap()

zzUnpackRowMap

private static int zzUnpackRowMap(java.lang.String packed,
                                  int offset,
                                  int[] result)

zzUnpackTrans

private static int[] zzUnpackTrans()

zzUnpackTrans

private static int zzUnpackTrans(java.lang.String packed,
                                 int offset,
                                 int[] result)

zzUnpackAttribute

private static int[] zzUnpackAttribute()

zzUnpackAttribute

private static int zzUnpackAttribute(java.lang.String packed,
                                     int offset,
                                     int[] result)

getInt

protected int getInt(java.lang.String txt,
                     int num)
Return an integer from num token in txt

Parameters:
txt - text of parameter
num - number of token with integer starting from zero

getDouble

protected double getDouble(java.lang.String txt,
                           int num)
Return a double from num token in txt

Parameters:
txt - text of parameter
num - number of token with double starting from zero

getIdent

protected java.lang.String getIdent(java.lang.String txt,
                                    int num)
Return a string from num token in txt. String ends after encountering "{" or " " or "}"

Parameters:
txt - text of parameter
num - number of token with string starting from zero

getText

protected java.lang.String getText(java.lang.String txt,
                                   int num)
Return text from first after space number num. Text will continue untill first occurance of }

Parameters:
txt - text of parameter
num - number of spaces that can preceder text

getTriple

protected Triple getTriple(java.lang.String txt,
                           int num)
Return a triple starting from num token(tokens are separated by space) in txt

Parameters:
txt - text of parameter
num - number of token with double starting from zero

getBoolean

protected boolean getBoolean(java.lang.String txt,
                             int num)
Return a boolean of this parameter. If error, write an exception and return false.

Parameters:
txt - text of parameter
num - number of token with double starting from zero. Tokens are separated by " {},"

setParser

public void setParser(Parser p)
Set parser translating UnrealID to IntID. This function should be called after constructor, I dont know how to define constructor, so this will do.


unrealID2intID

protected int unrealID2intID(java.lang.String unrealID)
Translate UnrealID to IntID

See Also:
Parser

state_go

private void state_go(int state)
Change state to state and push original state to stack, so parser can return in state_return


state_return

private void state_return()
Return to previous state.


zzRefill

private boolean zzRefill()
                  throws java.io.IOException
Refills the input buffer.

Returns:
false, iff there was new input.
Throws:
java.io.IOException - if any I/O-Error occurs

yyclose

public final void yyclose()
                   throws java.io.IOException
Closes the input stream.

Throws:
java.io.IOException

yyreset

public final void yyreset(java.io.Reader reader)
Resets the scanner to read from a new input stream. Does not close the old reader. All internal variables are reset, the old input stream cannot be reused (internal buffer is discarded and lost). Lexical state is set to ZZ_INITIAL.

Parameters:
reader - the new input stream

yystate

public final int yystate()
Returns the current lexical state.


yybegin

public final void yybegin(int newState)
Enters a new lexical state

Parameters:
newState - the new lexical state

yytext

public final java.lang.String yytext()
Returns the text matched by the current regular expression.


yycharat

public final char yycharat(int pos)
Returns the character at position pos from the matched text. It is equivalent to yytext().charAt(pos), but faster

Parameters:
pos - the position of the character to fetch. A value from 0 to yylength()-1.
Returns:
the character at position pos

yylength

public final int yylength()
Returns the length of the matched text region.


zzScanError

private void zzScanError(int errorCode)
Reports an error that occured while scanning. In a wellformed scanner (no or only correct usage of yypushback(int) and a match-all fallback rule) this method will only be called with things that "Can't Possibly Happen". If this method is called, something is seriously wrong (e.g. a JFlex bug producing a faulty scanner etc.). Usual syntax/scanner level error handling should be done in error fallback rules.

Parameters:
errorCode - the code of the errormessage to display

yypushback

public void yypushback(int number)
Pushes the specified amount of characters back into the input stream. They will be read again by then next call of the scanning method

Parameters:
number - the number of characters to be read again. This number must not be greater than yylength()!

yylex

public MessageObject yylex()
                    throws java.io.IOException
Resumes scanning until the next regular expression is matched, the end of input is encountered or an I/O-Error occurs.

Returns:
the next token
Throws:
java.io.IOException - if any I/O-Error occurs

main

public static void main(java.lang.String[] argv)
Runs the scanner on input files. This is a standalone scanner, it will print any unmatched text to System.out unchanged.

Parameters:
argv - the command line, contains the filenames to run the scanner on.