Package com.uppaal.engine
Class LexicalAnalyser
- java.lang.Object
-
- com.uppaal.engine.LexicalAnalyser
-
- Direct Known Subclasses:
Parser
public class LexicalAnalyser extends java.lang.ObjectLexical analyzer used by EngineStub. It generates tokens from an InputStream. You most likely do not want to use this directly.
-
-
Constructor Summary
Constructors Constructor Description LexicalAnalyser(java.io.InputStream r)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ProtocolExceptiongetException(java.lang.String errorMsg)Get the the protocol exceptionjava.math.BigDecimalgetFloat()Get the float value of 'word'intgetIntValue()Get the integer value 'word'intgetLookahead()Get the value 'lookahead'longgetValue()Get the value the stringjava.lang.StringgetWord()Get the 'word' stringintnextToken()Find the next tokencharread()Reads the char and stops by '\r'java.lang.StringreadBlock()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
-
-
Method Detail
-
getLookahead
public int getLookahead() throws java.io.IOExceptionGet the value 'lookahead'- Returns:
- lookahead - The look ahead value
- Throws:
java.io.IOException- engine crash or problem in communication.
-
getWord
public java.lang.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 java.math.BigDecimal getFloat()
Get the float value of 'word'- Returns:
- The parsed value
-
readBlock
public java.lang.String readBlock() throws java.io.IOExceptionRead the context of the block- Returns:
- word - The context
- Throws:
java.io.IOException- engine crash or problem in communication.
-
read
public char read() throws java.io.IOExceptionReads the char and stops by '\r'- Returns:
- The char
- Throws:
java.io.IOException- engine crash or problem in communication.
-
nextToken
public int nextToken() throws java.io.IOExceptionFind the next token- Returns:
- The token integer
- Throws:
java.io.IOException- engine crash or problem in communication.
-
getException
protected ProtocolException getException(java.lang.String errorMsg)
Get the the protocol exception- Parameters:
errorMsg- - The error message string- Returns:
- - The protocol exception
-
-