version 1.8, 2005/07/03 11:08:54 |
version 1.9, 2005/07/18 10:55:16 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/scanner2.c,v 1.7 2005/01/23 02:41:17 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/scanner2.c,v 1.8 2005/07/03 11:08:54 ohara Exp $ */ |
/* scanner2.c (SM StackMachine) */ |
/* scanner2.c (SM StackMachine) */ |
/* export: struct tokens decompostToTokens(char *str,int *sizep); |
/* export: struct tokens decompostToTokens(char *str,int *sizep); |
scanner2.c is for getting tokens from a string. |
scanner2.c is for getting tokens from a string. |
Line 58 static isKakkoSM(); |
|
Line 58 static isKakkoSM(); |
|
static isSymbolSM(); |
static isSymbolSM(); |
static struct tokens getokenSM2(); |
static struct tokens getokenSM2(); |
|
|
|
extern int ScannerWhich; |
|
extern unsigned char ScannerBuf[]; |
|
extern int ScannerPt; |
|
|
/**************** code part of lexical analizer ********************/ |
/**************** code part of lexical analizer ********************/ |
|
|
struct tokens *decomposeToTokens(str,sizep) |
struct tokens *decomposeToTokens(str,sizep) |
Line 109 static int getSM() |
|
Line 113 static int getSM() |
|
} |
} |
|
|
c = (unsigned char) StringSM[StrpSM++]; |
c = (unsigned char) StringSM[StrpSM++]; |
|
if (c != 0) { |
|
ScannerPt++; if (ScannerPt >= SCANNERBUF_SIZE) ScannerPt = 0; |
|
ScannerBuf[ScannerPt] = c; |
|
} |
if (c == '\0') { |
if (c == '\0') { |
StrpSM--;return(EOF); |
StrpSM--;return(EOF); |
} else return(c); |
} else return(c); |
Line 210 static struct tokens getokenSM2(kind,str) |
|
Line 218 static struct tokens getokenSM2(kind,str) |
|
int level; |
int level; |
|
|
if (kind == INIT) { |
if (kind == INIT) { |
|
ScannerWhich = 2; |
|
ScannerPt = 0; |
|
ScannerBuf[0] = 0; |
|
|
StrpSM = 0; |
StrpSM = 0; |
ExistSM = 0; |
ExistSM = 0; |
|
|