1f46a6179Smrg/************************************************************
2f46a6179Smrg Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
3f46a6179Smrg
4f46a6179Smrg Permission to use, copy, modify, and distribute this
5f46a6179Smrg software and its documentation for any purpose and without
6f46a6179Smrg fee is hereby granted, provided that the above copyright
7f46a6179Smrg notice appear in all copies and that both that copyright
8f46a6179Smrg notice and this permission notice appear in supporting
9bfe6082cSmrg documentation, and that the name of Silicon Graphics not be
10bfe6082cSmrg used in advertising or publicity pertaining to distribution
11f46a6179Smrg of the software without specific prior written permission.
12bfe6082cSmrg Silicon Graphics makes no representation about the suitability
13f46a6179Smrg of this software for any purpose. It is provided "as is"
14f46a6179Smrg without any express or implied warranty.
15bfe6082cSmrg
16bfe6082cSmrg SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
17bfe6082cSmrg SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
18f46a6179Smrg AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
19bfe6082cSmrg GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
20bfe6082cSmrg DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21bfe6082cSmrg DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
22f46a6179Smrg OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
23f46a6179Smrg THE USE OR PERFORMANCE OF THIS SOFTWARE.
24f46a6179Smrg
25f46a6179Smrg ********************************************************/
26f46a6179Smrg
27f46a6179Smrg#ifndef XKBPARSE_H
28f46a6179Smrg#define	XKBPARSE_H 1
29f46a6179Smrg
30f46a6179Smrg#ifndef DEBUG_VAR
31f46a6179Smrg#define	DEBUG_VAR	parseDebug
32f46a6179Smrg#endif
33f46a6179Smrg
34f46a6179Smrg#include "xkbcomp.h"
35f46a6179Smrg
3683e5f723Smrgextern char scanBuf[1024];
3734345a63Smrgextern int scanInt;
3834345a63Smrgextern int lineNum;
39f46a6179Smrg
4034345a63Smrgextern XkbFile *rtrnValue;
41f46a6179Smrg
42f46a6179Smrg#ifdef DEBUG
43f46a6179Smrg#define	d(str)		fprintf(stderr,"%s\n",str);
44f46a6179Smrg#define d1(str,a)	fprintf(stderr,str,a);
45f46a6179Smrg#define d2(str,a,b)	fprintf(stderr,str,a,b);
46f46a6179Smrg#else
47f46a6179Smrg#define	d(str)
48f46a6179Smrg#define	d1(str,a)
49f46a6179Smrg#define d2(str,a,b)
50f46a6179Smrg#endif
51f46a6179Smrg
52f46a6179Smrg
5334345a63Smrgextern ParseCommon *AppendStmt(ParseCommon * /* to */ ,
5434345a63Smrg                               ParseCommon *    /* append */
5534345a63Smrg    );
5634345a63Smrg
5734345a63Smrgextern ExprDef *ExprCreate(unsigned /* op */ ,
5834345a63Smrg                           unsigned     /* type */
5934345a63Smrg    );
6034345a63Smrg
6134345a63Smrgextern ExprDef *ExprCreateUnary(unsigned /* op */ ,
6234345a63Smrg                                unsigned /* type */ ,
6334345a63Smrg                                ExprDef *       /* child */
6434345a63Smrg    );
6534345a63Smrg
6634345a63Smrgextern ExprDef *ExprCreateBinary(unsigned /* op */ ,
6734345a63Smrg                                 ExprDef * /* left */ ,
6834345a63Smrg                                 ExprDef *      /* right */
6934345a63Smrg    );
7034345a63Smrg
716930ead5Smrgextern KeycodeDef *KeycodeCreate(const char * /* name */ ,
7234345a63Smrg                                 ExprDef *      /* value */
7334345a63Smrg    );
7434345a63Smrg
756930ead5Smrgextern KeyAliasDef *KeyAliasCreate(const char * /* alias */ ,
766930ead5Smrg                                   const char * /* real */
7734345a63Smrg    );
7834345a63Smrg
7934345a63Smrgextern VModDef *VModCreate(Atom /* name */ ,
8034345a63Smrg                           ExprDef *    /* value */
8134345a63Smrg    );
8234345a63Smrg
8334345a63Smrgextern VarDef *VarCreate(ExprDef * /* name */ ,
8434345a63Smrg                         ExprDef *      /* value */
8534345a63Smrg    );
8634345a63Smrg
8734345a63Smrgextern VarDef *BoolVarCreate(Atom /* nameToken */ ,
8834345a63Smrg                             unsigned   /* set */
8934345a63Smrg    );
9034345a63Smrg
91690143ccSmrgextern InterpDef *InterpCreate(const char * /* sym_str */ ,
9234345a63Smrg                               ExprDef *        /* match */
9334345a63Smrg    );
9434345a63Smrg
9534345a63Smrgextern KeyTypeDef *KeyTypeCreate(Atom /* name */ ,
9634345a63Smrg                                 VarDef *       /* body */
9734345a63Smrg    );
9834345a63Smrg
9934345a63Smrgextern SymbolsDef *SymbolsCreate(char * /* keyName */ ,
10034345a63Smrg                                 ExprDef *      /* symbols */
10134345a63Smrg    );
10234345a63Smrg
10334345a63Smrgextern GroupCompatDef *GroupCompatCreate(int /* group */ ,
10434345a63Smrg                                         ExprDef *      /* def */
10534345a63Smrg    );
10634345a63Smrg
10734345a63Smrgextern ModMapDef *ModMapCreate(Atom /* modifier */ ,
10834345a63Smrg                               ExprDef *        /* keys */
10934345a63Smrg    );
11034345a63Smrg
11134345a63Smrgextern IndicatorMapDef *IndicatorMapCreate(Atom /* name */ ,
11234345a63Smrg                                           VarDef *     /* body */
11334345a63Smrg    );
11434345a63Smrg
11534345a63Smrgextern IndicatorNameDef *IndicatorNameCreate(int /* ndx */ ,
11634345a63Smrg                                             ExprDef * /* name */ ,
11734345a63Smrg                                             Bool       /* virtual */
11834345a63Smrg    );
11934345a63Smrg
12034345a63Smrgextern ExprDef *ActionCreate(Atom /* name */ ,
12134345a63Smrg                             ExprDef *  /* args */
12234345a63Smrg    );
12334345a63Smrg
12483e5f723Smrgextern ExprDef *CreateKeysymList(char * /* sym */
12534345a63Smrg    );
12634345a63Smrg
12734345a63Smrgextern ShapeDef *ShapeDeclCreate(Atom /* name */ ,
12834345a63Smrg                                 OutlineDef *   /* outlines */
12934345a63Smrg    );
13034345a63Smrg
13134345a63Smrgextern OutlineDef *OutlineCreate(Atom /* field */ ,
13234345a63Smrg                                 ExprDef *      /* points */
13334345a63Smrg    );
13434345a63Smrg
13534345a63Smrgextern KeyDef *KeyDeclCreate(char * /* name */ ,
13634345a63Smrg                             ExprDef *  /* expr */
13734345a63Smrg    );
13834345a63Smrg
13934345a63Smrgextern KeyDef *KeyDeclMerge(KeyDef * /* into */ ,
14034345a63Smrg                            KeyDef *    /* from */
14134345a63Smrg    );
14234345a63Smrg
14334345a63Smrgextern RowDef *RowDeclCreate(KeyDef *   /* keys */
14434345a63Smrg    );
14534345a63Smrg
14634345a63Smrgextern SectionDef *SectionDeclCreate(Atom /* name */ ,
14734345a63Smrg                                     RowDef *   /* rows */
14834345a63Smrg    );
14934345a63Smrg
15034345a63Smrgextern OverlayKeyDef *OverlayKeyCreate(char * /* under */ ,
15134345a63Smrg                                       char *   /* over  */
15234345a63Smrg    );
15334345a63Smrg
15434345a63Smrgextern OverlayDef *OverlayDeclCreate(Atom /* name */ ,
15534345a63Smrg                                     OverlayKeyDef *    /* rows */
15634345a63Smrg    );
15734345a63Smrg
15834345a63Smrgextern DoodadDef *DoodadCreate(unsigned /* type */ ,
15934345a63Smrg                               Atom /* name */ ,
16034345a63Smrg                               VarDef * /* body */
16134345a63Smrg    );
16234345a63Smrg
16334345a63Smrgextern ExprDef *AppendKeysymList(ExprDef * /* list */ ,
16483e5f723Smrg                                 char * /* sym */
16534345a63Smrg    );
16634345a63Smrg
167690143ccSmrgextern int LookupKeysym(const char * /* str */ ,
16834345a63Smrg                        KeySym *        /* sym_rtrn */
16934345a63Smrg    );
17034345a63Smrg
17134345a63Smrgextern IncludeStmt *IncludeCreate(char * /* str */ ,
17234345a63Smrg                                  unsigned      /* merge */
17334345a63Smrg    );
17434345a63Smrg
17534345a63Smrgextern unsigned StmtSetMerge(ParseCommon * /* stmt */ ,
17634345a63Smrg                             unsigned   /* merge */
17734345a63Smrg    );
178f46a6179Smrg
179f46a6179Smrg#ifdef DEBUG
18034345a63Smrgextern void PrintStmtAddrs(ParseCommon *        /* stmt */
18134345a63Smrg    );
182f46a6179Smrg#endif
183f46a6179Smrg
18434345a63Smrgextern int XKBParseFile(FILE * /* file */ ,
18534345a63Smrg                        XkbFile **      /* pRtrn */
18634345a63Smrg    );
187f46a6179Smrg
18834345a63Smrgextern XkbFile *CreateXKBFile(int /* type */ ,
18934345a63Smrg                              char * /* name */ ,
19034345a63Smrg                              ParseCommon * /* defs */ ,
19134345a63Smrg                              unsigned  /* flags */
19234345a63Smrg    );
193f46a6179Smrg
19434345a63Smrgextern void yyerror(const char *        /* s */
19534345a63Smrg    );
196f46a6179Smrg
19734345a63Smrgextern int yywrap(void);
198f46a6179Smrg
199f46a6179Smrgextern int yylex(void);
200f46a6179Smrgextern int yyparse(void);
201c82dfdfbSmrgextern void scan_set_file(FILE *file);
202f46a6179Smrg
20334345a63Smrgextern int setScanState(char * /* file */ ,
20434345a63Smrg                        int     /* line */
20534345a63Smrg    );
206f46a6179Smrg
207f46a6179Smrg#endif /* XKBPARSE_H */
208