diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-04-27 10:32:39 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-04-27 10:32:39 -0300 |
commit | 012cf9c86cf91cb8354e229bde335592d41b84b2 (patch) | |
tree | 353f17797b1952eaec231c8e4fd5c21e02daf875 /lpcset.h | |
parent | 3403b0c7256435560b63f828da92026c5d4c898b (diff) | |
download | lpeg-012cf9c86cf91cb8354e229bde335592d41b84b2.tar.gz lpeg-012cf9c86cf91cb8354e229bde335592d41b84b2.tar.bz2 lpeg-012cf9c86cf91cb8354e229bde335592d41b84b2.zip |
Compact charsets used in trees, too.
Diffstat (limited to 'lpcset.h')
-rw-r--r-- | lpcset.h | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -4,22 +4,27 @@ | |||
4 | 4 | ||
5 | #include "lpcset.h" | 5 | #include "lpcset.h" |
6 | #include "lpcode.h" | 6 | #include "lpcode.h" |
7 | #include "lptree.h" | ||
7 | 8 | ||
8 | 9 | ||
9 | /* | 10 | /* |
10 | ** Extra information for the result of 'charsettype'. When result is | 11 | ** Extra information for the result of 'charsettype'. When result is |
11 | ** IChar, 'aux1' is the character. When result is ISet, 'aux1' is the | 12 | ** IChar, 'offset' is the character. When result is ISet, 'cs' is the |
12 | ** offset (in bytes), 'size' is the size (in bytes), and | 13 | ** supporting bit array (with offset included), 'offset' is the offset |
13 | ** 'delt' is the default value for bytes outside the set. | 14 | ** (in bytes), 'size' is the size (in bytes), and 'delt' is the default |
15 | ** value for bytes outside the set. | ||
14 | */ | 16 | */ |
15 | typedef struct { | 17 | typedef struct { |
16 | int aux1; | 18 | const byte *cs; |
19 | int offset; | ||
17 | int size; | 20 | int size; |
18 | int deflt; | 21 | int deflt; |
19 | } charsetinfo; | 22 | } charsetinfo; |
20 | 23 | ||
21 | 24 | ||
25 | int tocharset (TTree *tree, Charset *cs); | ||
22 | Opcode charsettype (const byte *cs, charsetinfo *info); | 26 | Opcode charsettype (const byte *cs, charsetinfo *info); |
23 | byte getbytefromcharset (const byte *cs, const charsetinfo *info, int index); | 27 | byte getbytefromcharset (const charsetinfo *info, int index); |
28 | void tree2cset (TTree *tree, charsetinfo *info); | ||
24 | 29 | ||
25 | #endif | 30 | #endif |