version 1.11, 2015/09/29 01:52:14 |
version 1.13, 2020/10/06 11:33:46 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/parser.c,v 1.10 2015/09/27 08:12:42 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/parser.c,v 1.12 2015/10/08 11:49:37 takayama Exp $ */ |
/* |
/* |
parser.c parser for poly.c |
parser.c parser for poly.c |
*/ |
*/ |
|
|
#include "extern.h" |
#include "extern.h" |
#include "extern2.h" |
#include "extern2.h" |
|
|
#if defined(__MSYS__) || defined(__CYGWIN__) |
|
#define setjmp(e) _setjmp(e) |
|
#define sigsetjmp(e,n) _setjmp(e) |
|
#endif |
|
|
|
#define NUM 1 /* NUM means struct Bignum */ |
#define NUM 1 /* NUM means struct Bignum */ |
#define POL 0 |
#define POL 0 |
Line 44 static int Spv = 0; /* stack pointer */ |
|
Line 40 static int Spv = 0; /* stack pointer */ |
|
#define SSIZE 20000 |
#define SSIZE 20000 |
static int TagStack[SSIZE]; |
static int TagStack[SSIZE]; |
static union valObject ValStack[SSIZE]; |
static union valObject ValStack[SSIZE]; |
#define NAME_MAX 2000 |
#define MY_NAME_MAX 2000 |
static char Name[NAME_MAX]; |
static char Name[MY_NAME_MAX]; |
|
|
static union valObject ValTmp; |
static union valObject ValTmp; |
|
|
Line 129 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 226 static int getoken() { |
|
Line 222 static int getoken() { |
|
i = 0; |
i = 0; |
do { |
do { |
Name[i] = Ch; Name[i+1] = '\0'; i++; |
Name[i] = Ch; Name[i+1] = '\0'; i++; |
if (i+2 >= NAME_MAX) { |
if (i+2 >= MY_NAME_MAX) { |
errorParser("Too long name begining with @."); |
errorParser("Too long name begining with @."); |
} |
} |
Ch = getcharFromStr(); |
Ch = getcharFromStr(); |
Line 606 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 |
} |
} |
|
|