Module swim.codec
Package swim.codec

Class Tag

java.lang.Object
swim.codec.Tag
All Implemented Interfaces:
Debug, Display
Direct Known Subclasses:
Mark, Span

public abstract class Tag extends Object implements Display, Debug
Description of a source location. Tags are used to annotate input sources, particularly for diagnostic purposes. A Mark tag annotates a source position. A Span tag annotate a source range.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Mark
    end()
    Returns the last source position covered by this Tag.
    abstract Tag
    shift(Mark mark)
    Returns the position of this Tag relative to the given mark.
    abstract Mark
    Returns the first source position covered by this Tag.
    abstract Tag
    union(Tag other)
    Returns a Tag that includes all source locations covered by both this tag, and some other tag.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface swim.codec.Debug

    debug

    Methods inherited from interface swim.codec.Display

    display
  • Method Details

    • start

      public abstract Mark start()
      Returns the first source position covered by this Tag.
    • end

      public abstract Mark end()
      Returns the last source position covered by this Tag.
    • union

      public abstract Tag union(Tag other)
      Returns a Tag that includes all source locations covered by both this tag, and some other tag.
    • shift

      public abstract Tag shift(Mark mark)
      Returns the position of this Tag relative to the given mark.