diff --git a/ase/stx/parser.c b/ase/stx/parser.c index 8e2a2fdf..ad46f5e1 100644 --- a/ase/stx/parser.c +++ b/ase/stx/parser.c @@ -1,5 +1,5 @@ /* - * $Id: parser.c,v 1.21 2005-06-08 03:16:34 bacon Exp $ + * $Id: parser.c,v 1.22 2005-06-08 03:19:31 bacon Exp $ */ #include @@ -25,7 +25,7 @@ static int __unget_char (xp_stx_parser_t* parser, xp_cint_t c); static int __open_input (xp_stx_parser_t* parser, void* input); static int __close_input (xp_stx_parser_t* parser); -xp_stx_parser_t* xp_stx_parser_open (xp_stx_parser_t* parser) +xp_stx_parser_t* xp_stx_parser_open (xp_stx_parser_t* parser, xp_stx_t* stx) { if (parser == XP_NULL) { parser = (xp_stx_parser_t*) @@ -40,6 +40,8 @@ xp_stx_parser_t* xp_stx_parser_open (xp_stx_parser_t* parser) return XP_NULL; } + parser->stx = stx; + parser->error_code = XP_STX_PARSER_ERROR_NONE; parser->curc = XP_STX_CHAR_EOF; parser->ungotc_count = 0; diff --git a/ase/stx/parser.h b/ase/stx/parser.h index 3bcca4ba..cb45fa3c 100644 --- a/ase/stx/parser.h +++ b/ase/stx/parser.h @@ -1,5 +1,5 @@ /* - * $Id: parser.h,v 1.12 2005-06-08 03:16:34 bacon Exp $ + * $Id: parser.h,v 1.13 2005-06-08 03:19:31 bacon Exp $ */ #ifndef _XP_STX_PARSER_H_ @@ -39,6 +39,8 @@ typedef struct xp_stx_parser_t xp_stx_parser_t; struct xp_stx_parser_t { + xp_stx_t* stx; + int error_code; xp_stx_token_t token; @@ -56,7 +58,7 @@ struct xp_stx_parser_t extern "C" { #endif -xp_stx_parser_t* xp_stx_parser_open (xp_stx_parser_t* parser); +xp_stx_parser_t* xp_stx_parser_open (xp_stx_parser_t* parser, xp_stx_t* stx); void xp_stx_parser_close (xp_stx_parser_t* parser); int xp_stx_parser_parse_method ( diff --git a/ase/stx/token.h b/ase/stx/token.h index b2615099..658e3c21 100644 --- a/ase/stx/token.h +++ b/ase/stx/token.h @@ -1,5 +1,5 @@ /* - * $Id: token.h,v 1.6 2005-06-07 16:09:57 bacon Exp $ + * $Id: token.h,v 1.7 2005-06-08 03:16:34 bacon Exp $ */ #ifndef _XP_STX_TOKEN_H_ @@ -14,6 +14,7 @@ enum XP_STX_TOKEN_STRLIT, XP_STX_TOKEN_NUMLIT, XP_STX_TOKEN_IDENT, + XP_STX_TOKEN_BINARY, XP_STX_TOKEN_KEYWORD, XP_STX_TOKEN_MINUS, XP_STX_TOKEN_ASSIGN, diff --git a/ase/test/stx/parser.c b/ase/test/stx/parser.c index 25e501bd..a657b877 100644 --- a/ase/test/stx/parser.c +++ b/ase/test/stx/parser.c @@ -108,7 +108,7 @@ int xp_main (int argc, xp_char_t* argv[]) */ - if (xp_stx_parser_open(&parser) == XP_NULL) { + if (xp_stx_parser_open(&parser, XP_NULL) == XP_NULL) { xp_printf (XP_TEXT("cannot open parser\n")); return -1; }