=================================================================== RCS file: /home/cvs/OpenXM/src/ox_math/Attic/parse.h,v retrieving revision 1.1 retrieving revision 1.4 diff -u -p -r1.1 -r1.4 --- OpenXM/src/ox_math/Attic/parse.h 1999/10/29 08:06:42 1.1 +++ OpenXM/src/ox_math/Attic/parse.h 1999/11/06 21:39:37 1.4 @@ -1,6 +1,5 @@ /* -*- mode: C; coding: euc-japan -*- */ -/* $OpenXM$ */ -/* $Id: parse.h,v 1.1 1999/10/29 08:06:42 ohara Exp $ */ +/* $OpenXM: OpenXM/src/ox_math/parse.h,v 1.3 1999/11/02 19:51:18 ohara Exp $ */ #ifndef _PARSE_H_ @@ -8,50 +7,40 @@ #define _PARSE_H_ -/* トークンを定義する */ -/* 2048 より小さいのは特別なもの */ +/* トークンの定義 */ +/* 256 より小さいものは、一文字だけのトークンである */ #define T_INTEGER 257 #define T_STRING 258 - #define T_MAGIC 2048 +#define TOKEN(x) (T_MAGIC + (x)) +#define SM SM_popCMO -#define T_CMO_NULL (T_MAGIC + CMO_NULL) -#define T_CMO_INT32 (T_MAGIC + CMO_INT32) -#define T_CMO_STRING (T_MAGIC + CMO_STRING) -#define T_CMO_LIST (T_MAGIC + CMO_LIST) -#define T_CMO_ZZ (T_MAGIC + CMO_ZZ) -#define T_CMO_ZERO (T_MAGIC + CMO_ZERO) -#define T_CMO_DATUM (T_MAGIC + CMO_DATUM) -#define T_CMO_ERROR2 (T_MAGIC + CMO_ERROR2) +/* トークンの種類を判定するためのマクロ */ +#define MIN_T_CMO TOKEN(0) +#define MAX_T_CMO TOKEN(256) +#define MIN_T_OX TOKEN(512) +#define MAX_T_OX TOKEN(600) -#define T_SM_popCMO (T_MAGIC + SM_popCMO) -#define T_SM_popString (T_MAGIC + SM_popString) -#define T_SM_mathcap (T_MAGIC + SM_mathcap) -#define T_SM_pops (T_MAGIC + SM_pops) -#define T_SM_executeStringByLocalParser (T_MAGIC + SM_executeStringByLocalParser) -#define T_SM_executeFunction (T_MAGIC + SM_executeFunction) -#define T_SM_setMathcap (T_MAGIC + SM_setMathcap) -#define T_SM_control_kill (T_MAGIC + SM_control_kill) -#define T_SM_control_reset_connection (T_MAGIC + SM_control_reset_connection) +#define IS_CMO 1 +#define IS_SM 2 +#define IS_OX 3 -#define T_OX_COMMAND (T_MAGIC + OX_COMMAND) -#define T_OX_DATA (T_MAGIC + OX_DATA) +#define PFLAG_ADDREV 1 +int setflag_parse(int flag); -/* lexical analyzer で用いる属性値の共用体の定義 */ -typedef union{ - int d; - char* sym; -} lex_value_t; - -int lex(); cmo *parse(); -int cmo_addrev; /* CMO の省略記法を許すか否かのフラグ */ - int setgetc(int (*foo)()); int resetgetc(); int mygetc(); int setmode_mygetc(char *s, int len); + +typedef struct { + char *key; + int tag; + int token; + int type; +} symbol; #endif /* _PARSE_H_ */