*** empty log message ***

This commit is contained in:
hyung-hwan 2005-06-08 03:19:31 +00:00
parent 49374ba69c
commit 785370660b
4 changed files with 11 additions and 6 deletions

View File

@ -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 <xp/stx/parser.h> #include <xp/stx/parser.h>
@ -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 __open_input (xp_stx_parser_t* parser, void* input);
static int __close_input (xp_stx_parser_t* parser); 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) { if (parser == XP_NULL) {
parser = (xp_stx_parser_t*) 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; return XP_NULL;
} }
parser->stx = stx;
parser->error_code = XP_STX_PARSER_ERROR_NONE; parser->error_code = XP_STX_PARSER_ERROR_NONE;
parser->curc = XP_STX_CHAR_EOF; parser->curc = XP_STX_CHAR_EOF;
parser->ungotc_count = 0; parser->ungotc_count = 0;

View File

@ -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_ #ifndef _XP_STX_PARSER_H_
@ -39,6 +39,8 @@ typedef struct xp_stx_parser_t xp_stx_parser_t;
struct xp_stx_parser_t struct xp_stx_parser_t
{ {
xp_stx_t* stx;
int error_code; int error_code;
xp_stx_token_t token; xp_stx_token_t token;
@ -56,7 +58,7 @@ struct xp_stx_parser_t
extern "C" { extern "C" {
#endif #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); void xp_stx_parser_close (xp_stx_parser_t* parser);
int xp_stx_parser_parse_method ( int xp_stx_parser_parse_method (

View File

@ -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_ #ifndef _XP_STX_TOKEN_H_
@ -14,6 +14,7 @@ enum
XP_STX_TOKEN_STRLIT, XP_STX_TOKEN_STRLIT,
XP_STX_TOKEN_NUMLIT, XP_STX_TOKEN_NUMLIT,
XP_STX_TOKEN_IDENT, XP_STX_TOKEN_IDENT,
XP_STX_TOKEN_BINARY,
XP_STX_TOKEN_KEYWORD, XP_STX_TOKEN_KEYWORD,
XP_STX_TOKEN_MINUS, XP_STX_TOKEN_MINUS,
XP_STX_TOKEN_ASSIGN, XP_STX_TOKEN_ASSIGN,

View File

@ -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")); xp_printf (XP_TEXT("cannot open parser\n"));
return -1; return -1;
} }