{-# LANGUAGE NoImplicitPrelude #-}
module BNFC.Check.Run where
import BNFC.Prelude
import BNFC.CF
import qualified BNFC.Abs as A
import BNFC.Check.Monad
import qualified BNFC.Check.Pass1 as Pass1
import qualified BNFC.Check.Pass2 as Pass2
checkGrammar :: A.Grammar -> (Warnings, RecoverableErrors, Either PFatalError LBNF)
checkGrammar :: Grammar -> (Warnings, RecoverableErrors, Either PFatalError LBNF)
checkGrammar Grammar
grammar = Check LBNF
-> (Warnings, RecoverableErrors, Either PFatalError LBNF)
forall a.
Check a -> (Warnings, RecoverableErrors, Either PFatalError a)
runCheck (Check LBNF
-> (Warnings, RecoverableErrors, Either PFatalError LBNF))
-> Check LBNF
-> (Warnings, RecoverableErrors, Either PFatalError LBNF)
forall a b. (a -> b) -> a -> b
$ do
(Grammar -> Pass1 -> Check LBNF) -> (Grammar, Pass1) -> Check LBNF
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Grammar -> Pass1 -> Check LBNF
Pass2.checkLBNF ((Grammar, Pass1) -> Check LBNF)
-> Check (Grammar, Pass1) -> Check LBNF
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Grammar -> Check (Grammar, Pass1)
Pass1.checkLBNF Grammar
grammar