Class Token

  • All Implemented Interfaces:
    java.lang.CharSequence, java.lang.Comparable<net.morimekta.util.CharSlice>, net.morimekta.util.Stringable

    public class Token
    extends net.morimekta.util.CharSlice
    Pretty token.
    • Constructor Detail

      • Token

        public Token​(char[] fb,
                     int off,
                     int len,
                     int lineNo,
                     int linePos)
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class net.morimekta.util.CharSlice
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class net.morimekta.util.CharSlice
      • getLineNo

        public int getLineNo()
      • getLinePos

        public int getLinePos()
      • isSymbol

        public boolean isSymbol​(char symbol)
      • isStringLiteral

        public boolean isStringLiteral()
      • isIdentifier

        public boolean isIdentifier()
      • isQualifiedIdentifier

        public boolean isQualifiedIdentifier()
      • isDoubleQualifiedIdentifier

        public boolean isDoubleQualifiedIdentifier()
      • isReferenceIdentifier

        public boolean isReferenceIdentifier()
      • isInteger

        public boolean isInteger()
      • isReal

        public boolean isReal()
      • strEquals

        public boolean strEquals​(java.lang.String str)
      • decodeLiteral

        public java.lang.String decodeLiteral​(boolean strict)
        Get the whole slice as a string.
        Parameters:
        strict - If it should validate string content strictly.
        Returns:
        Slice decoded as UTF_8 string.
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.lang.CharSequence
        Overrides:
        toString in class net.morimekta.util.CharSlice
      • getOffset

        public int getOffset()