*** empty log message ***

This commit is contained in:
hyung-hwan 2005-06-04 16:27:30 +00:00
parent 8d30a1830b
commit 33639ee40f

View File

@ -1,5 +1,5 @@
/* /*
* $Id: parser.c,v 1.10 2005-06-04 07:01:57 bacon Exp $ * $Id: parser.c,v 1.11 2005-06-04 16:27:30 bacon Exp $
*/ */
#include <xp/stx/parser.h> #include <xp/stx/parser.h>
@ -25,6 +25,7 @@ xp_stx_parser_t* xp_stx_parser_open (xp_stx_parser_t* parser)
parser->text = XP_NULL; parser->text = XP_NULL;
parser->curc = XP_CHAR_EOF; parser->curc = XP_CHAR_EOF;
parser->curp = XP_NULL; parser->curp = XP_NULL;
return parser; return parser;
} }
@ -37,22 +38,46 @@ void xp_stx_parser_close (xp_stx_parser_t* parser)
int xp_stx_parser_parse_method (xp_stx_parser_t* parser, int xp_stx_parser_parse_method (xp_stx_parser_t* parser,
xp_stx_word_t method_class, xp_stx_char_t* method_text) xp_stx_word_t method_class, xp_stx_char_t* method_text)
{ {
/*xp_stx_lexer_reset (&parser->lexer, text);*/ xp_stx_assert (method_text != XP_NULL);
#if 0 parser->error_code = 0;
parser->token = xp_stx_lexer_consume (&parser->lexer); parser->text = method_text;
if (parser->token == XP_NULL) { parser->curp = method_text;
//parser->token = xp_stx_lexer_consume (&parser->lexer); NEXT_CHAR (parser);
//if (parser->token == XP_NULL) {
/*parser->error_code = xxx;*/
return -1;
}
#endif
return 0; return 0;
} }
static int __get_token (xp_stx_parser_t* parser) static int __get_token (xp_stx_parser_t* parser)
{ {
xp_cint_t c = parser->curc;
__skip_spaces (parser);
__skip_comment (parser);
switch (c) {
case
}
return -1; return -1;
} }
static int __get_char (xp_stx_parser_t* parser)
{
xp_cint_t c = parser->curp;
if (c == XP_STX_CHAR('\0')) {
parser->curc = XP_EOF_CHAR;
}
else {
parser->curc = c;
parser->curp++;
}
return 0;
}
static int __skip_spaces (xp_stx_parser_t* parser)
{
while (xp_stx_isspace(parser->curc)) __get_char
}