Class LexicalAnalyser

  • Direct Known Subclasses:
    Parser

    public class LexicalAnalyser
    extends java.lang.Object
    Lexical 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 ProtocolException getException​(java.lang.String errorMsg)
      Get the the protocol exception
      java.math.BigDecimal 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 string
      java.lang.String getWord()
      Get the 'word' string
      int nextToken()
      Find the next token
      char read()
      Reads the char and stops by '\r'
      java.lang.String readBlock()
      Read the context of the block
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LexicalAnalyser

        public LexicalAnalyser​(java.io.InputStream r)
        Constructor
        Parameters:
        r - - The input stream
    • Method Detail

      • getLookahead

        public int getLookahead()
                         throws java.io.IOException
        Get 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.IOException
        Read 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.IOException
        Reads 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.IOException
        Find 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