Package com.uppaal.engine
Class LexicalAnalyser
java.lang.Object
com.uppaal.engine.LexicalAnalyser
- Direct Known Subclasses:
Parser
public class LexicalAnalyser extends Object
Lexical analyzer used by EngineStub.
It generates tokens from an InputStream. You most likely do not
want to use this directly.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description LexicalAnalyser(InputStream r)
Constructor -
Method Summary
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 Details
-
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 Details
-
LexicalAnalyser
Constructor- Parameters:
r
- - The input stream
-
-
Method Details
-
getLookahead
Get the value 'lookahead'- Returns:
- lookahead - The look ahead value
- Throws:
IOException
- engine crash or problem in communication.
-
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
Get the float value of 'word'- Returns:
- The parsed value
-
readBlock
Read the context of the block- Returns:
- word - The context
- Throws:
IOException
- engine crash or problem in communication.
-
read
Reads the char and stops by '\r'- Returns:
- The char
- Throws:
IOException
- engine crash or problem in communication.
-
nextToken
Find the next token- Returns:
- The token integer
- Throws:
IOException
- engine crash or problem in communication.
-
getException
Get the the protocol exception- Parameters:
errorMsg
- - The error message string- Returns:
- - The protocol exception
-