⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scan.c

📁 本工具提供一个词法分析器和语法分析器的集成开发环境
💻 C
📖 第 1 页 / 共 5 页
字号:
/* parser.dlg -- DLG Description of scanner * * Generated from: antlr.g * * Terence Parr, Will Cohen, and Hank Dietz: 1989-1998 * Purdue University Electrical Engineering * With AHPCRC, University of Minnesota * ANTLR Version 1.33MR14 */#define ANTLR_VERSION	13314#include "pcctscfg.h"#include PCCTS_STDIO_H#include "set.h"#include <ctype.h>#include "syn.h"#include "hash.h"#include "generic.h"#define zzcr_attr(attr,tok,t)#include "antlr.h"#include "tokens.h"#include "dlgdef.h"LOOKAHEADvoid zzerraction(){	(*zzerr)("invalid token");	zzadvance();	zzskip();}/* * D L G tables * * Generated from: parser.dlg * * 1989-1998 by  Will Cohen, Terence Parr, and Hank Dietz * Purdue University Electrical Engineering * DLG Version 1.33MR14 */#include "mode.h"/* maintained, but not used for now */set AST_nodes_refd_in_actions = set_init;int inAlt = 0;set attribsRefdFromAction;int UsedOldStyleAttrib = 0;int UsedNewStyleLabel = 0;#ifdef __USE_PROTOSchar *inline_set(char *);#elsechar *inline_set();#endif/* MR1	10-Apr-97  MR1  Previously unable to put right shift operator	    *//* MR1					in DLG action			                    */int tokenActionActive=0;                                            /* MR1 */static char *#ifdef __USE_PROTOSgetFileNameFromTheLineInfo(char *toStr, char *fromStr)#elsegetFileNameFromTheLineInfo(toStr, fromStr)char *toStr, *fromStr;#endif{	int i, j, k;	  if (!fromStr || !toStr) return toStr;	  /* find the first " */	  for (i=0;	(i<MaxFileName) &&	(fromStr[i] != '\n') &&	(fromStr[i] != '\r') &&	(fromStr[i] != '\"');	i++) /* nothing */ ;	  if ( (i == MaxFileName) ||	(fromStr[i] == '\n') ||	(fromStr[i] == '\r') ) {	return toStr;}  /* find the second " */  for (j=i+1;(j<MaxFileName) &&(fromStr[j] != '\n') &&(fromStr[j] != '\r') &&(fromStr[j] != '\"');j++) /* nothing */ ;  if ((j == MaxFileName) ||(fromStr[j] == '\n') ||(fromStr[j] == '\r') ) {	return toStr;}  /* go back until the last / or \ */  for (k=j-1;(fromStr[k] != '\"') &&(fromStr[k] != '/') &&(fromStr[k] != '\\');k--) /* nothing */ ;  /* copy the string after " / or \ into toStr */  for (i=k+1; fromStr[i] != '\"'; i++) {toStr[i-k-1] = fromStr[i];}  toStr[i-k-1] = '\0';  return toStr;}/* MR14 end of a block to support #line in antlr source code */#ifdef __USE_PROTOSvoid mark_label_used_in_sem_pred(LabelEntry *le)              /* MR10 */#elsevoid mark_label_used_in_sem_pred(le)                          /* MR10 */LabelEntry    *le;#endif{	TokNode   *tn;	require (le->elem->ntype == nToken,"mark_label_used... ntype != nToken");	tn=(TokNode *)le->elem;	require (tn->label != 0,"mark_label_used... TokNode has no label");	tn->label_used_in_semantic_pred=1;}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 ) { NLA=Eof; return; }			fclose( input );			input = new_input;			zzrdstream( input );			zzskip();	/* Skip the Eof (@) char i.e continue */		}	}static void act2(){		NLA = 76;		zzskip();	}static void act3(){		NLA = 77;		zzline++; zzskip();	}static void act4(){		NLA = 78;		zzmode(ACTIONS); zzmore();		istackreset();		pushint(']');	}static void act5(){		NLA = 79;		action_file=CurFile; action_line=zzline;		zzmode(ACTIONS); zzmore();		list_free(&CurActionLabels,0);       /* MR10 */		numericActionLabel=0;                /* MR10 */		istackreset();		pushint('>');	}static void act6(){		NLA = 80;		zzmode(STRINGS); zzmore();	}static void act7(){		NLA = 81;		zzmode(COMMENTS); zzskip();	}static void act8(){		NLA = 82;		warn("Missing /*; found dangling */"); zzskip();	}static void act9(){		NLA = 83;		zzmode(CPP_COMMENTS); zzskip();	}static void act10(){		NLA = 84;				zzline = atoi(zzbegexpr+5) - 1; zzline++; zzmore();		getFileNameFromTheLineInfo(FileStr[CurFile], zzbegexpr);	}static void act11(){		NLA = 85;				zzline++; zzmore();	}static void act12(){		NLA = 86;		warn("Missing <<; found dangling >>"); zzskip();	}static void act13(){		NLA = WildCard;	}static void act14(){		NLA = 88;		FoundException = 1;		/* MR6 */		FoundAtOperator = 1;	}static void act15(){		NLA = 92;	}static void act16(){		NLA = 93;	}static void act17(){		NLA = 94;	}static void act18(){		NLA = 95;	}static void act19(){		NLA = 96;	}static void act20(){		NLA = 97;	}static void act21(){		NLA = 100;	}static void act22(){		NLA = 101;	}static void act23(){		NLA = 102;	}static void act24(){		NLA = 103;	}static void act25(){		NLA = 104;	}static void act26(){		NLA = 105;	}static void act27(){		NLA = 106;	}static void act28(){		NLA = 107;	}static void act29(){		NLA = 108;	}static void act30(){		NLA = 109;	}static void act31(){		NLA = 110;	}static void act32(){		NLA = 111;	}static void act33(){		NLA = 112;	}static void act34(){		NLA = 113;	}static void act35(){		NLA = 114;	}static void act36(){		NLA = 115;	}static void act37(){		NLA = 116;	}static void act38(){		NLA = 117;	}static void act39(){		NLA = 118;	}static void act40(){		NLA = 119;	}static void act41(){		NLA = 120;	}static void act42(){		NLA = 121;	}static void act43(){		NLA = 122;	}static void act44(){		NLA = 123;	}static void act45(){		NLA = 124;	}static void act46(){		NLA = 125;	}static void act47(){		NLA = 126;	}static void act48(){		NLA = 127;	}static void act49(){		NLA = 128;	}static void act50(){		NLA = 129;	}static void act51(){		NLA = 130;	}static void act52(){		NLA = 131;	}static void act53(){		NLA = 132;	}static void act54(){		NLA = 133;	}static void act55(){		NLA = 134;	}static void act56(){		NLA = NonTerminal;				while ( zzchar==' ' || zzchar=='\t' ) {			zzadvance();		}		if ( zzchar == ':' && inAlt ) NLA = LABEL;	}static void act57(){		NLA = TokenTerm;				while ( zzchar==' ' || zzchar=='\t' ) {			zzadvance();		}		if ( zzchar == ':' && inAlt ) NLA = LABEL;	}static void act58(){		NLA = 135;		warn(eMsg1("unknown meta-op: %s",LATEXT(1))); zzskip();	}static unsigned char shift0[257] = {  0, 55, 55, 55, 55, 55, 55, 55, 55, 55,  1, 2, 55, 55, 3, 55, 55, 55, 55, 55,  55, 55, 55, 55, 55, 55, 55, 55, 55, 55,  55, 55, 55, 1, 34, 6, 9, 55, 55, 41,  55, 42, 43, 8, 49, 55, 55, 18, 7, 16,  14, 15, 16, 16, 16, 16, 16, 16, 16, 35,  36, 5, 44, 17, 50, 19, 53, 53, 53, 53,  53, 53, 53, 53, 53, 53, 53, 48, 53, 53,  53, 53, 53, 53, 53, 53, 53, 53, 53, 53,  53, 53, 4, 20, 55, 46, 54, 55, 22, 39,  32, 23, 13, 25, 47, 21, 11, 52, 30, 10,  38, 12, 29, 28, 52, 24, 26, 27, 51, 52,  52, 37, 52, 52, 33, 40, 31, 45, 55, 55,  55, 55, 55, 55, 55, 55, 55, 55, 55, 55,  55, 55, 55, 55, 55, 55, 55, 55, 55, 55,  55, 55, 55, 55, 55, 55, 55, 55, 55, 55,  55, 55, 55, 55, 55, 55, 55, 55, 55, 55,  55, 55, 55, 55, 55, 55, 55, 55, 55, 55,  55, 55, 55, 55, 55, 55, 55, 55, 55, 55,  55, 55, 55, 55, 55, 55, 55, 55, 55, 55,  55, 55, 55, 55, 55, 55, 55, 55, 55, 55,  55, 55, 55, 55, 55, 55, 55, 55, 55, 55,  55, 55, 55, 55, 55, 55, 55, 55, 55, 55,  55, 55, 55, 55, 55, 55, 55, 55, 55, 55,  55, 55, 55, 55, 55, 55, 55, 55, 55, 55,  55, 55, 55, 55, 55, 55, 55};

⌨️ 快捷键说明

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