2009-03-27 07:55:32 -06:00
|
|
|
/************************************************************
|
|
|
|
Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
|
|
|
|
|
|
|
|
Permission to use, copy, modify, and distribute this
|
|
|
|
software and its documentation for any purpose and without
|
|
|
|
fee is hereby granted, provided that the above copyright
|
|
|
|
notice appear in all copies and that both that copyright
|
|
|
|
notice and this permission notice appear in supporting
|
2009-04-04 10:19:51 -06:00
|
|
|
documentation, and that the name of Silicon Graphics not be
|
|
|
|
used in advertising or publicity pertaining to distribution
|
2009-03-27 07:55:32 -06:00
|
|
|
of the software without specific prior written permission.
|
2009-04-04 10:19:51 -06:00
|
|
|
Silicon Graphics makes no representation about the suitability
|
2009-03-27 07:55:32 -06:00
|
|
|
of this software for any purpose. It is provided "as is"
|
|
|
|
without any express or implied warranty.
|
2009-04-04 10:19:51 -06:00
|
|
|
|
|
|
|
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
|
|
|
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
2009-03-27 07:55:32 -06:00
|
|
|
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
|
2009-04-04 10:19:51 -06:00
|
|
|
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
|
|
|
|
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
|
|
|
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
2009-03-27 07:55:32 -06:00
|
|
|
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
|
|
|
|
THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
|
|
|
********************************************************/
|
|
|
|
|
2012-05-09 02:12:30 -06:00
|
|
|
#ifndef PARSEUTILS_H
|
|
|
|
#define PARSEUTILS_H
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-05-08 04:57:07 -06:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "xkbcomp-priv.h"
|
|
|
|
#include "parser.h"
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-03-27 15:41:22 -06:00
|
|
|
struct parser_param {
|
2012-05-09 06:03:11 -06:00
|
|
|
struct xkb_ctx *ctx;
|
2012-03-27 15:41:22 -06:00
|
|
|
void *scanner;
|
|
|
|
XkbFile *rtrn;
|
|
|
|
};
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-03-27 15:41:22 -06:00
|
|
|
struct scanner_extra {
|
|
|
|
char *scanFile;
|
2012-04-08 11:58:39 -06:00
|
|
|
char scanBuf[1024];
|
2012-03-27 15:41:22 -06:00
|
|
|
char *s;
|
|
|
|
};
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern ParseCommon *
|
|
|
|
AppendStmt(ParseCommon *to, ParseCommon *append);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern ExprDef *
|
|
|
|
ExprCreate(unsigned op, unsigned type);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern ExprDef *
|
|
|
|
ExprCreateUnary(unsigned op, unsigned type, ExprDef *child);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern ExprDef *
|
|
|
|
ExprCreateBinary(unsigned op, ExprDef *left, ExprDef *right);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern KeycodeDef *
|
|
|
|
KeycodeCreate(const char *name, unsigned long value);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern KeyAliasDef *
|
|
|
|
KeyAliasCreate(const char *alias, const char *real);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern VModDef *
|
|
|
|
VModCreate(xkb_atom_t name, ExprDef *value);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern VarDef *
|
|
|
|
VarCreate(ExprDef *name, ExprDef *value);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern VarDef *
|
|
|
|
BoolVarCreate(xkb_atom_t nameToken, unsigned set);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern InterpDef *
|
|
|
|
InterpCreate(char *sym, ExprDef *match);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern KeyTypeDef *
|
|
|
|
KeyTypeCreate(xkb_atom_t name, VarDef *body);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern SymbolsDef *
|
|
|
|
SymbolsCreate(const char *keyName, ExprDef *symbols);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern GroupCompatDef *
|
|
|
|
GroupCompatCreate(int group, ExprDef *def);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern ModMapDef *
|
|
|
|
ModMapCreate(uint32_t modifier, ExprDef *keys);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern IndicatorMapDef *
|
|
|
|
IndicatorMapCreate(xkb_atom_t name, VarDef *body);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern IndicatorNameDef *
|
2012-04-05 18:38:55 -06:00
|
|
|
IndicatorNameCreate(int ndx, ExprDef *name, bool virtual);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern ExprDef *
|
|
|
|
ActionCreate(xkb_atom_t name, ExprDef *args);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern ExprDef *
|
|
|
|
CreateMultiKeysymList(ExprDef *list);
|
2012-03-29 09:31:09 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern ExprDef *
|
|
|
|
CreateKeysymList(char *sym);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern ExprDef *
|
|
|
|
AppendMultiKeysymList(ExprDef *list, ExprDef *append);
|
2012-03-29 09:31:09 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern ExprDef *
|
|
|
|
AppendKeysymList(ExprDef *list, char *sym);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern int
|
|
|
|
LookupKeysym(const char *str, xkb_keysym_t *sym_rtrn);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern IncludeStmt *
|
|
|
|
IncludeCreate(char *str, unsigned merge);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern unsigned
|
2012-05-07 07:23:46 -06:00
|
|
|
StmtSetMerge(ParseCommon *stmt, unsigned merge, struct YYLTYPE *loc, void *scanner);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern void
|
|
|
|
CheckDefaultMap(XkbFile *maps, const char *fileName);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-05-09 02:12:30 -06:00
|
|
|
extern XkbFile *
|
2012-05-09 06:03:11 -06:00
|
|
|
CreateXKBFile(struct xkb_ctx *ctx, int type, char *name,
|
2012-05-09 02:12:30 -06:00
|
|
|
ParseCommon *defs, unsigned flags);
|
2010-10-19 19:57:59 -06:00
|
|
|
|
2012-05-09 02:12:30 -06:00
|
|
|
extern bool
|
2012-05-09 06:03:11 -06:00
|
|
|
XKBParseFile(struct xkb_ctx *ctx, FILE *file,
|
2012-05-09 02:12:30 -06:00
|
|
|
const char *file_name, XkbFile **out);
|
2011-06-03 09:19:09 -06:00
|
|
|
|
2012-05-09 02:12:30 -06:00
|
|
|
extern bool
|
2012-05-09 06:03:11 -06:00
|
|
|
XKBParseString(struct xkb_ctx *context, const char *string,
|
|
|
|
const char *file_name, XkbFile **out);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern void
|
|
|
|
FreeXKBFile(XkbFile *file);
|
2012-03-01 12:20:45 -07:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern void
|
|
|
|
FreeStmt(ParseCommon *stmt);
|
2012-03-15 03:34:20 -06:00
|
|
|
|
2012-04-05 02:24:39 -06:00
|
|
|
extern void
|
|
|
|
yyerror(struct YYLTYPE *loc, void *scanner, const char *msg);
|
2012-03-27 15:41:22 -06:00
|
|
|
|
2012-05-09 02:12:30 -06:00
|
|
|
#endif /* PARSEUTILS_H */
|