{-# LANGUAGE DeriveGeneric #-}

module LibRISCV.Internal.Decoder.YamlParser where

import qualified Data.Map.Strict as M
import Data.Yaml (FromJSON)
import GHC.Generics (Generic)

data InstructionFields = InstructionFields
    { InstructionFields -> [String]
extension :: [String]
    , InstructionFields -> String
mask :: String
    , InstructionFields -> String
match :: String
    }
    deriving (InstructionFields -> InstructionFields -> Bool
(InstructionFields -> InstructionFields -> Bool)
-> (InstructionFields -> InstructionFields -> Bool)
-> Eq InstructionFields
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InstructionFields -> InstructionFields -> Bool
== :: InstructionFields -> InstructionFields -> Bool
$c/= :: InstructionFields -> InstructionFields -> Bool
/= :: InstructionFields -> InstructionFields -> Bool
Eq, Int -> InstructionFields -> ShowS
[InstructionFields] -> ShowS
InstructionFields -> String
(Int -> InstructionFields -> ShowS)
-> (InstructionFields -> String)
-> ([InstructionFields] -> ShowS)
-> Show InstructionFields
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InstructionFields -> ShowS
showsPrec :: Int -> InstructionFields -> ShowS
$cshow :: InstructionFields -> String
show :: InstructionFields -> String
$cshowList :: [InstructionFields] -> ShowS
showList :: [InstructionFields] -> ShowS
Show, (forall x. InstructionFields -> Rep InstructionFields x)
-> (forall x. Rep InstructionFields x -> InstructionFields)
-> Generic InstructionFields
forall x. Rep InstructionFields x -> InstructionFields
forall x. InstructionFields -> Rep InstructionFields x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. InstructionFields -> Rep InstructionFields x
from :: forall x. InstructionFields -> Rep InstructionFields x
$cto :: forall x. Rep InstructionFields x -> InstructionFields
to :: forall x. Rep InstructionFields x -> InstructionFields
Generic)

instance FromJSON InstructionFields

type InstructionEntries = M.Map String InstructionFields