Interface StaticSourceFile

    • Method Detail

      • getName

        java.lang.String getName()
        The name of the file. Must be unique across all files in the compilation.
      • isStrong

        default boolean isStrong()
        Whether the source kind is STRONG.
      • isWeak

        default boolean isWeak()
        Whether the source kind is WEAK.
      • isExtern

        default boolean isExtern()
        Whether the source kind is EXTERN.
      • getLineOffset

        int getLineOffset​(int lineNumber)
        Returns the offset of the given line number relative to the file start. Line number should be 1-based. If the source file doesn't have line information, it should return Integer.MIN_VALUE. The negative offsets will make it more obvious what happened.
        Parameters:
        lineNumber - the line of the input to get the absolute offset of.
        Returns:
        the absolute offset of the start of the provided line.
        Throws:
        java.lang.IllegalArgumentException - if lineno is less than 1 or greater than the number of lines in the source.
      • getLineOfOffset

        int getLineOfOffset​(int offset)
        Gets the 1-based line number of the given source offset.
        Parameters:
        offset - An absolute file offset.
        Returns:
        The 1-based line number of that offset. The behavior is undefined if this offset does not exist in the source file.
      • getColumnOfOffset

        int getColumnOfOffset​(int offset)
        Gets the 0-based column number of the given source offset.
        Parameters:
        offset - An absolute file offset.
        Returns:
        The 0-based column number of that offset. The behavior is undefined if this offset does not exist in the source file.