hets -- a heterogenous Specification (CASL) tool setContentsIndex
Common.AS_Annotation
Portability portable
Stability provisional
Maintainer hets@tzi.de
Description
These datastructures describe the Annotations of (Het)CASL. There is also a paramterized data type for an Annoted item.
Synopsis
data Annote_word
= Annote_word String
| Comment_start
data Annote_text
= Line_anno String
| Group_anno [String]
data Display_format
= DF_HTML
| DF_LATEX
| DF_RTF
swap :: (a, b) -> (b, a)
swapTable :: [(a, b)] -> [(b, a)]
toTable :: Show a => [a] -> [(a, String)]
display_format_table :: [(Display_format, String)]
lookupDisplayFormat :: Display_format -> String
data PrecRel
= Higher
| Lower
| BothDirections
| NoDirection
data AssocEither
= ALeft
| ARight
data Semantic_anno
= SA_cons
| SA_def
| SA_implies
| SA_mono
| SA_implied
semantic_anno_table :: [(Semantic_anno, String)]
lookupSemanticAnno :: Semantic_anno -> String
data Annotation
= Unparsed_anno Annote_word Annote_text [Pos]
| Display_anno Id [(Display_format, String)] [Pos]
| List_anno Id Id Id [Pos]
| Number_anno Id [Pos]
| Float_anno Id Id [Pos]
| String_anno Id Id [Pos]
| Prec_anno PrecRel [Id] [Id] [Pos]
| Assoc_anno AssocEither [Id] [Pos]
| Label [String] [Pos]
| Semantic_anno Semantic_anno [Pos]
isLabel :: Annotation -> Bool
isImplied :: Annotation -> Bool
isSemanticAnno :: Annotation -> Bool
isComment :: Annotation -> Bool
isAnnote :: Annotation -> Bool
data Annoted a = Annoted {
item :: a
opt_pos :: [Pos]
l_annos, r_annos :: [Annotation]
}
mapAnM :: Monad m => (a -> m b) -> [Annoted a] -> m [Annoted b]
replaceAnnoted :: b -> Annoted a -> Annoted b
appendAnno :: Annoted a -> [Annotation] -> Annoted a
addLeftAnno :: [Annotation] -> a -> Annoted a
getRLabel :: Annoted a -> String
Documentation
data Annote_word
start of an annote with its WORD or a comment
Constructors
Annote_word String
Comment_start
Instances
ATermConvertible Annote_word
Show Annote_word
Eq Annote_word
data Annote_text
line or group for Unparsed_anno
Constructors
Line_anno String
Group_anno [String]
Instances
ATermConvertible Annote_text
Show Annote_text
Eq Annote_text
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
swap :: (a, b) -> (b, a)
swap a pair
swapTable :: [(a, b)] -> [(b, a)]
swap the entries of a lookup table
toTable :: Show a => [a] -> [(a, String)]
drop the first 3 characters from the show result
display_format_table :: [(Display_format, String)]
a lookup table for the textual representation of display formats
lookupDisplayFormat :: Display_format -> String
lookup the textual representation of a display format in display_format_table
data PrecRel
precedence Lower means less and BothDirections means less and greater. Higher means greater but this is syntactically not allowed in Prec_anno. NoDirection can also not be specified explicitly, but covers those ids that are not mentionend in precedences.
Constructors
Higher
Lower
BothDirections
NoDirection
Instances
ATermConvertible PrecRel
Show PrecRel
Eq PrecRel
data AssocEither
either left or right associative
Constructors
ALeft
ARight
Instances
ATermConvertible AssocEither
Show AssocEither
Eq AssocEither
data Semantic_anno
semantic (line) annotations without further information. Use the same drop-3-trick as for the Display_format.
Constructors
SA_cons
SA_def
SA_implies
SA_mono
SA_implied
Instances
ATermConvertible Semantic_anno
Show Semantic_anno
Eq Semantic_anno
semantic_anno_table :: [(Semantic_anno, String)]
a lookup table for the textual representation of semantic annos
lookupSemanticAnno :: Semantic_anno -> String
lookup the textual representation of a semantic anno in semantic_anno_table
data Annotation
all possible annotations (without comment-outs)
Constructors
Unparsed_anno Annote_word Annote_text [Pos]constructor for comments or unparsed annotes
Display_anno Id [(Display_format, String)] [Pos]known annotes
List_anno Id Id Id [Pos]
Number_anno Id [Pos]
Float_anno Id Id [Pos]
String_anno Id Id [Pos]
Prec_anno PrecRel [Id] [Id] [Pos]
Assoc_anno AssocEither [Id] [Pos]
Label [String] [Pos]
Semantic_anno Semantic_anno [Pos]
Instances
ATermConvertible Annotation
ATermConvertibleSML Annotation
Eq Annotation
PosItem Annotation
Show Annotation
PrettyPrint Annotation
isLabel :: Annotation -> Bool
isLabel tests if the given Annotation is a label (a Label typically follows a formula)
isImplied :: Annotation -> Bool
isSemanticAnno :: Annotation -> Bool
isSemanticAnno tests if the given Annotation is a semantic one
isComment :: Annotation -> Bool
isComment tests if the given Annotation is a comment line or a comment group
isAnnote :: Annotation -> Bool
isAnnote is the invers function to isComment
data Annoted a
an item wrapped in preceeding (left l_annos) and following (right r_annos) annotations. opt_pos should carry the position of an optional semicolon following a formula (but is currently unused).
Constructors
Annoted
item :: a
opt_pos :: [Pos]
l_annos, r_annos :: [Annotation]
Instances
ATermConvertible a => ATermConvertible (Annoted a)
ATermConvertibleSML a => ATermConvertibleSML (Annoted a)
Show a => Show (Annoted a)
Eq a => Eq (Annoted a)
ListCheck a => ListCheck (Annoted a)
PrettyPrint a => PrettyPrint (Annoted a)
mapAnM :: Monad m => (a -> m b) -> [Annoted a] -> m [Annoted b]
process all items and wrap matching annotations around the results
replaceAnnoted :: b -> Annoted a -> Annoted b
replace the item
appendAnno :: Annoted a -> [Annotation] -> Annoted a
add further following annotations
addLeftAnno :: [Annotation] -> a -> Annoted a
put together preceding annotations and an item
getRLabel :: Annoted a -> String
get the label following (or to the right of) an item
Produced by Haddock version 0.6