Documentation

Parser.Stream

class Parser.Stream (σ : Type u_1) (τ : outParam (Type u_2)) extends Stream σ τ :
Type (max (max u_1 u_2) (u_3 + 1))

Parser.Stream class extends Stream with position features

  • next? : σOption (τ × σ)
  • Position : Type u_3

    Position type

  • getPosition : σPosition σ

    Get current stream position

  • setPosition : σPosition σσ

    Set current stream position

Instances
    def Parser.Stream.Segment {τ : Type u_1} (σ : Type u_2) [Parser.Stream σ τ] :
    Type u_3

    Stream segment

    Equations
    Instances For
      @[reducible, inline]
      abbrev Parser.Stream.Segment.start {σ : Type u_1} {τ : Type u_2} [Parser.Stream σ τ] (s : Segment σ) :

      Start position of stream segment

      Equations
      Instances For
        @[reducible, inline]
        abbrev Parser.Stream.Segment.stop {σ : Type u_1} {τ : Type u_2} [Parser.Stream σ τ] (s : Segment σ) :

        Stop position of stream segment

        Equations
        Instances For
          def Parser.Stream.mkDefault (σ : Type u_1) (τ : Type u_2) [Stream σ τ] :
          Type u_1

          Wrapper to make a Parser.Stream from a core Stream

          Equations
          Instances For
            @[reducible]
            instance Parser.Stream.instMkDefault (σ : Type u_1) (τ : Type u_2) [self : Stream σ τ] :
            Equations
            @[reducible]
            Equations
            • One or more equations did not get rendered due to their size.
            @[reducible]
            Equations
            • One or more equations did not get rendered due to their size.
            @[reducible]
            Equations
            • One or more equations did not get rendered due to their size.
            structure Parser.Stream.OfList (τ : Type u_1) :
            Type u_1

            OfList is a view of a list along with a position along that list

            • next : List τ

              Remaining tokens

            • past : List τ

              Consumed tokens

            Instances For
              Equations
              Instances For
                Equations
                Instances For
                  def Parser.Stream.mkOfList {τ : Type u_1} (data : List τ) (pos : Nat := 0) :

                  Make a Parser.Stream from a List

                  Equations
                  Instances For