version 1.1, 2000/12/03 22:09:34 |
version 1.2, 2003/01/11 12:38:57 |
|
|
/* -*- mode: C; coding: euc-japan -*- */ |
/* -*- mode: C; coding: euc-japan -*- */ |
/* $OpenXM$ */ |
/* $OpenXM: OpenXM/src/ox_math/sm.c,v 1.1 2000/12/03 22:09:34 ohara Exp $ */ |
|
|
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
Line 37 void push(cmo *ob) |
|
Line 37 void push(cmo *ob) |
|
symbol_t symp; |
symbol_t symp; |
|
|
if (ob->tag == CMO_STRING) { |
if (ob->tag == CMO_STRING) { |
fprintf(stderr, "ox_math:: a CMO_STRING(%s) was pushed.\n", ((cmo_string *)ob)->s); |
fprintf(ox_stderr, "ox_math:: a CMO_STRING(%s) was pushed.\n", ((cmo_string *)ob)->s); |
}else { |
}else { |
symp = lookup_by_tag(ob->tag); |
symp = lookup_by_tag(ob->tag); |
fprintf(stderr, "ox_math:: a %s was pushed.\n", symbol_get_key(symp)); |
fprintf(ox_stderr, "ox_math:: a %s was pushed.\n", symbol_get_key(symp)); |
} |
} |
#endif |
#endif |
if (stack_ptr >= stack_size) { |
if (stack_ptr >= stack_size) { |
|
|
cmo* m = pop(); |
cmo* m = pop(); |
#ifdef DEBUG |
#ifdef DEBUG |
symbol_t symp = lookup_by_tag(m->tag); |
symbol_t symp = lookup_by_tag(m->tag); |
fprintf(stderr, "ox_math:: opecode = SM_popCMO. (%s)\n", symbol_get_key(symp)); |
fprintf(ox_stderr, "ox_math:: opecode = SM_popCMO. (%s)\n", symbol_get_key(symp)); |
#endif |
#endif |
send_ox_cmo(stack_oxfp, m); |
send_ox_cmo(stack_oxfp, m); |
} |
} |
Line 101 void sm_run(int code) |
|
Line 101 void sm_run(int code) |
|
int (*func)(OXFILE *) = sm_search_f(code); |
int (*func)(OXFILE *) = sm_search_f(code); |
#ifdef DEBUG |
#ifdef DEBUG |
symbol_t sp = lookup_by_tag(code); |
symbol_t sp = lookup_by_tag(code); |
fprintf(stderr, "ox_math:: %s received.\n", symbol_get_key(sp)); |
fprintf(ox_stderr, "ox_math:: %s received.\n", symbol_get_key(sp)); |
#endif |
#endif |
if (func != NULL) { |
if (func != NULL) { |
func(stack_oxfp); |
func(stack_oxfp); |
}else { |
}else { |
fprintf(stderr, "unknown command: %d.\n", code); |
fprintf(ox_stderr, "unknown command: %d.\n", code); |
push_error(ERROR_ID_UNKNOWN_SM, new_cmo_null()); |
push_error(ERROR_ID_UNKNOWN_SM, new_cmo_null()); |
} |
} |
} |
} |