1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
module CPP.ICode.ParseTypes (
module CPP.ICode.ParseMonad,
module CPP.ICode.ParsePos,
module CPP.ICode.ParseError,
module CPP.ICode.ParseTypes,
module CPP.ICode.ParseWarning
) where
import CPP.ICode.ParseMonad
import CPP.ICode.ParsePos
import CPP.ICode.ParseError
import CPP.ICode.ParseWarning
type LangParser = Pos -> String -> IO (PM String)
type Langtag = String
data StandardToken = StTk Pos Pos (Maybe Langtag) Code
type Code = String
type Offset = Int
getIdentPos :: StandardToken -> Pos
getIdentPos (StTk p _ _ _) = p
getCodePos :: StandardToken -> Pos
getCodePos (StTk _ p _ _) = p
getOffset :: StandardToken -> Offset
getOffset = getCol . getCodePos
getLangtag :: StandardToken -> Maybe Langtag
getLangtag (StTk _ _ l _) = l
getCode :: StandardToken -> Code
getCode (StTk _ _ _ c) = c
containsDSL :: StandardToken -> Bool
containsDSL (StTk _ _ (Just _) _) = True
containsDSL (StTk _ _ Nothing _) = False
|