From 23c82ec46754bc279b0dee7ca3d0a123f4ec280f Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 22 May 2005 04:11:54 +0000 Subject: [PATCH] *** empty log message *** --- ase/stx/object.h | 17 ++++++++++++++++- ase/stx/parser.c | 24 +++++++++++++++++++++--- ase/stx/parser.h | 16 +++++++++++++--- ase/stx/scanner.h | 19 +++++++++++++++++++ 4 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 ase/stx/scanner.h diff --git a/ase/stx/object.h b/ase/stx/object.h index a87fbca5..3e299338 100644 --- a/ase/stx/object.h +++ b/ase/stx/object.h @@ -1,5 +1,5 @@ /* - * $Id: object.h,v 1.13 2005-05-21 15:55:49 bacon Exp $ + * $Id: object.h,v 1.14 2005-05-22 04:11:54 bacon Exp $ */ #ifndef _XP_STX_OBJECT_H_ @@ -22,6 +22,21 @@ #define XP_STX_CLASS_POOLDICT 6 #define XP_STX_CLASS_CATEGORY 7 +struct xp_stx_class_t +{ + xp_stx_objhdr_t header; + xp_stx_word_t name; + xp_stx_word_t spec; + xp_stx_word_t methods; + xp_stx_word_t superclass; + xp_stx_word_t variables; + xp_stx_word_t classvars; + xp_stx_word_t pooldict; + xp_stx_word_t category; +}; + +typedef struct xp_stx_class_t xp_stx_class_t; + #ifdef __cplusplus extern "C" { #endif diff --git a/ase/stx/parser.c b/ase/stx/parser.c index 88c333a2..4cd83e3f 100644 --- a/ase/stx/parser.c +++ b/ase/stx/parser.c @@ -1,8 +1,27 @@ /* - * $Id: parser.c,v 1.1 2005-05-12 15:49:07 bacon Exp $ + * $Id: parser.c,v 1.2 2005-05-22 04:11:54 bacon Exp $ */ #include +#include + +xp_stx_parser_t* xp_stx_parser_open (xp_stx_parser_t* parser) +{ + if (parser == XP_NULL) { + parser = (xp_stx_parser_t*) + xp_stx_malloc (xp_sizeof(xp_stx_parser_t)); + if (parser == XP_NULL) return XP_NULL; + parser->__malloced = xp_true; + } + else parser->__malloced = xp_false; + + return parser; +} + +void xp_stx_parser_close (xp_stx_parser_t* parser) +{ + if (parser->__malloced) xp_stx_free (parser); +} static void __emit_code ( xp_stx_t* stx, xp_stx_word_t method, int value) @@ -19,8 +38,7 @@ static void __emit_instruction ( else __emit_code (high * 16 + low); } -int xp_stx_parse ( - xp_stx_t* stx, xp_stx_word_t method, const xp_char_t* text) +int xp_stx_parser_parse_method (xp_stx_parser_t* parser, const xp_char_t* text) { return 0; } diff --git a/ase/stx/parser.h b/ase/stx/parser.h index 39174e85..78b1578e 100644 --- a/ase/stx/parser.h +++ b/ase/stx/parser.h @@ -1,16 +1,26 @@ /* - * $Id: parser.h,v 1.1 2005-05-12 15:49:07 bacon Exp $ + * $Id: parser.h,v 1.2 2005-05-22 04:11:54 bacon Exp $ */ #ifndef _XP_STX_PARSER_H_ #define _XP_STX_PARSER_H_ +#include + +struct xp_stx_parser_t +{ + xp_bool_t __malloced; +}; + +typedef struct xp_stx_parser_t xp_stx_parser_t; + #ifdef __cplusplus extern "C" { #endif -int xp_stx_parse ( - xp_stx_t* stx, xp_stx_word_t method, const xp_char_t* text); +xp_stx_parser_t* xp_stx_parser_open (xp_stx_parser_t* parser); +int xp_stx_parser_close (xp_stx_parser_t* parser); +int xp_stx_parser_parse (xp_stx_parser_t* parser, const xp_char_t* text); #ifdef __cplusplus } diff --git a/ase/stx/scanner.h b/ase/stx/scanner.h new file mode 100644 index 00000000..17bd4e1b --- /dev/null +++ b/ase/stx/scanner.h @@ -0,0 +1,19 @@ +/* + * $Id: scanner.h,v 1.1 2005-05-22 04:11:54 bacon Exp $ + */ + +#ifndef _XP_STX_SCANNER_H_ +#define _XP_STX_SCANNER_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifdef __cplusplus +} +#endif + +#endif