-
Notifications
You must be signed in to change notification settings - Fork 0
/
COSStyleDefine.h
58 lines (46 loc) · 1.39 KB
/
COSStyleDefine.h
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
#include <stdio.h>
#define YYSTYPE char *
#define COSSTYLE_INVALID -1
#define YY_DECL int COSStylelex (yyscan_t yyscanner, char **token_value)
enum COSStyleNodeType {
COSStyleNodeTypeVal = 1,
COSStyleNodeTypeProp,
COSStyleNodeTypeDecl,
COSStyleNodeTypeDeclList,
COSStyleNodeTypeCls,
COSStyleNodeTypeClsList,
COSStyleNodeTypeSel,
COSStyleNodeTypeSelList,
COSStyleNodeTypeRule,
COSStyleNodeTypeRuleList,
COSStyleNodeTypeSheet,
};
typedef enum COSStyleNodeType COSStyleNodeType;
enum COSStyleNodeValType {
COSStyleNodeValTypeID = 1,
COSStyleNodeValTypeString,
COSStyleNodeValTypeHex,
COSStyleNodeValTypeExpression,
COSStyleNodeValTypeSize,
};
typedef enum COSStyleNodeValType COSStyleNodeValType;
struct COSStyleAST {
COSStyleNodeType nodeType;
void *nodeValue;
COSStyleNodeValType nodeValueType;
struct COSStyleAST *l;
struct COSStyleAST *r;
void *data;
};
typedef struct COSStyleAST COSStyleAST;
struct COSStyleCtx {
int result;
struct COSStyleAST *ast;
};
typedef struct COSStyleCtx COSStyleCtx;
void *COSStyleParseAlloc(void *(*mallocProc)(size_t));
void COSStyleParse(void *parser, int token, char *value, COSStyleCtx *cxt);
void COSStyleParseFree(void *p, void (*freeProc)(void*));
void COSStyleCtxInit(COSStyleCtx *ctx);
void COSStylePrintAstAsDot(COSStyleAST *astp);
void COSStyleCtxFree(COSStyleCtx ctx);