version 1.5, 2000/10/10 05:23:21 |
version 1.9, 2003/01/13 12:03:12 |
|
|
/* -*- mode: C; coding: euc-japan -*- */ |
/* -*- mode: C; coding: euc-japan -*- */ |
/* $OpenXM: OpenXM/src/ox_toolkit/parse.c,v 1.4 2000/03/10 12:24:39 ohara Exp $ */ |
/* $OpenXM: OpenXM/src/ox_toolkit/parse.c,v 1.8 2003/01/11 11:42:31 ohara Exp $ */ |
|
|
/* |
/* |
This module is a parser for OX/CMO expressions. |
This module is a parser for OX/CMO expressions. |
Some commnets is written in Japanese by using the EUC-JP coded |
Some commnets are written in Japanese by using the EUC-JP coded |
character set. |
character set. |
*/ |
*/ |
|
|
Line 96 static jmp_buf env_parse; |
|
Line 96 static jmp_buf env_parse; |
|
/* This is a parsing fault. */ |
/* This is a parsing fault. */ |
static void parse_error(char *s) |
static void parse_error(char *s) |
{ |
{ |
fprintf(stderr, "syntax error: %s\n", s); |
ox_printf("syntax error: %s\n", s); |
longjmp(env_parse, 1); |
longjmp(env_parse, 1); |
} |
} |
|
|
Line 577 static int mygetc() |
|
Line 577 static int mygetc() |
|
|
|
static void init_lex(char *s) |
static void init_lex(char *s) |
{ |
{ |
|
c=' '; |
mygetc_ptr=s; |
mygetc_ptr=s; |
} |
} |
|
|
Line 710 static char *lex_quoted_string() |
|
Line 711 static char *lex_quoted_string() |
|
} |
} |
buffer[i]=c; |
buffer[i]=c; |
} |
} |
fprintf(stderr, "buffer overflow!\n"); |
ox_printf("buffer overflow!\n"); |
exit(1); |
exit(1); |
/* return NULL; */ |
/* return NULL; */ |
} |
} |
Line 723 static int token_of_symbol(char *key) |
|
Line 724 static int token_of_symbol(char *key) |
|
return symp->token; |
return symp->token; |
} |
} |
#if DEBUG |
#if DEBUG |
fprintf(stderr, "lex error:: \"%s\" is unknown symbol.\n", key); |
ox_printf("lex error:: \"%s\" is unknown symbol.\n", key); |
#endif |
#endif |
return 0; |
return 0; |
} |
} |
Line 739 static int lex_symbol() |
|
Line 740 static int lex_symbol() |
|
buffer[i]=c; |
buffer[i]=c; |
c = mygetc(); |
c = mygetc(); |
} |
} |
fprintf(stderr, "buffer overflow!\n"); |
ox_printf("buffer overflow!\n"); |
return 0; |
return 0; |
} |
} |
|
|
/* return する前に一文字先読みしておく. */ |
/* Remark: prefetching a character before return. */ |
static int lex() |
static int lex() |
{ |
{ |
int c_dash = 0; |
int c_dash = 0; |