*** empty log message ***

This commit is contained in:
hyung-hwan 2005-06-12 16:07:23 +00:00
parent d2936c6b4c
commit 2433bcb17b
3 changed files with 31 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: parser.c,v 1.28 2005-06-12 15:46:02 bacon Exp $
* $Id: parser.c,v 1.29 2005-06-12 16:07:23 bacon Exp $
*/
#include <xp/stx/parser.h>
@ -158,6 +158,7 @@ static int __parse_message_pattern (xp_stx_parser_t* parser)
*/
int n;
xp_stx_name_clear (&parser->method_name);
while (parser->argument_count > 0) {
xp_free (parser->argument[--parser->argument_count]);
}
@ -182,6 +183,12 @@ static int __parse_message_pattern (xp_stx_parser_t* parser)
static int __parse_unary_pattern (xp_stx_parser_t* parser)
{
/* TODO: check if the method name exists */
if (xp_stx_name_adds(
&parser->method_name, parser->token.buffer) == -1) {
parser->error_code = XP_STX_PARSER_ERROR_MEMORY;
return -1;
}
GET_TOKEN (parser);
return 0;
}
@ -189,6 +196,11 @@ static int __parse_unary_pattern (xp_stx_parser_t* parser)
static int __parse_binary_pattern (xp_stx_parser_t* parser)
{
/* TODO: check if the method name exists */
if (xp_stx_name_adds(
&parser->method_name, parser->token.buffer) == -1) {
parser->error_code = XP_STX_PARSER_ERROR_MEMORY;
return -1;
}
GET_TOKEN (parser);
if (parser->token.type != XP_STX_TOKEN_IDENT) {
@ -217,6 +229,12 @@ static int __parse_binary_pattern (xp_stx_parser_t* parser)
static int __parse_keyword_pattern (xp_stx_parser_t* parser)
{
do {
if (xp_stx_name_adds(
&parser->method_name, parser->token.buffer) == -1) {
parser->error_code = XP_STX_PARSER_ERROR_MEMORY;
return -1;
}
GET_TOKEN (parser);
if (parser->token.type != XP_STX_TOKEN_IDENT) {
parser->error_code = XP_STX_PARSER_ERROR_ARGUMENT_NAME;

View File

@ -1,5 +1,5 @@
/*
* $Id: token.c,v 1.7 2005-06-12 15:46:02 bacon Exp $
* $Id: token.c,v 1.8 2005-06-12 16:07:23 bacon Exp $
*/
#include <xp/stx/token.h>
@ -87,6 +87,15 @@ int xp_stx_token_addc (xp_stx_token_t* token, xp_cint_t c)
return 0;
}
int xp_stx_token_adds (xp_stx_token_t* token, const xp_char_t* s)
{
while (*s != XP_CHAR('\0')) {
if (xp_stx_token_addc(token, *s) == -1) return -1;
}
return 0;
}
void xp_stx_token_clear (xp_stx_token_t* token)
{
/*

View File

@ -1,5 +1,5 @@
/*
* $Id: token.h,v 1.13 2005-06-12 15:46:02 bacon Exp $
* $Id: token.h,v 1.14 2005-06-12 16:07:23 bacon Exp $
*/
#ifndef _XP_STX_TOKEN_H_
@ -55,6 +55,7 @@ xp_stx_token_t* xp_stx_token_open (
void xp_stx_token_close (xp_stx_token_t* token);
int xp_stx_token_addc (xp_stx_token_t* token, xp_cint_t c);
int xp_stx_token_adds (xp_stx_token_t* token, const xp_char_t* s);
void xp_stx_token_clear (xp_stx_token_t* token);
xp_char_t* xp_stx_token_yield (xp_stx_token_t* token, xp_word_t capacity);
int xp_stx_token_compare (xp_stx_token_t* token, const xp_char_t* str);