{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DataKinds #-} module BNFC.Backend.C where import BNFC.CF import BNFC.Prelude import BNFC.Options.GlobalOptions import BNFC.Options.Target import BNFC.Backend.CommonInterface.Backend import Control.Monad.Except import Control.Monad.State import Options.Applicative instance Backend 'TargetC where type BackendOptions 'TargetC = CBackendOptions type BackendState 'TargetC = CBackendState parseOpts :: Parser CBackendOptions parseOpts = undefined initState :: LBNF -> GlobalOptions -> BackendOptions 'TargetC -> Except String (BackendState 'TargetC) initState = undefined abstractSyntax :: LBNF -> State (BackendState 'TargetC) Result abstractSyntax = undefined printer :: LBNF -> State (BackendState 'TargetC) Result printer = undefined lexer :: LBNF -> State (BackendState 'TargetC) Result lexer = undefined parser :: LBNF -> State (BackendState 'TargetC) Result parser = undefined parserTest :: LBNF -> State (BackendState 'TargetC) Result parserTest = undefined makefile :: LBNF -> State (BackendState 'TargetC) Result makefile = undefined newtype CBackendOptions = COpts Bool cOptionsParser :: Parser CBackendOptions cOptionsParser = COpts <$> oLineNumbers where -- line-numbers option oLineNumbers = switch ( short 'l' <> long "line-numbers" <> help "Add and set line_number field for all syntax classes" ) data CBackendState