cz.cuni.amis.pogamut.usar2004.communication.messages.usarinfomessages
Class Yylex

Package class diagram package Yylex
java.lang.Object
  extended by cz.cuni.amis.pogamut.usar2004.communication.messages.usarinfomessages.Yylex
All Implemented Interfaces:
cz.cuni.amis.pogamut.base.communication.parser.impl.yylex.IYylex, IUSAR2004Yylex

public class Yylex
extends Object
implements IUSAR2004Yylex

This class is a scanner generated by JFlex 1.4.3 on 17.2.15 12:07 from the specification file D:/W/PogRel/trunk/project/Main/PogamutUSAR2004/src/main/jflex/usar2004Parser.jflex


Field Summary
protected  Object actObj
           
static String DELIMITERS_EXTENDED
           
static String DELIMITERS_STANDARD
           
static int DUMMY
           
protected  Map<Integer,Double> mapIntDouble
          Map for list of String, Double
protected  Map<Integer,Double> mapIntIDDouble
          Map for list of String, Double
static int MSG_CONF
           
static int MSG_DIE
           
static int MSG_GEO
           
static int MSG_MISSTA
          lexical states
static int MSG_NFO
           
static int MSG_RES
           
static int MSG_SEN
           
static int MSG_STA
           
protected  cz.cuni.amis.pogamut.base.communication.parser.impl.yylex.IYylexObserver observer
          observer for the yylex for reporting exceptions
protected  UnrealIdTranslator translator
          parser reference, this parser will be used for translation of UnrealID to IntID
protected  double udkTime
          time in the udk
static int YYEOF
          This character denotes the end of file
static int YYINITIAL
           
 
Constructor Summary
Yylex()
           
Yylex(InputStream in)
          Creates a new scanner.
Yylex(Reader in)
          Creates a new scanner There is also a java.io.InputStream version of this constructor.
 
Method Summary
protected  void addConfPair(String txt)
          Add pair of values starting from num token(tokens are separated by space) in 'txt'
protected  void addGeometry(String txt)
          Add four values of sensor/effecter geometry starting from num token(tokens are separated by space) in 'txt'
protected  void addRangeRange(String txt)
          Add a couple to RangeRanges starting from num token(tokens are separated by space) in 'txt'
protected  void addRanges(String txt)
          Add range of Double values starting from num token(tokens are separated by space) in 'txt'
protected  void addStaPair(String txt)
          Add pair of values starting from num token(tokens are separated by space) in 'txt'
protected  void addStartPose(String txt)
          Add range of Start Positions starting from num token(tokens are separated by space) in 'txt'
protected  void addTick(String txt)
          Add a couple to EncoderTicks starting from num token(tokens are separated by space) in 'txt'
protected  void addTouch(String txt)
          Add a couple to Touches starting from num token(tokens are separated by space) in 'txt'
protected  boolean booleanValue(String txt)
          Return a boolean from boolean token in txt.
 void close()
           
protected  double doubleValue(String txt)
          Return a double from num token in txt.
protected  void exceptionOccured(Exception e, String info)
          Logs the exception if observer present, or print it to System.out.
protected  double[] getDoubleDouble(String txt)
          Return a double (double[]{x,y}) starting from num token(tokens are separated by space) in 'txt'
protected  String getToken(String text, int num)
          Returns 'num'-th token from 'text' using DELIMITERS_STANDARD.
protected  String getToken(String text, String delimiters, int num)
          Returns 'num'-th token from 'text' using 'delimiters'.
protected  double[] getTriple(String txt)
          Return a triple (double[]{x,y,z}) starting from num token(tokens are separated by space) in 'txt'
protected  double[] getTripleDouble(String txt)
          Return a triple (double[]{x,y,z}) starting from num token(tokens are separated by space) in 'txt'
protected  int intValue(String txt)
          Return an integer from num token in txt.
protected  Latitude latitudeValue(String txt)
          Return a triple Longitude or Latitude consisted of int, double and char starting from num token(tokens are separated by space) in 'txt'
protected  cz.cuni.amis.pogamut.base3d.worldview.object.Location locationDoubleValue(String txt)
          Return a Location instance starting from num token(tokens are separated by space) in txt
