Documentation

Parser_.TLAPlus

A small lexer for TLA⁺ #

Lex a full module: raw-skip anything before the header and after the footer, tokenizing only what lies between them — both are ignorable junk by TLA⁺'s own rules, and need not lex as valid tokens at all (an unterminated string in a license preamble, say).

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    Lex an arbitrary TLA⁺ fragment with no module header or footer of its own, tokenizing straight through to the end of input. Parser_/Annotations.lean's parseMailbox re-lexes a bare expression pulled out of a @mailbox comment this way, as opposed to lexModule, which expects a real module's ---- MODULE <name> ----==== structure.

    Equations
    Instances For

      Main parser for a single TLA⁺ module #

      @[implicit_reducible]
      Equations
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Instances
            @[implicit_reducible]
            Equations
            • One or more equations did not get rendered due to their size.

            Returns true if the precedence range of the two operators overlap, false otherwise.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[implicit_reducible]
              Equations
              • One or more equations did not get rendered due to their size.
              @[implicit_reducible]
              Equations
              • One or more equations did not get rendered due to their size.
              @[implicit_reducible]
              Equations
              • One or more equations did not get rendered due to their size.

              Associativity of an infix operator.

              • left : Associativity

                An operator is left-associative if x ⊙ y ⊙ z = (x ⊙ y) ⊙ z.

              • right : Associativity

                An operator is right-associative if x ⊙ y ⊙ z = x ⊙ (y ⊙ z).

              • none : Associativity

                An operator is non-associative if it does not make sense to write x ⊙ y ⊙ z.

              Instances For

                Maps a TLA+ infix operator to its associativity.

                Equations
                Instances For
                  def SurfaceTLAPlus.Parser.checkConflicts {α : Type u_1} {β γ σ ε : Type} {m : TypeType u_2} [Monad m] [HasPrecedence β] [HasPrecedence γ] [Parser.Stream σ α] [Parser.Error ε σ α] [ToString β] [ToString γ] (op₁ : β) (op₂ : γ) :
                  ParserT ε σ α m PUnit.{1}
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    A modified Shunting Yard algorithm: also handles prefix/postfix operators and conflicts between precedence ranges.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      Parse a full module.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        Parse a full module, always pairing any collected ParserWarnings with the result — whether or not parsing itself succeeded, so a warning emitted before a fatal parse error still reaches the caller. A DiagT in all but name (Id base), ascribed that way so Driver/Modules.lean can absorb it directly via DiagT.lift.

                        .reverse because ParserWarningM accumulates by prepending (Parser_/Common.lean, modify (w :: ·) — O(1) per warning, unlike appending), so its list is newest-first. Every other pass reports through DiagT, whose bind appends, so warnings elsewhere come out in source order; reversing here is what puts the parser's on that same footing.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For