    -- File generated by the BNF Converter (bnfc 2.9.6.1).

    {-# LANGUAGE CPP #-}
    {-# LANGUAGE FlexibleInstances #-}
    {-# LANGUAGE LambdaCase #-}

    -- | Pretty-printer for Language.

    module Language.Lustre.PrintLustre where

    import Prelude
      ( ($), (.)
      , Bool(..), (==), (<)
      , Int, Integer, Double, (+), (-), (*)
      , String, (++)
      , ShowS, showChar, showString
      , all, elem, foldr, id, map, null, replicate, shows, span
      )
    import Data.Char ( Char, isSpace )
    import qualified Language.Lustre.AbsLustre

    -- | The top-level printing method.

    printTree :: Print a => a -> String
    printTree :: forall a. Print a => a -> String
    printTree = Doc -> String
    render (Doc -> String) -> (a -> Doc) -> a -> String
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Int -> a -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0

    type Doc = [ShowS] -> [ShowS]

    doc :: ShowS -> Doc
    doc :: ShowS -> Doc
    doc = (:)

    render :: Doc -> String
    render :: Doc -> String
    render Doc
    d = Int -> Bool -> [String] -> ShowS
    rend Int
    0 Bool
    False ((ShowS -> String) -> [ShowS] -> [String]
    forall a b. (a -> b) -> [a] -> [b]
    map (ShowS -> ShowS
    forall a b. (a -> b) -> a -> b
    $ String
    "") ([ShowS] -> [String]) -> [ShowS] -> [String]
    forall a b. (a -> b) -> a -> b
    $ Doc
    d []) String
    ""
      where
      rend
        :: Int        -- ^ Indentation level.
        -> Bool       -- ^ Pending indentation to be output before next character?
        -> [String]
        -> ShowS
      rend :: Int -> Bool -> [String] -> ShowS
    rend Int
    i Bool
    p = \case
          String
    "["      :[String]
    ts -> Char -> ShowS
    char Char
    '[' ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Int -> Bool -> [String] -> ShowS
    rend Int
    i Bool
    False [String]
    ts
          String
    "("      :[String]
    ts -> Char -> ShowS
    char Char
    '(' ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Int -> Bool -> [String] -> ShowS
    rend Int
    i Bool
    False [String]
    ts
          String
    "{"      :[String]
    ts -> Int -> Bool -> ShowS
    onNewLine Int
    i     Bool
    p ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Char -> ShowS
    showChar   Char
    '{'  ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Int -> [String] -> ShowS
    new (Int
    iInt -> Int -> Int
    forall a. Num a => a -> a -> a
    +Int
    1) [String]
    ts
          String
    "}" : String
    ";":[String]
    ts -> Int -> Bool -> ShowS
    onNewLine (Int
    iInt -> Int -> Int
    forall a. Num a => a -> a -> a
    -Int
    1) Bool
    p ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . String -> ShowS
    showString String
    "};" ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Int -> [String] -> ShowS
    new (Int
    iInt -> Int -> Int
    forall a. Num a => a -> a -> a
    -Int
    1) [String]
    ts
          String
    "}"      :[String]
    ts -> Int -> Bool -> ShowS
    onNewLine (Int
    iInt -> Int -> Int
    forall a. Num a => a -> a -> a
    -Int
    1) Bool
    p ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Char -> ShowS
    showChar   Char
    '}'  ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Int -> [String] -> ShowS
    new (Int
    iInt -> Int -> Int
    forall a. Num a => a -> a -> a
    -Int
    1) [String]
    ts
          [String
    ";"]        -> Char -> ShowS
    char Char
    ';'
          String
    ";"      :[String]
    ts -> Char -> ShowS
    char Char
    ';' ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Int -> [String] -> ShowS
    new Int
    i [String]
    ts
          String
    t  : ts :: [String]
    ts@(String
    s:[String]
    _) | String -> Bool
    closingOrPunctuation String
    s
                       -> ShowS
    pending ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . String -> ShowS
    showString String
    t ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Int -> Bool -> [String] -> ShowS
    rend Int
    i Bool
    False [String]
    ts
          String
    t        :[String]
    ts -> ShowS
    pending ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . String -> ShowS
    space String
    t      ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Int -> Bool -> [String] -> ShowS
    rend Int
    i Bool
    False [String]
    ts
          []           -> ShowS
    forall a. a -> a
    id
        where
        -- Output character after pending indentation.
        char :: Char -> ShowS
        char :: Char -> ShowS
    char Char
    c = ShowS
    pending ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Char -> ShowS
    showChar Char
    c

        -- Output pending indentation.
        pending :: ShowS
        pending :: ShowS
    pending = if Bool
    p then Int -> ShowS
    indent Int
    i else ShowS
    forall a. a -> a
    id

      -- Indentation (spaces) for given indentation level.
      indent :: Int -> ShowS
      indent :: Int -> ShowS
    indent Int
    i = Int -> ShowS -> ShowS
    replicateS (Int
    2Int -> Int -> Int
    forall a. Num a => a -> a -> a
    *Int
    i) (Char -> ShowS
    showChar Char
    ' ')

      -- Continue rendering in new line with new indentation.
      new :: Int -> [String] -> ShowS
      new :: Int -> [String] -> ShowS
    new Int
    j [String]
    ts = Char -> ShowS
    showChar Char
    '\n' ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Int -> Bool -> [String] -> ShowS
    rend Int
    j Bool
    True [String]
    ts

      -- Make sure we are on a fresh line.
      onNewLine :: Int -> Bool -> ShowS
      onNewLine :: Int -> Bool -> ShowS
    onNewLine Int
    i Bool
    p = (if Bool
    p then ShowS
    forall a. a -> a
    id else Char -> ShowS
    showChar Char
    '\n') ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Int -> ShowS
    indent Int
    i

      -- Separate given string from following text by a space (if needed).
      space :: String -> ShowS
      space :: String -> ShowS
    space String
    t String
    s =
        case ((Char -> Bool) -> String -> Bool
    forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
    all Char -> Bool
    isSpace String
    t, String -> Bool
    forall a. [a] -> Bool
    forall (t :: * -> *) a. Foldable t => t a -> Bool
    null String
    spc, String -> Bool
    forall a. [a] -> Bool
    forall (t :: * -> *) a. Foldable t => t a -> Bool
    null String
    rest) of
          (Bool
    True , Bool
    _   , Bool
    True ) -> []             -- remove trailing space
          (Bool
    False, Bool
    _   , Bool
    True ) -> String
    t              -- remove trailing space
          (Bool
    False, Bool
    True, Bool
    False) -> String
    t String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Char
    ' ' Char -> ShowS
    forall a. a -> [a] -> [a]
    : String
    s   -- add space if none
          (Bool, Bool, Bool)
    _                    -> String
    t String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ String
    s
        where
          (String
    spc, String
    rest) = (Char -> Bool) -> String -> (String, String)
    forall a. (a -> Bool) -> [a] -> ([a], [a])
    span Char -> Bool
    isSpace String
    s

      closingOrPunctuation :: String -> Bool
      closingOrPunctuation :: String -> Bool
    closingOrPunctuation [Char
    c] = Char
    c Char -> String -> Bool
    forall a. Eq a => a -> [a] -> Bool
    forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
    `elem` String
    closerOrPunct
      closingOrPunctuation String
    _   = Bool
    False

      closerOrPunct :: String
      closerOrPunct :: String
    closerOrPunct = String
    ")],;"

    parenth :: Doc -> Doc
    parenth :: Doc -> Doc
    parenth Doc
    ss = ShowS -> Doc
    doc (Char -> ShowS
    showChar Char
    '(') Doc -> Doc -> Doc
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Doc
    ss Doc -> Doc -> Doc
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ShowS -> Doc
    doc (Char -> ShowS
    showChar Char
    ')')

    concatS :: [ShowS] -> ShowS
    concatS :: [ShowS] -> ShowS
    concatS = (ShowS -> ShowS -> ShowS) -> ShowS -> [ShowS] -> ShowS
    forall a b. (a -> b -> b) -> b -> [a] -> b
    forall (t :: * -> *) a b.
    Foldable t =>
    (a -> b -> b) -> b -> t a -> b
    foldr ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    (.) ShowS
    forall a. a -> a
    id

    concatD :: [Doc] -> Doc
    concatD :: [Doc] -> Doc
    concatD = (Doc -> Doc -> Doc) -> Doc -> [Doc] -> Doc
    forall a b. (a -> b -> b) -> b -> [a] -> b
    forall (t :: * -> *) a b.
    Foldable t =>
    (a -> b -> b) -> b -> t a -> b
    foldr Doc -> Doc -> Doc
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    (.) Doc
    forall a. a -> a
    id

    replicateS :: Int -> ShowS -> ShowS
    replicateS :: Int -> ShowS -> ShowS
    replicateS Int
    n ShowS
    f = [ShowS] -> ShowS
    concatS (Int -> ShowS -> [ShowS]
    forall a. Int -> a -> [a]
    replicate Int
    n ShowS
    f)

    -- | The printer class does the job.

    class Print a where
      prt :: Int -> a -> Doc

    instance {-# OVERLAPPABLE #-} Print a => Print [a] where
      prt :: Int -> [a] -> Doc
    prt Int
    i = [Doc] -> Doc
    concatD ([Doc] -> Doc) -> ([a] -> [Doc]) -> [a] -> Doc
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (a -> Doc) -> [a] -> [Doc]
    forall a b. (a -> b) -> [a] -> [b]
    map (Int -> a -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    i)

    instance Print Char where
      prt :: Int -> Char -> Doc
    prt Int
    _ Char
    c = ShowS -> Doc
    doc (Char -> ShowS
    showChar Char
    '\'' ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Char -> Char -> ShowS
    mkEsc Char
    '\'' Char
    c ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Char -> ShowS
    showChar Char
    '\'')

    instance Print String where
      prt :: Int -> String -> Doc
    prt Int
    _ = String -> Doc
    printString

    printString :: String -> Doc
    printString :: String -> Doc
    printString String
    s = ShowS -> Doc
    doc (Char -> ShowS
    showChar Char
    '"' ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [ShowS] -> ShowS
    concatS ((Char -> ShowS) -> String -> [ShowS]
    forall a b. (a -> b) -> [a] -> [b]
    map (Char -> Char -> ShowS
    mkEsc Char
    '"') String
    s) ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Char -> ShowS
    showChar Char
    '"')

    mkEsc :: Char -> Char -> ShowS
    mkEsc :: Char -> Char -> ShowS
    mkEsc Char
    q = \case
      Char
    s | Char
    s Char -> Char -> Bool
    forall a. Eq a => a -> a -> Bool
    == Char
    q -> Char -> ShowS
    showChar Char
    '\\' ShowS -> ShowS -> ShowS
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Char -> ShowS
    showChar Char
    s
      Char
    '\\' -> String -> ShowS
    showString String
    "\\\\"
      Char
    '\n' -> String -> ShowS
    showString String
    "\\n"
      Char
    '\t' -> String -> ShowS
    showString String
    "\\t"
      Char
    s -> Char -> ShowS
    showChar Char
    s

    prPrec :: Int -> Int -> Doc -> Doc
    prPrec :: Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    j = if Int
    j Int -> Int -> Bool
    forall a. Ord a => a -> a -> Bool
    < Int
    i then Doc -> Doc
    parenth else Doc -> Doc
    forall a. a -> a
    id

    instance Print Integer where
      prt :: Int -> Integer -> Doc
    prt Int
    _ Integer
    x = ShowS -> Doc
    doc (Integer -> ShowS
    forall a. Show a => a -> ShowS
    shows Integer
    x)

    instance Print Double where
      prt :: Int -> Double -> Doc
    prt Int
    _ Double
    x = ShowS -> Doc
    doc (Double -> ShowS
    forall a. Show a => a -> ShowS
    shows Double
    x)

    instance Print Language.Lustre.AbsLustre.Ident where
      prt :: Int -> Ident -> Doc
    prt Int
    _ (Language.Lustre.AbsLustre.Ident String
    i) = ShowS -> Doc
    doc (ShowS -> Doc) -> ShowS -> Doc
    forall a b. (a -> b) -> a -> b
    $ String -> ShowS
    showString String
    i
    instance Print Language.Lustre.AbsLustre.BoolSpec where
      prt :: Int -> BoolSpec -> Doc
    prt Int
    i = \case
        Language.Lustre.AbsLustre.BoolSpecPar BoolSpec
    boolspec -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "("), Int -> BoolSpec -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 BoolSpec
    boolspec, ShowS -> Doc
    doc (String -> ShowS
    showString String
    ")")])
        Language.Lustre.AbsLustre.BoolSpecConstI Integer
    n -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [Int -> Integer -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 Integer
    n])
        Language.Lustre.AbsLustre.BoolSpecConstD Double
    d -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [Int -> Double -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 Double
    d])
        Language.Lustre.AbsLustre.BoolSpecConstB BoolConst
    boolconst -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [Int -> BoolConst -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 BoolConst
    boolconst])
        Language.Lustre.AbsLustre.BoolSpecSignal Ident
    id_ -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [Int -> Ident -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 Ident
    id_])
        Language.Lustre.AbsLustre.BoolSpecOp1Pre Op1Pre
    oppre BoolSpec
    boolspec -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [Int -> Op1Pre -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 Op1Pre
    oppre, Int -> BoolSpec -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 BoolSpec
    boolspec])
        Language.Lustre.AbsLustre.BoolSpecOp2In BoolSpec
    boolspec1 Op2In
    opin BoolSpec
    boolspec2 -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [Int -> BoolSpec -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 BoolSpec
    boolspec1, Int -> Op2In -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 Op2In
    opin, Int -> BoolSpec -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 BoolSpec
    boolspec2])
        Language.Lustre.AbsLustre.BoolSpecOp2Pre Op2Pre
    oppre BoolSpec
    boolspec1 BoolSpec
    boolspec2 -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [Int -> Op2Pre -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 Op2Pre
    oppre, ShowS -> Doc
    doc (String -> ShowS
    showString String
    "("), Int -> BoolSpec -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 BoolSpec
    boolspec1, ShowS -> Doc
    doc (String -> ShowS
    showString String
    ","), Int -> BoolSpec -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 BoolSpec
    boolspec2, ShowS -> Doc
    doc (String -> ShowS
    showString String
    ")")])
        Language.Lustre.AbsLustre.BoolSpecOp2OT NumExpr
    numexpr1 NumExpr
    numexpr2 BoolSpec
    boolspec -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "OT"), ShowS -> Doc
    doc (String -> ShowS
    showString String
    "("), Int -> NumExpr -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 NumExpr
    numexpr1, ShowS -> Doc
    doc (String -> ShowS
    showString String
    ","), Int -> NumExpr -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 NumExpr
    numexpr2, ShowS -> Doc
    doc (String -> ShowS
    showString String
    ","), Int -> BoolSpec -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 BoolSpec
    boolspec, ShowS -> Doc
    doc (String -> ShowS
    showString String
    ")")])
        Language.Lustre.AbsLustre.BoolSpecOp2HT NumExpr
    numexpr1 NumExpr
    numexpr2 BoolSpec
    boolspec -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "HT"), ShowS -> Doc
    doc (String -> ShowS
    showString String
    "("), Int -> NumExpr -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 NumExpr
    numexpr1, ShowS -> Doc
    doc (String -> ShowS
    showString String
    ","), Int -> NumExpr -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 NumExpr
    numexpr2, ShowS -> Doc
    doc (String -> ShowS
    showString String
    ","), Int -> BoolSpec -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 BoolSpec
    boolspec, ShowS -> Doc
    doc (String -> ShowS
    showString String
    ")")])
        Language.Lustre.AbsLustre.BoolSpecOp2ST NumExpr
    numexpr1 NumExpr
    numexpr2 BoolSpec
    boolspec1 BoolSpec
    boolspec2 -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "ST"), ShowS -> Doc
    doc (String -> ShowS
    showString String
    "("), Int -> NumExpr -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 NumExpr
    numexpr1, ShowS -> Doc
    doc (String -> ShowS
    showString String
    ","), Int -> NumExpr -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 NumExpr
    numexpr2, ShowS -> Doc
    doc (String -> ShowS
    showString String
    ","), Int -> BoolSpec -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 BoolSpec
    boolspec1, ShowS -> Doc
    doc (String -> ShowS
    showString String
    ","), Int -> BoolSpec -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 BoolSpec
    boolspec2, ShowS -> Doc
    doc (String -> ShowS
    showString String
    ")")])

    instance Print Language.Lustre.AbsLustre.Op1Pre where
      prt :: Int -> Op1Pre -> Doc
    prt Int
    i = \case
        Op1Pre
    Language.Lustre.AbsLustre.Op1Once -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "O")])
        Op1Pre
    Language.Lustre.AbsLustre.Op1Pre -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "pre")])
        Op1Pre
    Language.Lustre.AbsLustre.Op1YtoPre -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "YtoPre")])
        Op1Pre
    Language.Lustre.AbsLustre.Op1ZtoPre -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "ZtoPre")])
        Op1Pre
    Language.Lustre.AbsLustre.Op1Hist -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "H")])
        Op1Pre
    Language.Lustre.AbsLustre.Op1Y -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "Y")])
        Op1Pre
    Language.Lustre.AbsLustre.Op1Not -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "not")])
        Op1Pre
    Language.Lustre.AbsLustre.Op1Bang -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "!")])

    instance Print Language.Lustre.AbsLustre.Op2In where
      prt :: Int -> Op2In -> Doc
    prt Int
    i = \case
        Op2In
    Language.Lustre.AbsLustre.Op2And -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "and")])
        Op2In
    Language.Lustre.AbsLustre.Op2Amp -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "&")])
        Op2In
    Language.Lustre.AbsLustre.Op2Or -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "or")])
        Op2In
    Language.Lustre.AbsLustre.Op2Impl -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "=>")])
        Language.Lustre.AbsLustre.Op2NumOp NumOp2In
    numopin -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [Int -> NumOp2In -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 NumOp2In
    numopin])
        Language.Lustre.AbsLustre.Op2NumCmp BoolNumOp
    boolnumop -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [Int -> BoolNumOp -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 BoolNumOp
    boolnumop])
        Op2In
    Language.Lustre.AbsLustre.Op2InPre -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "->")])

    instance Print Language.Lustre.AbsLustre.Op2Pre where
      prt :: Int -> Op2Pre -> Doc
    prt Int
    i = \case
        Op2Pre
    Language.Lustre.AbsLustre.Op2SI -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "SI")])
        Op2Pre
    Language.Lustre.AbsLustre.Op2OT -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "OT")])

    instance Print Language.Lustre.AbsLustre.NumExpr where
      prt :: Int -> NumExpr -> Doc
    prt Int
    i = \case
        Language.Lustre.AbsLustre.NumExprNum Integer
    n -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [Int -> Integer -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 Integer
    n])
        Language.Lustre.AbsLustre.NumExprId Ident
    id_ -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [Int -> Ident -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 Ident
    id_])
        Language.Lustre.AbsLustre.NumExprPar NumExpr
    numexpr -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "("), Int -> NumExpr -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 NumExpr
    numexpr, ShowS -> Doc
    doc (String -> ShowS
    showString String
    ")")])
        Language.Lustre.AbsLustre.NumExprOp2In NumExpr
    numexpr1 NumOp2In
    numopin NumExpr
    numexpr2 -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [Int -> NumExpr -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 NumExpr
    numexpr1, Int -> NumOp2In -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 NumOp2In
    numopin, Int -> NumExpr -> Doc
    forall a. Print a => Int -> a -> Doc
    prt Int
    0 NumExpr
    numexpr2])

    instance Print Language.Lustre.AbsLustre.NumOp2In where
      prt :: Int -> NumOp2In -> Doc
    prt Int
    i = \case
        NumOp2In
    Language.Lustre.AbsLustre.NumOp2Plus -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "+")])
        NumOp2In
    Language.Lustre.AbsLustre.NumOp2Minus -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "-")])
        NumOp2In
    Language.Lustre.AbsLustre.NumOp2Mult -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "*")])

    instance Print Language.Lustre.AbsLustre.BoolNumOp where
      prt :: Int -> BoolNumOp -> Doc
    prt Int
    i = \case
        BoolNumOp
    Language.Lustre.AbsLustre.BoolNumOp2Eq -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "=")])
        BoolNumOp
    Language.Lustre.AbsLustre.BoolNumOp2Ne -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "<>")])
        BoolNumOp
    Language.Lustre.AbsLustre.BoolNumOp2Le -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "<=")])
        BoolNumOp
    Language.Lustre.AbsLustre.BoolNumOp2Lt -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "<")])
        BoolNumOp
    Language.Lustre.AbsLustre.BoolNumOp2Gt -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    ">")])
        BoolNumOp
    Language.Lustre.AbsLustre.BoolNumOp2Ge -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    ">=")])

    instance Print Language.Lustre.AbsLustre.BoolConst where
      prt :: Int -> BoolConst -> Doc
    prt Int
    i = \case
        BoolConst
    Language.Lustre.AbsLustre.BoolConstTrue -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "true")])
        BoolConst
    Language.Lustre.AbsLustre.BoolConstFalse -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "false")])
        BoolConst
    Language.Lustre.AbsLustre.BoolConstFTP -> Int -> Int -> Doc -> Doc
    prPrec Int
    i Int
    0 ([Doc] -> Doc
    concatD [ShowS -> Doc
    doc (String -> ShowS
    showString String
    "FTP")])