=================================================================== RCS file: /home/cvs/OpenXM/src/ox_toolkit/parse.h,v retrieving revision 1.2 retrieving revision 1.4 diff -u -p -r1.2 -r1.4 --- OpenXM/src/ox_toolkit/parse.h 1999/12/22 11:26:37 1.2 +++ OpenXM/src/ox_toolkit/parse.h 2000/03/10 12:24:39 1.4 @@ -1,22 +1,29 @@ -/* -*- mode: C; coding: euc-japan -*- */ -/* $OpenXM: OpenXM/src/ox_toolkit/parse.h,v 1.1 1999/12/09 22:44:56 ohara Exp $ */ +/* -*- mode: C -*- */ +/* $OpenXM: OpenXM/src/ox_toolkit/parse.h,v 1.3 2000/01/17 19:55:56 ohara Exp $ */ #ifndef _PARSE_H_ -#include "ox.h" - #define _PARSE_H_ -/* トークンの定義 */ -/* 256 より小さいものは、一文字だけのトークンである */ +struct symbol { + char *key; + int tag; + int token; + int type; +}; -#define T_INTEGER 257 +#include "ox_toolkit.h" + +/* Remarks: a token, which is less than 256, means a one character token. */ + +/* The followings are definitions of some tokens. */ +#define T_DIGIT 257 #define T_STRING 258 #define T_MAGIC 2048 #define TOKEN(x) (T_MAGIC + (x)) #define SM SM_popCMO -/* トークンの種類を判定するためのマクロ */ +/* Macros for distinction of kinds of tokens. */ #define MIN_T_CMO TOKEN(0) #define MAX_T_CMO TOKEN(256) #define MIN_T_OX TOKEN(512) @@ -25,26 +32,5 @@ #define IS_CMO 1 #define IS_SM 2 #define IS_OX 3 - -#define PFLAG_ADDREV 1 -int setflag_parse(int flag); - -cmo *parse(); - -int setgetc(int (*foo)()); -int setmode_mygetc(char *s); -int init_parser(char *s); - -typedef struct { - char *key; - int tag; - int token; - int type; -} symbol; - -symbol* lookup_by_symbol(char *key); -symbol* lookup_by_token(int tok); -symbol* lookup_by_tag(int tag); -symbol* lookup(int i); #endif /* _PARSE_H_ */