Class SourceLocation

java.lang.Object
com.mackenziehigh.sexpr.SourceLocation

public final class SourceLocation extends Object
An instance of this interface indicate the location of a symbolic-expression within a string of text.
  • Field Details

  • Constructor Details

    • SourceLocation

      public SourceLocation(String source, int line, int column)
      Sole Constructor.
      Parameters:
      source - is the value that will be returnable by source().
      line - is the value that will be returnable by line().
      column - is the value that will be returnable by column().
  • Method Details

    • source

      public String source()
      This method retrieves the name of the source. This is usually the path to a file.
      Returns:
      the identifier of the source.
    • line

      public int line()
      This method retrieves the line-number where the symbolic-expression starts.
      Returns:
      the line-number.
    • column

      public int column()
      This method retrieves the column-number where the symbolic-expression starts.
      Returns:
      the line-number.
    • message

      public String message()
      This method returns a human-readable message based on this location.
      Returns:
      this object in human readable form.
    • toString

      public String toString()
      Overrides:
      toString in class Object