| version 1.6, 2004/05/13 10:37:30 |
version 1.12, 2015/10/08 11:49:37 |
|
|
| /* $OpenXM: OpenXM/src/kan96xx/Kan/parser.c,v 1.5 2002/11/04 10:53:55 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/parser.c,v 1.11 2015/09/29 01:52:14 takayama Exp $ */ |
| /* |
/* |
| parser.c parser for poly.c |
parser.c parser for poly.c |
| */ |
*/ |
| |
|
| #include <stdio.h> |
#include <stdio.h> |
| |
#include <string.h> |
| #include "datatype.h" |
#include "datatype.h" |
| #include "setjmp.h" |
#include "setjmp.h" |
| #include "stackm.h" |
#include "stackm.h" |
| #include "extern.h" |
#include "extern.h" |
| #include "extern2.h" |
#include "extern2.h" |
| |
|
| |
|
| #define NUM 1 /* NUM means struct Bignum */ |
#define NUM 1 /* NUM means struct Bignum */ |
| #define POL 0 |
#define POL 0 |
| |
|
| Line 123 POLY stringToPOLY(s,ringp) |
|
| Line 125 POLY stringToPOLY(s,ringp) |
|
| Ring0.p = 0; |
Ring0.p = 0; |
| Ring0.next = (struct ring *)NULL; |
Ring0.next = (struct ring *)NULL; |
| #if defined(__CYGWIN__) |
#if defined(__CYGWIN__) |
| if (sigsetjmp(EnvOfParser,1)) { |
if (MYSIGSETJMP(EnvOfParser,1)) { |
| #else |
#else |
| if (setjmp(EnvOfParser)) { |
if (MYSETJMP(EnvOfParser)) { |
| #endif |
#endif |
| fprintf(stderr,"\nERROR: You have syntax errors in the expression: %s\n",s); |
fprintf(stderr,"\nERROR: You have syntax errors in the expression: %s\n",s); |
| errorKan1("%s\n"," parser.c : Syntax error in the input polynomial."); |
errorKan1("%s\n"," parser.c : Syntax error in the input polynomial."); |
| Line 486 static void factor() { |
|
| Line 488 static void factor() { |
|
| |
|
| static void monom() { |
static void monom() { |
| union valObject utmp; |
union valObject utmp; |
| struct object obj; |
struct object obj = OINIT; |
| POLY f; |
POLY f; |
| extern struct context *CurrentContextp; |
extern struct context *CurrentContextp; |
| if (Symbol == 'x' || Symbol == 'd') { |
if (Symbol == 'x' || Symbol == 'd') { |
| Line 567 static void errorParser(s) char s[]; { |
|
| Line 569 static void errorParser(s) char s[]; { |
|
| extern char *GotoLabel; |
extern char *GotoLabel; |
| extern int GotoP; |
extern int GotoP; |
| extern int ErrorMessageMode; |
extern int ErrorMessageMode; |
| |
extern int RestrictedMode, RestrictedMode_saved; |
| int j; |
int j; |
| char tmpc[1024]; |
char tmpc[1024]; |
| |
RestrictedMode = RestrictedMode_saved; |
| cancelAlarm(); |
cancelAlarm(); |
| if (ErrorMessageMode == 1 || ErrorMessageMode == 2) { |
if (ErrorMessageMode == 1 || ErrorMessageMode == 2) { |
| sprintf(tmpc,"\nError(parser.c): "); |
sprintf(tmpc,"\nError(parser.c): "); |
| Line 598 static void errorParser(s) char s[]; { |
|
| Line 602 static void errorParser(s) char s[]; { |
|
| GotoP = 0; |
GotoP = 0; |
| } |
} |
| #if defined(__CYGWIN__) |
#if defined(__CYGWIN__) |
| siglongjmp(EnvOfParser,1); |
MYSIGLONGJMP(EnvOfParser,1); |
| #else |
#else |
| longjmp(EnvOfParser,1); |
MYLONGJMP(EnvOfParser,1); |
| #endif |
#endif |
| } |
} |
| |
|