protected  Longitude longitudeValue(String txt)
          Return a triple Longitude or Latitude consisted of int, double and char starting from num token(tokens are separated by space) in 'txt'
static void main(String[] argv)
          Runs the scanner on input files.
protected  OdometryPose odometryValue(String txt)
          Return a OdometryPose instance starting from num token(tokens are separated by space) in txt
protected  javax.vecmath.Point2d point2dDoubleValue(String txt)
          Return a Point2D instance starting from num token(tokens are separated by space) in txt
protected  javax.vecmath.Point3d point3dValue(String txt)
          Return a Point3d instance starting from num token(tokens are separated by space) in txt
protected  javax.vecmath.Point3d point3fValue(String txt)
          Return a Point3d instance starting from num token(tokens are separated by space) in txt
protected  javax.vecmath.Point4d point4fValue(String txt)
          Return a Point4d instance starting from num token(tokens are separated by space) in txt
protected  cz.cuni.amis.pogamut.base3d.worldview.object.Rotation rotationValue(String txt)
          Return a Rotation instance starting from num token(tokens are separated by space) in txt
 void setObserver(cz.cuni.amis.pogamut.base.communication.parser.impl.yylex.IYylexObserver observer)
           
 void setReader(Reader reader)
           
 void setTime(cz.cuni.amis.pogamut.base.communication.worldview.object.IWorldObject obj, double time)
           
 void setTranslator(UnrealIdTranslator translator)
          Set parser translating UnrealID to IntID.
protected  UnrealId stringIdValue(String txt)
          Returns UnrealId for parsed token.
protected  String stringValue(String txt)
          Returns string for parsed token.
protected  UnrealId unrealIdValue(String txt)
          Return an UnrealId instance from identificator token in txt.
protected  javax.vecmath.Vector3d vector3dValue(String txt)
          Return a Vector3d instance starting from num token(tokens are separated by space) in txt
protected  javax.vecmath.Vector3d vector3fValue(String txt)
          Return a Vector3d instance starting from num token(tokens are separated by space) in txt
protected  cz.cuni.amis.pogamut.base3d.worldview.object.Velocity velocityValue(String txt)
          Return a Velocity instance starting from num token(tokens are separated by space) in txt
protected  void warning(String info)
          Send the warning to observer or prints it to the console.
 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.
 cz.cuni.amis.pogamut.base.communication.messages.InfoMessage 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(Reader reader)
          Resets the scanner to read from a new input stream.
 int yystate()
          Returns the current lexical state.
 String yytext()
          Returns the text matched by the current regular expression.
 
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

MSG_MISSTA

public static final int MSG_MISSTA
lexical states

See Also:
Constant Field Values

MSG_CONF

public static final int MSG_CONF
See Also:
Constant Field Values

MSG_GEO

public static final int MSG_GEO
See Also:
Constant Field Values

MSG_STA

public static final int MSG_STA
See Also:
Constant Field Values

MSG_NFO

public static final int MSG_NFO
See Also:
Constant Field Values

MSG_RES

public static final int MSG_RES
See Also:
Constant Field Values

MSG_DIE

public static final int MSG_DIE
See Also:
Constant Field Values

YYINITIAL

public static final int YYINITIAL
See Also:
Constant Field Values

MSG_SEN

public static final int MSG_SEN
See Also:
Constant Field Values

DUMMY

public static final int DUMMY
See Also:
Constant Field Values

DELIMITERS_STANDARD

public static final String DELIMITERS_STANDARD
See Also:
Constant Field Values

DELIMITERS_EXTENDED

public static final String DELIMITERS_EXTENDED
See Also:
Constant Field Values

mapIntIDDouble

protected Map<Integer,Double> mapIntIDDouble
Map for list of String, Double


mapIntDouble

protected Map<Integer,Double> mapIntDouble
Map for list of String, Double


translator

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


observer

protected cz.cuni.amis.pogamut.base.communication.parser.impl.yylex.IYylexObserver observer
observer for the yylex for reporting exceptions


udkTime

protected double udkTime
time in the udk


actObj

protected Object actObj
Constructor Detail

Yylex

public Yylex()

Yylex

