Introduce xkb_keycode_t for keycodes
[platform/upstream/libxkbcommon.git] / src / xkbcomp / parseutils.h
1 /************************************************************
2  Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
3
4  Permission to use, copy, modify, and distribute this
5  software and its documentation for any purpose and without
6  fee is hereby granted, provided that the above copyright
7  notice appear in all copies and that both that copyright
8  notice and this permission notice appear in supporting
9  documentation, and that the name of Silicon Graphics not be
10  used in advertising or publicity pertaining to distribution
11  of the software without specific prior written permission.
12  Silicon Graphics makes no representation about the suitability
13  of this software for any purpose. It is provided "as is"
14  without any express or implied warranty.
15
16  SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
17  SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
18  AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
19  GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
20  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
22  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
23  THE USE OR PERFORMANCE OF THIS SOFTWARE.
24
25  ********************************************************/
26
27 #ifndef XKBPARSE_H
28 #define XKBPARSE_H 1
29
30 #include "xkbcomp.h"
31
32 extern char scanBuf[1024];
33 extern int scanInt;
34 extern int lineNum;
35
36 extern XkbFile *rtrnValue;
37
38 #ifdef DEBUG
39 #define d(str)          fprintf(stderr,"%s\n",str);
40 #define d1(str,a)       fprintf(stderr,str,a);
41 #define d2(str,a,b)     fprintf(stderr,str,a,b);
42 #else
43 #define d(str)
44 #define d1(str,a)
45 #define d2(str,a,b)
46 #endif
47
48
49 extern ParseCommon *AppendStmt(ParseCommon * /* to */ ,
50                                ParseCommon *    /* append */
51     );
52
53 extern ExprDef *ExprCreate(unsigned /* op */ ,
54                            unsigned     /* type */
55     );
56
57 extern ExprDef *ExprCreateUnary(unsigned /* op */ ,
58                                 unsigned /* type */ ,
59                                 ExprDef *       /* child */
60     );
61
62 extern ExprDef *ExprCreateBinary(unsigned /* op */ ,
63                                  ExprDef * /* left */ ,
64                                  ExprDef *      /* right */
65     );
66
67 extern KeycodeDef *KeycodeCreate(char * /* name */ ,
68                                  ExprDef *      /* value */
69     );
70
71 extern KeyAliasDef *KeyAliasCreate(char * /* alias */ ,
72                                    char *       /* real */
73     );
74
75 extern VModDef *VModCreate(uint32_t /* name */ ,
76                            ExprDef *    /* value */
77     );
78
79 extern VarDef *VarCreate(ExprDef * /* name */ ,
80                          ExprDef *      /* value */
81     );
82
83 extern VarDef *BoolVarCreate(uint32_t /* nameToken */ ,
84                              unsigned   /* set */
85     );
86
87 extern InterpDef *InterpCreate(char * /* sym */ ,
88                                ExprDef *        /* match */
89     );
90
91 extern KeyTypeDef *KeyTypeCreate(uint32_t /* name */ ,
92                                  VarDef *       /* body */
93     );
94
95 extern SymbolsDef *SymbolsCreate(char * /* keyName */ ,
96                                  ExprDef *      /* symbols */
97     );
98
99 extern GroupCompatDef *GroupCompatCreate(int /* group */ ,
100                                          ExprDef *      /* def */
101     );
102
103 extern ModMapDef *ModMapCreate(uint32_t /* modifier */ ,
104                                ExprDef *        /* keys */
105     );
106
107 extern IndicatorMapDef *IndicatorMapCreate(uint32_t /* name */ ,
108                                            VarDef *     /* body */
109     );
110
111 extern IndicatorNameDef *IndicatorNameCreate(int /* ndx */ ,
112                                              ExprDef * /* name */ ,
113                                              Bool       /* virtual */
114     );
115
116 extern ExprDef *ActionCreate(uint32_t /* name */ ,
117                              ExprDef *  /* args */
118     );
119
120 extern ExprDef *CreateKeysymList(char * /* sym */
121     );
122
123 extern ShapeDef *ShapeDeclCreate(uint32_t /* name */ ,
124                                  OutlineDef *   /* outlines */
125     );
126
127 extern OutlineDef *OutlineCreate(uint32_t /* field */ ,
128                                  ExprDef *      /* points */
129     );
130
131 extern KeyDef *KeyDeclCreate(char * /* name */ ,
132                              ExprDef *  /* expr */
133     );
134
135 extern RowDef *RowDeclCreate(KeyDef *   /* keys */
136     );
137
138 extern SectionDef *SectionDeclCreate(uint32_t /* name */ ,
139                                      RowDef *   /* rows */
140     );
141
142 extern OverlayKeyDef *OverlayKeyCreate(char * /* under */ ,
143                                        char *   /* over  */
144     );
145
146 extern OverlayDef *OverlayDeclCreate(uint32_t /* name */ ,
147                                      OverlayKeyDef *    /* rows */
148     );
149
150 extern DoodadDef *DoodadCreate(unsigned /* type */ ,
151                                uint32_t /* name */ ,
152                                VarDef * /* body */
153     );
154
155 extern ExprDef *AppendKeysymList(ExprDef * /* list */ ,
156                                  char * /* sym */
157     );
158
159 extern int LookupKeysym(char * /* str */ ,
160                         uint32_t *        /* sym_rtrn */
161     );
162
163 extern IncludeStmt *IncludeCreate(char * /* str */ ,
164                                   unsigned      /* merge */
165     );
166
167 extern unsigned StmtSetMerge(ParseCommon * /* stmt */ ,
168                              unsigned   /* merge */
169     );
170
171 #ifdef DEBUG
172 extern void PrintStmtAddrs(ParseCommon *        /* stmt */
173     );
174 #endif
175
176 extern int XKBParseFile(FILE * /* file */ ,
177                         XkbFile **      /* pRtrn */
178     );
179
180 extern int XKBParseString(const char *string, XkbFile ** pRtrn);
181
182 extern void CheckDefaultMap(XkbFile * maps);
183
184 extern XkbFile *CreateXKBFile(int /* type */ ,
185                               char * /* name */ ,
186                               ParseCommon * /* defs */ ,
187                               unsigned  /* flags */
188     );
189
190 extern void yyerror(const char *        /* s */
191     );
192
193 extern int yylex(void);
194 extern int yyparse(void);
195
196 extern void setScanState(char * /* file */ ,
197                          int     /* line */
198     );
199
200 extern FILE *yyin;
201 extern const char *yystring;
202
203 #endif /* XKBPARSE_H */