Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Language.Java.Java
- module Language.Java.Syntax
- module Language.Java.SyntaxClasses
- data Type
- data RefType
- data ClassType
- data ClassName
- = ClassName [(Ident, [TypeArgument])]
- | WildcardName
- data Package
- data TypeArgument
- newtype TypeDeclSpecifier = TypeDeclSpecifier ClassType
- data WildcardBound
- data PrimType
- data TypeParam = TypeParam {
- typeParamName :: Ident
- typeParamBounds :: [RefType]
- newtype Ident = Ident String
- fromIdent :: Ident -> String
- newtype Name = Name [Ident]
- newtype RelaxedType = RelaxedType Type
- checkRelaxed :: RefType -> RefType -> Bool
- primToRefType :: PrimType -> RefType
- withPackageIdentToType :: [Ident] -> Ident -> Type
- withoutPackageIdentToType :: Ident -> Type
- data Literal
- data Op
- data AssignOp
Documentation
module Language.Java.Syntax
module Language.Java.SyntaxClasses
There are two kinds of types in the Java programming language: primitive types and reference types.
There are three kinds of reference types: class types, interface types, and array types. Reference types may be parameterized with type arguments. Type variables cannot be syntactically distinguished from class type identifiers, and are thus represented uniformly as single ident class types.
Constructors
ClassRefType ClassType | |
ArrayType Type | TypeVariable Ident |
A ClassType can either be with an package or without.
Constructors
WithPackage Package ClassName | |
WithoutPackage ClassName |
a Classname is either a Classname or wildcard (matches any name). An AST constructed by the parser will only produce Classnames.
Constructors
ClassName [(Ident, [TypeArgument])] | |
WildcardName |
represents a package, e.g. java.util a package can either be fully qualified ("java.util"), or end with an wildcard ("java.util.*")
Constructors
FullQualiPackage [Ident] | |
WildcardPackage [Ident] |
data TypeArgument Source #
Type arguments may be either reference types or wildcards.
Constructors
Wildcard (Maybe WildcardBound) | |
ActualType RefType | |
Diamond |
Instances
newtype TypeDeclSpecifier Source #
Constructors
TypeDeclSpecifier ClassType |
data WildcardBound Source #
Wildcards may be given explicit bounds, either upper (extends
) or lower (super
) bounds.
Constructors
ExtendsBound RefType | |
SuperBound RefType |
A primitive type is predefined by the Java programming language and named by its reserved keyword.
A class is generic if it declares one or more type variables. These type variables are known as the type parameters of the class.
Constructors
TypeParam | |
Fields
|
A single identifier.
A name, i.e. a period-separated list of identifiers.
newtype RelaxedType Source #
A type with relaxed equality checking: 1. If packages equal 2. Or if classes equal 3. Or if boxed primitives equal primitives
Constructors
RelaxedType Type |
Instances
Eq RelaxedType Source # | Defines Equals for RelaxedType |
checkRelaxed :: RefType -> RefType -> Bool Source #
Checks a RelaxedType for equality. A RelaxedType equals another RelaxedType if: 1. If packages equal 2. If classes equal 3. If boxed primitives equal primitives
primToRefType :: PrimType -> RefType Source #
This function returns a primitve as a ref type (i.e. boxed primitve)
withoutPackageIdentToType :: Ident -> Type Source #
This function returns an Ident as a Type
A literal denotes a fixed, unchanging value.
A binary infix operator.
An assignment operator.