📄 scan.c
字号:
/* parser.dlg -- DLG Description of scanner
*
* Generated from: sor.g
*
* Terence Parr, Will Cohen, and Hank Dietz: 1989-2001
* Purdue University Electrical Engineering
* With AHPCRC, University of Minnesota
* ANTLR Version 1.33MR33
*/
#define ANTLR_VERSION 13333
#include "pcctscfg.h"
#include "pccts_stdio.h"
/* 23-Sep-97 thm Accomodate user who needs to redefine ZZLEXBUFSIZE */
#ifndef ZZLEXBUFSIZE
#define ZZLEXBUFSIZE 8000
#endif
#include "pcctscfg.h" /* MR20 G. Hobbelt __USE_PROTOS #define */
#include "charbuf.h"
#include "hash.h"
#include "set.h"
#include "sor.h"
#define AST_FIELDS \
int token; char text[MaxAtom+1], label[MaxRuleName+1]; \
char *action; /* if action node, here is ptr to it */ \
char in,out; \
char init_action; /* set if Action and 1st action of alt */ \
int file; int line; /* set for BLOCK, ALT, nonterm nodes */ \
int upper_range; /* only if T1..T2 found */ \
GLA *start_state; /* ptr into GLA for this block */ \
int no_copy; /* copy input ptr to output ptr? */ \
ListNode *refvars; /* any ref vars defined for this rule */ \
unsigned char is_root; /* this token is a root #( A ... ) */
#define zzcr_ast(node, cur, _tok, _text) \
{(node)->token=_tok; strncpy((node)->text, _text,MaxAtom);}
#define USER_ZZSYN
#define zzAST_DOUBLE
extern int define_num;
#define LL_K 2
#include "antlr.h"
#include "ast.h"
#include "tokens.h"
#include "dlgdef.h"
LOOKAHEAD
void
#ifdef __USE_PROTOS
zzerraction(void)
#else
zzerraction()
#endif
{
(*zzerr)("invalid token");
zzadvance();
zzskip();
}
/*
* D L G tables
*
* Generated from: parser.dlg
*
* 1989-2001 by Will Cohen, Terence Parr, and Hank Dietz
* Purdue University Electrical Engineering
* DLG Version 1.33MR33
*/
#include "mode.h"
#include "sym.h"
#include "proto.h"
int define_num = 0;
char *
#ifdef __USE_PROTOS
scarf_to_end_of_func_call(void)
#else
scarf_to_end_of_func_call()
#endif
{
static char func_call_str[MaxAtom+1];
char *p;
p = &func_call_str[0];
more:
if ( zzchar==')' ) { *p++ = zzchar; *p++ = '\0'; zzadvance(); return func_call_str; }
if ( zzchar=='"' )
{
*p++ = zzchar; zzadvance();
while ( zzchar!='"' )
{
if ( zzchar=='\\' ) { *p++ = zzchar; zzadvance(); }
*p++ = zzchar; zzadvance();
}
}
*p++ = zzchar; zzadvance();
goto more;
}
static void act1()
{
NLA = Eof;
/* L o o k F o r A n o t h e r F i l e */
{
FILE *new_input;
new_input = NextFile();
if ( new_input != NULL ) {
fclose( input );
input = new_input;
zzrdstream( input );
/*zzadvance(); ** Get 1st char of this file */
zzskip(); /* Skip the Eof (@) char i.e continue */
}
}
}
static void act2()
{
NLA = 56;
zzskip();
}
static void act3()
{
NLA = 57;
zzline++; zzskip();
}
static void act4()
{
NLA = 58;
zzmode(ACTIONS); zzmore();
istackreset();
pushint(']');
}
static void act5()
{
NLA = 59;
action_file=CurFile; action_line=zzline;
zzmode(ACTIONS); zzmore();
istackreset();
pushint('>');
}
static void act6()
{
NLA = 60;
zzmode(STRINGS); zzmore();
}
static void act7()
{
NLA = 61;
zzmode(COMMENTS); zzskip();
}
static void act8()
{
NLA = 62;
err("Missing /*; found dangling */"); zzskip();
}
static void act9()
{
NLA = 63;
zzmode(CPP_COMMENTS); zzskip();
}
static void act10()
{
NLA = 64;
err("Missing <<; found dangling >>"); zzskip();
}
static void act11()
{
NLA = Header;
}
static void act12()
{
NLA = Tokdef;
}
static void act13()
{
NLA = LABEL;
}
static void act14()
{
NLA = OPT;
}
static void act15()
{
NLA = POS_CLOSURE;
}
static void act16()
{
NLA = CLOSURE;
}
static void act17()
{
NLA = WILD;
}
static void act18()
{
NLA = PRED_OP;
}
static void act19()
{
NLA = BT;
}
static void act20()
{
NLA = 80;
}
static void act21()
{
NLA = 81;
}
static void act22()
{
NLA = 84;
}
static void act23()
{
NLA = 85;
}
static void act24()
{
NLA = 86;
}
static void act25()
{
NLA = 87;
}
static void act26()
{
NLA = 88;
}
static void act27()
{
NLA = 89;
}
static void act28()
{
NLA = 90;
}
static void act29()
{
NLA = 91;
}
static void act30()
{
NLA = NonTerm;
}
static void act31()
{
NLA = Token;
}
static void act32()
{
NLA = 92;
warn(eMsg1("unknown meta-op: %s",LATEXT(1))); zzskip();
}
static unsigned char shift0[257] = {
0, 37, 37, 37, 37, 37, 37, 37, 37, 37,
1, 2, 37, 37, 3, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 1, 30, 6, 10, 37, 37, 37,
37, 26, 33, 8, 23, 37, 37, 24, 7, 36,
36, 36, 36, 36, 36, 36, 36, 36, 36, 21,
31, 5, 37, 9, 25, 37, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 4, 37, 37, 37, 36, 37, 13, 34,
28, 14, 12, 19, 34, 11, 34, 34, 18, 29,
34, 34, 17, 34, 34, 15, 20, 16, 34, 34,
34, 34, 34, 34, 22, 32, 27, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37
};
static void act33()
{
NLA = Eof;
}
static void act34()
{
NLA = RExpr;
zzmode(START);
}
static void act35()
{
NLA = 3;
/* MR16a */
zzline++;
warn("eoln found in string");
zzskip();
}
static void act36()
{
NLA = 4;
zzmore();
}
static void act37()
{
NLA = 5;
zzmore();
}
static unsigned char shift1[257] = {
0, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 2, 5, 5, 3, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 1, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 4, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5
};
static void act38()
{
NLA = Eof;
}
static void act39()
{
NLA = 6;
zzmode(ACTIONS); zzmore();
}
static void act40()
{
NLA = 7;
/* MR16a */
zzline++;
warn("eoln found in string (in user action)");
zzskip();
}
static void act41()
{
NLA = 8;
zzmore();
}
static void act42()
{
NLA = 9;
zzmore();
}
static unsigned char shift2[257] = {
0, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 2, 5, 5, 3, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 1, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 4, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5
};
static void act43()
{
NLA = Eof;
}
static void act44()
{
NLA = 10;
zzmode(ACTIONS); zzmore();
}
static void act45()
{
NLA = 11;
/* MR16a */
zzline++;
warn("eoln found in char literal (in user action)");
zzskip();
}
static void act46()
{
NLA = 12;
zzmore();
}
static void act47()
{
NLA = 13;
zzmore();
}
static unsigned char shift3[257] = {
0, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 2, 5, 5, 3, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
1, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 4, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5
};
static void act48()
{
NLA = Eof;
}
static void act49()
{
NLA = 14;
zzmode(ACTIONS); zzmore();
}
static void act50()
{
NLA = 15;
zzmore();
}
static void act51()
{
NLA = 16;
zzline++; zzmore();
}
static void act52()
{
NLA = 17;
zzmore();
}
static unsigned char shift4[257] = {
0, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 3, 5, 5, 4, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 1, 5, 5, 5, 5, 2, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -