debug.chk

来自「开放源码的编译器open watcom 1.6.0版的源代码」· CHK 代码 · 共 1,673 行 · 第 1/3 页

CHK
1,673
字号
/* Generated by re2c on Fri Sep 11 21:05:46 1992 */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned short ushort;
typedef unsigned char uchar;
typedef unsigned char byte;
typedef unsigned char bool;

#define true    (0 == 0)
#define false   (!true)

#define BSIZE   2048

#define CURSOR   ch
#define LOADCURSOR  ch = *cursor;
#define ADVANCE     cursor++;
#define BACK(n)     cursor -= (n);
#define CHECK(n)    if((s->lim - cursor) < (n)){cursor = fill(s, cursor);}
#define MARK(n)     s->ptr = cursor; sel = (n);
#define REVERT   cursor = s->ptr;
#define MARKER   sel

#define RETURN(i)   {s->cur = cursor; return i;}

typedef struct Scanner Scanner;

struct Scanner {
    int        fd;
    uchar     *bot, *tok, *ptr, *cur, *lim, *top;
    uint       lineNum;
    ulong     linePos;
    ulong     pos;
};

uchar *fill(s, cursor)
    Scanner *s;
    uchar *cursor;
{
    uint cnt = s->tok - s->bot;
    if(cnt){
    memcpy(s->bot, s->tok, s->lim - s->tok);
    s->tok = s->bot;
    s->ptr -= cnt;
    cursor -= cnt;
    s->lim -= cnt;
    }
    if((s->top - s->lim) < BSIZE){
    uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar));
    memcpy(buf, s->tok, s->lim - s->tok);
    s->tok = buf;
    s->ptr = &buf[s->ptr - s->bot];
    cursor = &buf[cursor - s->bot];
    s->lim = &buf[s->lim - s->bot];
    s->top = &s->lim[BSIZE];
    free(s->bot);
    s->bot = buf;
    }
    if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE)
    s->lim[cnt] = '\0';
    s->lim += cnt;
    return cursor;
}

int scan(s)
    Scanner *s;
{
    uchar *cursor = s->cur;
    uint depth;
    uint sel;
    uchar ch;
    s->pos += (cursor - s->tok); s->tok = cursor;
	goto std;
L0:	{ADVANCE}
std:
	{CHECK(15)}
	{LOADCURSOR}
L1:	{LOADCURSOR}
	switch((CURSOR)){
	case '\000':

		goto L77;
	case '\t':
case ' ':

		goto L73;
	case '\n':

		goto L75;
	case '"':

		goto L9;
	case '#':

		goto L10;
	case '&':

		goto L12;
	case '\'':

		goto L7;
	case '(':

		goto L2;
	case ')':

		goto L14;
	case '*':

		goto L16;
	case '+':

		goto L18;
	case ',':

		goto L20;
	case '-':

		goto L22;
	case '.':

		goto L24;
	case '/':

		goto L26;
	case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':

		goto L4;
	case '8':
case '9':

		goto L6;
	case ':':

		goto L28;
	case ';':

		goto L30;
	case '<':

		goto L32;
	case '=':

		goto L34;
	case '>':

		goto L36;
	case 'A':

		goto L52;
	case 'B':

		goto L54;
	case 'C':

		goto L55;
	case 'D':

		goto L56;
	case 'E':

		goto L57;
	case 'F':

		goto L58;
	case 'G':
case 'H':
case 'J':
case 'K':
case 'X':
case 'Y':
case 'Z':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':

		goto L72;
	case 'I':

		goto L59;
	case 'L':

		goto L60;
	case 'M':

		goto L61;
	case 'N':

		goto L62;
	case 'O':

		goto L63;
	case 'P':

		goto L64;
	case 'Q':

		goto L65;
	case 'R':

		goto L66;
	case 'S':

		goto L67;
	case 'T':

		goto L68;
	case 'U':

		goto L69;
	case 'V':

		goto L70;
	case 'W':

		goto L71;
	case '[':

		goto L38;
	case ']':

		goto L40;
	case '^':

		goto L42;
	case '{':

		goto L44;
	case '|':

		goto L46;
	case '}':

		goto L48;
	case '~':

		goto L50;
	default:
		goto L79;
	}
L2:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == '*')	goto L297;
L3:
	{RETURN(9);}
L4:	{ADVANCE}
	{MARK(0)}
	{LOADCURSOR}
	switch((CURSOR)){
	case '.':

		goto L275;
	case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':

		goto L291;
	case '8':
case '9':

		goto L277;
	case 'A':
case 'D':
case 'E':
case 'F':

		goto L279;
	case 'B':

		goto L293;
	case 'C':

		goto L295;
	case 'H':

		goto L281;
	default:
		goto L5;
	}
L5:
	{RETURN(1);}
L6:	{ADVANCE}
	{MARK(0)}
	{LOADCURSOR}
	if((CURSOR) <= '9'){
		if((CURSOR) == '.')	goto L275;
		if((CURSOR) <= '/')	goto L5;
		goto L277;
	} else {
		if((CURSOR) <= 'F'){
			if((CURSOR) <= '@')	goto L5;
			goto L279;
		} else {
			if((CURSOR) == 'H')	goto L281;
			goto L5;
		}
	}
L7:	{ADVANCE}
	{MARK(1)}
	{LOADCURSOR}
	if((CURSOR) <= '\000')	goto L8;
	if((CURSOR) != '\n')	goto L274;
L8:
	{
       printf("illegal character: %c\n", *s->tok);
       s->pos += 1; s->tok = cursor;
       goto std;
        }
L9:	{ADVANCE}
	{MARK(1)}
	{LOADCURSOR}
	if((CURSOR) <= '\000')	goto L8;
	if((CURSOR) == '\n')	goto L8;
	goto L269;
L10:	{ADVANCE}
	{LOADCURSOR}
L11:
	{RETURN(7);}
L12:	{ADVANCE}
	{LOADCURSOR}
L13:
	{RETURN(8);}
L14:	{ADVANCE}
	{LOADCURSOR}
L15:
	{RETURN(10);}
L16:	{ADVANCE}
	{LOADCURSOR}
L17:
	{RETURN(11);}
L18:	{ADVANCE}
	{LOADCURSOR}
L19:
	{RETURN(12);}
L20:	{ADVANCE}
	{LOADCURSOR}
L21:
	{RETURN(13);}
L22:	{ADVANCE}
	{LOADCURSOR}
L23:
	{RETURN(14);}
L24:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == '.')	goto L266;
L25:
	{RETURN(15);}
L26:	{ADVANCE}
	{LOADCURSOR}
L27:
	{RETURN(17);}
L28:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == '=')	goto L264;
L29:
	{RETURN(18);}
L30:	{ADVANCE}
	{LOADCURSOR}
L31:
	{RETURN(20);}
L32:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) <= '<')	goto L33;
	if((CURSOR) <= '=')	goto L262;
	if((CURSOR) <= '>')	goto L260;
L33:
	{RETURN(21);}
L34:	{ADVANCE}
	{LOADCURSOR}
L35:
	{RETURN(24);}
L36:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == '=')	goto L258;
L37:
	{RETURN(25);}
L38:	{ADVANCE}
	{LOADCURSOR}
L39:
	{RETURN(27);}
L40:	{ADVANCE}
	{LOADCURSOR}
L41:
	{RETURN(28);}
L42:	{ADVANCE}
	{LOADCURSOR}
L43:
	{RETURN(29);}
L44:	{ADVANCE}
	{LOADCURSOR}
L45:
	{RETURN(30);}
L46:	{ADVANCE}
	{LOADCURSOR}
L47:
	{RETURN(31);}
L48:	{ADVANCE}
	{LOADCURSOR}
L49:
	{RETURN(32);}
L50:	{ADVANCE}
	{LOADCURSOR}
L51:
	{RETURN(33);}
L52:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == 'N')	goto L250;
	if((CURSOR) == 'R')	goto L251;
	goto L81;
L53:
	{RETURN(74);}
L54:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == 'E')	goto L243;
	if((CURSOR) == 'Y')	goto L244;
	goto L81;
L55:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == 'A')	goto L234;
	if((CURSOR) == 'O')	goto L235;
	goto L81;
L56:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) <= 'H'){
		if((CURSOR) == 'E')	goto L219;
		goto L81;
	} else {
		if((CURSOR) <= 'I')	goto L220;
		if((CURSOR) == 'O')	goto L221;
		goto L81;
	}
L57:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) <= 'M'){
		if((CURSOR) == 'L')	goto L200;
		goto L81;
	} else {
		if((CURSOR) <= 'N')	goto L201;
		if((CURSOR) == 'X')	goto L202;
		goto L81;
	}
L58:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == 'O')	goto L193;
	if((CURSOR) == 'R')	goto L194;
	goto L81;
L59:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) <= 'L'){
		if((CURSOR) == 'F')	goto L171;
		goto L81;
	} else {
		if((CURSOR) <= 'M')	goto L173;
		if((CURSOR) <= 'N')	goto L174;
		goto L81;
	}
L60:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == 'O')	goto L167;
	goto L81;
L61:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == 'O')	goto L160;
	goto L81;
L62:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == 'O')	goto L157;
	goto L81;
L63:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == 'F')	goto L153;
	if((CURSOR) == 'R')	goto L155;
	goto L81;
L64:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == 'O')	goto L137;
	if((CURSOR) == 'R')	goto L138;
	goto L81;
L65:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == 'U')	goto L128;
	goto L81;
L66:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == 'E')	goto L112;
	goto L81;
L67:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == 'E')	goto L109;
	goto L81;
L68:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) <= 'N'){
		if((CURSOR) == 'H')	goto L99;
		goto L81;
	} else {
		if((CURSOR) <= 'O')	goto L100;
		if((CURSOR) == 'Y')	goto L102;
		goto L81;
	}
L69:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == 'N')	goto L94;
	goto L81;
L70:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) == 'A')	goto L91;
	goto L81;
L71:	{ADVANCE}
	{LOADCURSOR}
	if((CURSOR) <= 'G')	goto L81;
	if((CURSOR) <= 'H')	goto L82;
	if((CURSOR) <= 'I')	goto L83;
	goto L81;
L72:	{ADVANCE}
	{LOADCURSOR}
	goto L81;
L73:	{ADVANCE}
	{LOADCURSOR}
L74:

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?