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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
typedef
enum
{
IdentToken, IntToken, CharToken,
StringToken, RealToken, AnnotToken, InstructionToken,
EOFToken,
errorsym, barsym, strictsym, opensym,
closesym, opensquaresym, closesquaresym, colonsym,
typesym, semicolonsym, commasym, dotsym, openbracesym,
closebracesym, arrowsym, abstypesym,
arraysym, strictarraysym, unboxedarraysym,
atsym,boolsym, codesym, charsym,defsym,
falsesym, filesym, fromsym, ifsym, impsym,
allsym,
importsym, intsym, macrosym, modulesym, procidsym, redidsym,
realsym, rulesym, stringsym,
systemsym, truesym, typedefsym, applysym,
uniquesym, worldsym,
NumberOfKeywords /* make sure that this constant is the last one */
} KeywordKind;
extern char **ReservedWords;
enum
{
/* 0 .. 255 are reserved for single ascii characters */
kTokenImport = 256, kTokenFrom, kTokenDefinition, kTokenImplementation,
kTokenSystem, kTokenModule,
kTokenLet, kTokenIn, kTokenCase, kTokenOf,
kTokenWith, kTokenWhere, kTokenEquals, kTokenEqualColon,
kTokenColonDoubleEqual, kTokenDoubleBackSlash,
kTokenDoubleRightArrow,
kTokenLeftArrow, kTokenLeftArrowColon, kTokenRightArrow,
kTokenInfix, kTokenInfixL, kTokenInfixR,
kTokenDotDot, kTokenDoubleColon,
kTokenProcessOpen, kTokenProcessClose,
kTokenChar, kTokenMultiChar, kTokenString, kTokenInt, kTokenReal,
kTokenLowerIdentifier, kTokenUpperIdentifier, kTokenUnderscoreIdentifier,
kTokenCode, kTokenInstruction,
kTokenFalse, kTokenTrue,
kTokenIf, kTokenAll,
kNoToken, kTokenEOF,
kTokenHashExclamationMark,
kTokenOverload, kTokenInstance, kTokenClass,
kTokenExport,
#ifdef H
kTokenData, kTokenType, kTokenAtSign, kTokenThen, kTokenElse, kTokenInterface,
#endif
kTokenDefault, kTokenResync
};
typedef unsigned int Token;
extern IdentP PutStringInHashTable (char *string, TableKind tabkind);
extern IdentP PutIdentStringInTable (IdentStringP identString, TableKind tabkind);
extern void InitScanner (void);
extern void ScanInitialise (void);
extern void ScanInitIdentStringTable (void);
extern void ScanInlineFile (char *fname,TableKind table_kind);
|