|
@@ -11,18 +11,19 @@
|
11
|
11
|
// Predefined Lexer Id's
|
12
|
12
|
enum
|
13
|
13
|
{
|
14
|
|
- kErrorLexTId, // 0 the lexer was unable to identify the current token
|
15
|
|
- kUnknownLexTId, // 1 the token is of an unknown type (only used when kReturnUnknownLexFl is set)
|
16
|
|
- kEofLexTId, // 2 the lexer reached the end of input
|
17
|
|
- kSpaceLexTId, // 3 white space
|
18
|
|
- kRealLexTId, // 4 real number (contains a decimal point or is in scientific notation)
|
19
|
|
- kIntLexTId, // 5 decimal integer
|
20
|
|
- kHexLexTId, // 6 hexidecimal integer
|
21
|
|
- kIdentLexTId, // 7 identifier
|
22
|
|
- kQStrLexTId, // 8 quoted string
|
23
|
|
- kBlockCmtLexTId, // 9 block comment
|
24
|
|
- kLineCmtLexTId, // 10 line comment
|
25
|
|
- kUserLexTId // 11 user registered token (See cmLexRegisterToken().)
|
|
14
|
+ kErrorLexTId, // 0 the lexer was unable to identify the current token
|
|
15
|
+ kUnknownLexTId, // 1 the token is of an unknown type (only used when kReturnUnknownLexFl is set)
|
|
16
|
+ kEofLexTId, // 2 the lexer reached the end of input
|
|
17
|
+ kSpaceLexTId, // 3 white space
|
|
18
|
+ kRealLexTId, // 4 real number (contains a decimal point or is in scientific notation)
|
|
19
|
+ kIntLexTId, // 5 decimal integer
|
|
20
|
+ kHexLexTId, // 6 hexidecimal integer
|
|
21
|
+ kIdentLexTId, // 7 identifier
|
|
22
|
+ kQStrLexTId, // 8 quoted string
|
|
23
|
+ kQCharLexTId, // 9 quoted char
|
|
24
|
+ kBlockCmtLexTId, // 10 block comment
|
|
25
|
+ kLineCmtLexTId, // 11 line comment
|
|
26
|
+ kUserLexTId // 12 user registered token (See cmLexRegisterToken().)
|
26
|
27
|
};
|
27
|
28
|
|
28
|
29
|
// Lexer control flags used with cmLexInit().
|
|
@@ -31,7 +32,8 @@ enum
|
31
|
32
|
kReturnSpaceLexFl = 0x01, //< Return space tokens
|
32
|
33
|
kReturnCommentsLexFl = 0x02, //< Return comment tokens
|
33
|
34
|
kReturnUnknownLexFl = 0x04, //< Return unknown tokens
|
34
|
|
- kUserDefPriorityLexFl= 0x08 //< User defined tokens take priority even if a kIdentLexTId token has a longer match
|
|
35
|
+ kReturnQCharLexFl = 0x08, //< Return quoted characters
|
|
36
|
+ kUserDefPriorityLexFl= 0x10 //< User defined tokens take priority even if a kIdentLexTId token has a longer match
|
35
|
37
|
};
|
36
|
38
|
|
37
|
39
|
// cmLex result codes.
|
|
@@ -84,7 +86,7 @@ cmRC_t cmLexSetFile( cmLexH h, const cmChar_t* fn );
|
84
|
86
|
cmRC_t cmLexRegisterToken( cmLexH h, unsigned id, const cmChar_t* token );
|
85
|
87
|
|
86
|
88
|
// Register a user defined token recognition function. This function should return the count
|
87
|
|
-// of initial, consecutive, characters in 'cp' which match its token pattern.
|
|
89
|
+// of initial, consecutive, characters in 'cp[cn]' which match its token pattern.
|
88
|
90
|
typedef unsigned (*cmLexUserMatcherPtr_t)( const cmChar_t* cp, unsigned cn );
|
89
|
91
|
|
90
|
92
|
cmRC_t cmLexRegisterMatcher( cmLexH h, unsigned id, cmLexUserMatcherPtr_t funcPtr );
|