Module swim.codec
Package swim.codec

Class 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:
    • Constructor Detail

      • Tag

        public Tag()
    • Method Detail

      • 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.