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