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