Class Bison.Location

  • Enclosing class:
    Bison

    public static class Bison.Location
    extends Object
    A class defining a pair of positions. Positions, defined by the Bison.Position class, denote a point in the input. Locations represent a part of the input through the beginning and ending positions.
    • Field Detail

      • begin

        public Bison.Position begin
        The first, inclusive, position in the range.
    • Constructor Detail

      • Location

        public Location​(Bison.Position loc)
        Create a Location denoting an empty range located at a given point.
        Parameters:
        loc - The position at which the range is anchored.
      • Location

        public Location​(Bison.Position begin,
                        Bison.Position end)
        Create a Location from the endpoints of the range.
        Parameters:
        begin - The first position included in the range.
        end - The first position beyond the range.
    • Method Detail

      • toString

        public String toString()
        Print a representation of the location. For this to be correct, Bison.Position should override the equals method.
        Overrides:
        toString in class Object