Package com.uppaal.engine
Class LexicalAnalyser
- java.lang.Object
-
- com.uppaal.engine.LexicalAnalyser
-
-
Constructor Summary
Constructors Constructor Description LexicalAnalyser(InputStream r)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ProtocolException
getException(String errorMsg)
Get the the protocol exceptionBigDecimal
getFloat()
Get the float value of 'word'int
getIntValue()
Get the integer value 'word'int
getLookahead()
Get the value 'lookahead'long
getValue()
Get the value the stringString
getWord()
Get the 'word' stringint
nextToken()
Find the next tokenchar
read()
Reads the char and stops by '\r'String
readBlock()
Read the context of the block
-
-
-
Field Detail
-
NEWLINE
public static final int NEWLINE
- See Also:
- Constant Field Values
-
END
public static final int END
- See Also:
- Constant Field Values
-
WORD
public static final int WORD
- See Also:
- Constant Field Values
-
BLOCK
public static final int BLOCK
- See Also:
- Constant Field Values
-
INT
public static final int INT
- See Also:
- Constant Field Values
-
FLOAT
public static final int FLOAT
- See Also:
- Constant Field Values
-
LONG
public static final int LONG
- See Also:
- Constant Field Values
-
NONE
public static final int NONE
- See Also:
- Constant Field Values
-
PARTIAL_END
public static final int PARTIAL_END
- See Also:
- Constant Field Values
-
ERROR_EOL
public static final int ERROR_EOL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LexicalAnalyser
public LexicalAnalyser(InputStream r)
Constructor- Parameters:
r
- - The input stream
-
-
Method Detail
-
getLookahead
public int getLookahead() throws IOException
Get the value 'lookahead'- Returns:
- lookahead - The look ahead value
- Throws:
IOException
- engine crash or problem in communication.
-
getWord
public String getWord()
Get the 'word' string- Returns:
- The word string
-
getIntValue
public int getIntValue()
Get the integer value 'word'- Returns:
- The initial word value
-
getValue
public long getValue()
Get the value the string- Returns:
- The long value of the word
-
getFloat
public BigDecimal getFloat()
Get the float value of 'word'- Returns:
- The parsed value
-
readBlock
public String readBlock() throws IOException
Read the context of the block- Returns:
- word - The context
- Throws:
IOException
- engine crash or problem in communication.
-
read
public char read() throws IOException
Reads the char and stops by '\r'- Returns:
- The char
- Throws:
IOException
- engine crash or problem in communication.
-
nextToken
public int nextToken() throws IOException
Find the next token- Returns:
- The token integer
- Throws:
IOException
- engine crash or problem in communication.
-
getException
protected ProtocolException getException(String errorMsg)
Get the the protocol exception- Parameters:
errorMsg
- - The error message string- Returns:
- - The protocol exception
-
-