public Yylex(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

public Yylex(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

setReader

public void setReader(Reader reader)
Specified by:
setReader in interface cz.cuni.amis.pogamut.base.communication.parser.impl.yylex.IYylex

close

public void close()
           throws IOException
Specified by:
close in interface cz.cuni.amis.pogamut.base.communication.parser.impl.yylex.IYylex
Throws:
IOException

setObserver

public void setObserver(cz.cuni.amis.pogamut.base.communication.parser.impl.yylex.IYylexObserver observer)
Specified by:
setObserver in interface cz.cuni.amis.pogamut.base.communication.parser.impl.yylex.IYylex

setTranslator

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

Specified by:
setTranslator in interface IUSAR2004Yylex

setTime

public void setTime(cz.cuni.amis.pogamut.base.communication.worldview.object.IWorldObject obj,
                    double time)

exceptionOccured

protected void exceptionOccured(Exception e,
                                String info)
Logs the exception if observer present, or print it to System.out.

Does not throw the exception...

If exception 'e' is null, only info message is written to logs.

Parameters:
e -
info -

warning

protected void warning(String info)
Send the warning to observer or prints it to the console.


getToken

protected String getToken(String text,
                          String delimiters,
                          int num)
Returns 'num'-th token from 'text' using 'delimiters'.

Use only IFF you're getting only one token from 'text'.

Parameters:
text -
delimiters -
Returns:
String token

getToken

protected String getToken(String text,
                          int num)
Returns 'num'-th token from 'text' using DELIMITERS_STANDARD.

Use only IFF you're getting only one token from 'text'.

Parameters:
text -
Returns:
String token

intValue

protected int intValue(String txt)
Return an integer from num token in txt.

Integer token is expected to be 'second token' in the 'txt' using delimiters " {}".

Parameters:
txt - text of parameter
Returns:
Integer from given token.

doubleValue

protected double doubleValue(String txt)
Return a double from num token in txt.

Num token is expected to be 'second token' in the 'txt' using delimiters " {}".

Parameters:
txt - text of parameter
Returns:
double from given token.

addRangeRange

protected void addRangeRange(String txt)
Add a couple to RangeRanges starting from num token(tokens are separated by space) in 'txt'

Parameters:
txt - text of parameter

addTick

protected void addTick(String txt)
Add a couple to EncoderTicks starting from num token(tokens are separated by space) in 'txt'

Parameters:
txt - text of parameter

addTouch

protected void addTouch(String txt)
Add a couple to Touches starting from num token(tokens are separated by space) in 'txt'

Parameters:
txt - text of parameter

addRanges

protected void addRanges(String txt)
Add range of Double values starting from num token(tokens are separated by space) in 'txt'

Parameters:
txt - text of parameter

addGeometry

protected void addGeometry(String txt)
Add four values of sensor/effecter geometry starting from num token(tokens are separated by space) in 'txt'

Parameters:
txt - text of parameter

odometryValue

protected OdometryPose odometryValue(String txt)
Return a OdometryPose instance starting from num token(tokens are separated by space) in txt

Parameters:
txt - text of parameter
Returns:
OdometryPose from given token.

getTripleDouble

protected double[] getTripleDouble(String txt)
Return a triple (double[]{x,y,z}) starting from num token(tokens are separated by space) in 'txt'

Parameters:
txt - text of parameter
Returns:
Array of three doubles from given token.

getDoubleDouble

protected double[] getDoubleDouble(String txt)
Return a double (double[]{x,y}) starting from num token(tokens are separated by space) in 'txt'

Parameters:
txt - text of parameter
Returns:
Array of two doubles from given token.

longitudeValue

protected Longitude longitudeValue(String txt)
Return a triple Longitude or Latitude consisted of int, double and char starting from num token(tokens are separated by space) in 'txt'

Parameters:
txt - text of parameter
Returns:
Longitude from given token.

latitudeValue

protected Latitude latitudeValue(String txt)
Return a triple Longitude or Latitude consisted of int, double and char starting from num token(tokens are separated by space) in 'txt'

Parameters:
txt - text of parameter
Returns:
Latitude from given token.

vector3fValue

protected javax.vecmath.Vector3d vector3fValue(String txt)
Return a Vector3d instance starting from num token(tokens are separated by space) in txt

Parameters:
txt - text of parameter
Returns:
Vector3d from given token.

point3fValue

protected javax.vecmath.Point3d point3fValue(String txt)
Return a Point3d instance starting from num token(tokens are separated by space) in txt

Parameters:
txt - text of parameter
Returns:
Point3d from given token.

addConfPair

protected void addConfPair(String txt)
Add pair of values starting from num token(tokens are separated by space) in 'txt'

Parameters:
txt - text of parameter

addStaPair

protected void addStaPair(String txt)
Add pair of values starting from num token(tokens are separated by space) in 'txt'

Parameters:
txt - text of parameter

addStartPose

protected void addStartPose(String txt)
Add range of Start Positions starting from num token(tokens are separated by space) in 'txt'

Parameters:
txt - text of parameter

point4fValue

protected javax.vecmath.Point4d point4fValue(String txt)
Return a Point4d instance starting from num token(tokens are separated by space) in txt

Parameters:
txt - text of parameter
Returns:
Point4d from given token.

getTriple

protected double[] getTriple(String txt)
Return a triple (double[]{x,y,z}) starting from num token(tokens are separated by space) in 'txt'

Parameters:
txt - text of parameter
Returns:
Array of three doubles from given token.

locationDoubleValue

protected cz.cuni.amis.pogamut.base3d.worldview.object.Location locationDoubleValue(String txt)
Return a Location instance starting from num token(tokens are separated by space) in txt

Parameters:
txt - text of parameter
Returns:
Location from given token.

point2dDoubleValue

protected javax.vecmath.Point2d point2dDoubleValue(String txt)
Return a Point2D instance starting from num token(tokens are separated by space) in txt

Parameters:
txt - text of parameter
Returns:
Point2D from given token.

velocityValue

protected cz.cuni.amis.pogamut.base3d.worldview.object.Velocity velocityValue(String txt)
Return a Velocity instance starting from num token(tokens are separated by space) in txt

Parameters:
txt - text of parameter
Returns:
Velocity from given token.

rotationValue

protected cz.cuni.amis.pogamut.base3d.worldview.object.Rotation rotationValue(String txt)
Return a Rotation instance starting from num token(tokens are separated by space) in txt

Parameters:
txt - text of parameter
Returns:
Rotation from given token.

point3dValue

protected javax.vecmath.Point3d point3dValue(String txt)
Return a Point3d instance starting from num token(tokens are separated by space) in txt

Parameters:
txt - text of parameter
Returns:
Point3d from given token.

vector3dValue

protected javax.vecmath.Vector3d vector3dValue(String txt)
Return a Vector3d instance starting from num token(tokens are separated by space) in txt

Parameters:
txt - text of parameter
Returns:
Vector3d from given token.

stringValue

protected String stringValue(String txt)
Returns string for parsed token.

Parameters:
txt - text of parameter
Returns:
String from given token.

stringIdValue

protected UnrealId stringIdValue(String txt)
Returns UnrealId for parsed token.

Parameters:
txt - text of parameter
Returns:
StringId from given token.

booleanValue

protected boolean booleanValue(String txt)
Return a boolean from boolean token in txt.

Boolean token is expected to be 'second token' in the 'txt' using delimiters " {}".

Parameters:
txt - text of parameter
Returns:
Boolean from given token.

unrealIdValue

protected UnrealId unrealIdValue(String txt)
Return an UnrealId instance from identificator token in txt.

Boolean token is expected to be 'second token' in the 'txt' using delimiters " {}".

Parameters:
txt - text of parameter
Returns:
UnrealId from given token.

yyclose

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

Throws:
IOException

yyreset

public final void yyreset(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 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.


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 cz.cuni.amis.pogamut.base.communication.messages.InfoMessage yylex()
                                                                   throws IOException
Resumes scanning until the next regular expression is matched, the end of input is encountered or an I/O-Error occurs.

Specified by:
yylex in interface cz.cuni.amis.pogamut.base.communication.parser.impl.yylex.IYylex
Returns:
the next token
Throws:
IOException - if any I/O-Error occurs

main

public static void main(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.


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.