Class Parser.SizeBase

  • Enclosing class:
    Parser

    public static class Parser.SizeBase
    extends java.lang.Object
    Parser.SizeBase encapsulates literal size/base information.
    • Constructor Summary

      Constructors 
      Constructor Description
      SizeBase()
      Constructs a default size/base object.
      SizeBase​(int bitSize, boolean isSigned, int base)
      Constructs a size/base object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getBase()
      Returns the number system of the literal.
      int getBitSize()
      Returns the bit size of the literal.
      int getBitsPerDigit()
      Returns the number of bits per digit.
      boolean isSigned()
      Returns the signed/unsigned flag of the literal.
      boolean isUndefined()
      Checks whether size/base information is undefined.
      void setBase​(int base)
      Sets the number system of the literal.
      void setBitSize​(int bitSize)
      Sets the bit size of the literal.
      void setSigned​(boolean isSigned)
      Sets the signed/unsigned flag of the literal.
      • Methods inherited from class java.lang.Object

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

      • SizeBase

        public SizeBase​(int bitSize,
                        boolean isSigned,
                        int base)
        Constructs a size/base object.
        Parameters:
        bitSize - the bit size of the literal.
        isSigned - the signed/unsigned flag.
        base - the number system of the literal (2, 8, 10 or 16).
      • SizeBase

        public SizeBase()
        Constructs a default size/base object.
    • Method Detail

      • getBitSize

        public int getBitSize()
        Returns the bit size of the literal.
        Returns:
        the bit size.
      • setBitSize

        public void setBitSize​(int bitSize)
        Sets the bit size of the literal.
        Parameters:
        bitSize - the bit size to be set.
      • isSigned

        public boolean isSigned()
        Returns the signed/unsigned flag of the literal.
        Returns:
        true iff the literal is signed.
      • setSigned

        public void setSigned​(boolean isSigned)
        Sets the signed/unsigned flag of the literal.
        Parameters:
        isSigned - the flag to be set.
      • getBase

        public int getBase()
        Returns the number system of the literal.
        Returns:
        the number system.
      • setBase

        public void setBase​(int base)
        Sets the number system of the literal.
        Parameters:
        base - the number system to be set.
      • getBitsPerDigit

        public int getBitsPerDigit()
        Returns the number of bits per digit.
        Returns:
        the number of bits per digit.
      • isUndefined

        public boolean isUndefined()
        Checks whether size/base information is undefined.
        Returns:
        true iff the information is undefined.