Class Type Parameter Parsing, wtf
This commit is contained in:
commit
49e06c175f
20 changed files with 1158 additions and 0 deletions
33
src/ClassTypeParameter.hs
Normal file
33
src/ClassTypeParameter.hs
Normal file
|
@ -0,0 +1,33 @@
|
|||
module ClassTypeParameter (module ClassTypeParameter) where
|
||||
|
||||
import PrimitiveTypes
|
||||
|
||||
import Numeric.Natural (Natural)
|
||||
|
||||
-- TODO: Annotations
|
||||
data ClassTypeParameter = ClassTypeParameter { name :: String
|
||||
, extends :: Maybe TypeBound
|
||||
, implements :: [ClassType]
|
||||
}
|
||||
deriving Show
|
||||
|
||||
data TypeBound = SimpleTypeBound String | ClassTypeBound ClassType [ClassType]
|
||||
deriving Show
|
||||
|
||||
data ClassType = RecursiveTypeBound ClassType String [TypeArgument] | NonRecursiveTypeBound String [TypeArgument]
|
||||
deriving Show
|
||||
|
||||
data TypeArgument = ReferenceTypeArgument ReferenceType | WildCardTypeArgument WildCard
|
||||
deriving Show
|
||||
|
||||
data WildCard = WildCard (Maybe WildCardBound)
|
||||
deriving Show
|
||||
|
||||
data WildCardBound = SuperWildCardBound ReferenceType | ExtendsWildCardBound ReferenceType
|
||||
deriving Show
|
||||
|
||||
data ReferenceType = ClassReferenceType ClassType | VariableReferenceType String | ArrayReferenceType ArrayType
|
||||
deriving Show
|
||||
|
||||
data ArrayType = PrimitiveArrayType PrimitiveType Natural | ClassArrayType ClassType Natural | VariableArrayType String Natural
|
||||
deriving Show
|
Loading…
Add table
Add a link
Reference in a new issue