hets -- a heterogenous Specification (CASL) tool setContentsIndex
Common.GlobalAnnotations
Portability portable
Stability experimental
Maintainer hets@tzi.de
Description
data structures for global annotations
Synopsis
data GlobalAnnos = GA {
prec_annos :: PrecedenceGraph
assoc_annos :: AssocMap
display_annos :: DisplayMap
literal_annos :: LiteralAnnos
literal_map :: LiteralMap
print_conf :: PrintConfig
}
emptyGlobalAnnos :: GlobalAnnos
data LiteralAnnos = LA {
string_lit :: (Maybe (Id, Id))
list_lit :: (Map Id (Id, Id))
number_lit :: (Maybe Id)
float_lit :: (Maybe (Id, Id))
}
emptyLiteralAnnos :: LiteralAnnos
type DisplayMap = Map Id (Map Display_format [Token])
data PrintConfig = PrC {
prc_inside_gen_arg :: Bool
prc_first_spec_in_param :: Bool
prc_latex_print :: Bool
}
default_print_conf :: PrintConfig
is_inside_gen_arg :: GlobalAnnos -> Bool
set_inside_gen_arg :: Bool -> GlobalAnnos -> GlobalAnnos
is_latex_print :: GlobalAnnos -> Bool
set_latex_print :: Bool -> GlobalAnnos -> GlobalAnnos
is_first_spec_in_param :: GlobalAnnos -> Bool
set_first_spec_in_param :: Bool -> GlobalAnnos -> GlobalAnnos
type LiteralMap = Map Id LiteralType
data LiteralType
= StringCons Id
| StringNull
| ListCons Id Id
| ListNull Id
| Number
| Fraction
| Floating
| NoLiteral
getLiteralType :: GlobalAnnos -> Id -> LiteralType
type AssocMap = Map Id AssocEither
isAssoc :: AssocEither -> AssocMap -> Id -> Bool
type PrecedenceGraph = Rel Id
precRel :: PrecedenceGraph -> Id -> Id -> PrecRel
lookupDisplay :: GlobalAnnos -> Display_format -> Id -> Maybe [Token]
data Display_format
= DF_HTML
| DF_LATEX
| DF_RTF
Documentation
data GlobalAnnos
all global annotations and a field for PrettyPrint stuff
Constructors
GA
prec_annos :: PrecedenceGraphprecedences
assoc_annos :: AssocMapassociativity
display_annos :: DisplayMapdisplay annotations
literal_annos :: LiteralAnnosliteral annotations
literal_map :: LiteralMapredundant representation of the previous literal annotations
print_conf :: PrintConfiggives the possibility to print things upon position in AST
Instances
ATermConvertible GlobalAnnos
PrettyPrint GlobalAnnos
Show GlobalAnnos
Eq GlobalAnnos
emptyGlobalAnnos :: GlobalAnnos
empty (or initial) global annotations
data LiteralAnnos
literal annotations for string, lists, number and floating
Constructors
LA
string_lit :: (Maybe (Id, Id))
list_lit :: (Map Id (Id, Id))
number_lit :: (Maybe Id)
float_lit :: (Maybe (Id, Id))
Instances
ATermConvertible LiteralAnnos
Show LiteralAnnos
Eq LiteralAnnos
emptyLiteralAnnos :: LiteralAnnos
empty literal annotations
type DisplayMap = Map Id (Map Display_format [Token])
ids to be displayed according to a format
data PrintConfig
Options that can be set and used during PrettyPrinting
Constructors
PrC
prc_inside_gen_arg :: Boolset to True if inside of PARAMS or FIT_ARG
prc_first_spec_in_param :: Boolset to True when prc_inside_gen_arg is set to True; set to False if first spec is crossed
prc_latex_print :: BoolTrue if printLatex0 is invoked used in functions that decide on the same things but do different things
Instances
ATermConvertible PrintConfig
Show PrintConfig
Eq PrintConfig
default_print_conf :: PrintConfig
is_inside_gen_arg :: GlobalAnnos -> Bool
set_inside_gen_arg :: Bool -> GlobalAnnos -> GlobalAnnos
is_latex_print :: GlobalAnnos -> Bool
set_latex_print :: Bool -> GlobalAnnos -> GlobalAnnos
is_first_spec_in_param :: GlobalAnnos -> Bool
set_first_spec_in_param :: Bool -> GlobalAnnos -> GlobalAnnos
type LiteralMap = Map Id LiteralType
a redundant map for LiteralAnnos
data LiteralType
description of the type of a literal for a given Id in LiteralMap
Constructors
StringCons Idrefer to the Id of the null string
StringNull
ListCons Id Idbrackets (as Id) and the Id of the matching null list
ListNull Idbrackets (as Id) for the empty list
Number
Fraction
Floating
NoLiteraland error value for a getLiteralType
Instances
ATermConvertible LiteralType
Show LiteralType
Eq LiteralType
getLiteralType :: GlobalAnnos -> Id -> LiteralType
the LiteralType of an Id (possibly NoLiteral)
type AssocMap = Map Id AssocEither
a map of associative ids
isAssoc :: AssocEither -> AssocMap -> Id -> Bool
check if Id has a given associativity
type PrecedenceGraph = Rel Id
a binary relation over ids as precedence graph
precRel
:: PrecedenceGraphGraph describing the precedences
-> Idx oID (y iid z) -- outer id
-> Idx oid (y iID z) -- inner id
-> PrecRel
return precedence relation of two ids
lookupDisplay :: GlobalAnnos -> Display_format -> Id -> Maybe [Token]
lookup of an display [string] in the GlobalAnnos record
data Display_format
formats to be displayed (may be extended in the future). Drop 3 from the show result to get the string for parsing and printing
Constructors
DF_HTML
DF_LATEX
DF_RTF
Instances
ATermConvertible Display_format
Show Display_format
Eq Display_format
Ord Display_format
Produced by Haddock version 0.6