Class 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.
    • 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