nrform

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 代码 · 共 156 行

TXT
156
字号
block datainteger cshift, csize, yynlincommon /yyllib/ cshift, csize, yynlindata yynlin/YYNEWLINE/endblock datacommon /yyldat/ yyfnd, ymorf, yyprev, yybgin, yytopinteger yyfnd, yymorf, yyprev, yybgin, yytopdata yybgin/1/data yyprev/YYNEWLINE/data yytop/YYTOPVAL/endinteger function yylook(dummy)common /Lverif/ verifcommon /Ladvan/ advancommon /Lstoff/ stoffcommon /Lsfall/ sfallcommon /Latable/ atablecommon /Lextra/ extracommon /Lvstop/ vstopinteger verif(Sverif), advan(Sadvan),stoff(Sstoff),match(Smatch)integer sfall(Ssfall),atable(Satable),extra(Sextra), vstop(Svstop)integer state, lsp, rinteger  ch, ncommon /yyldat/ yyfnd, yymorf, yyprev, yybgin, yytop, yylsp, yylsta(YYLMAX)common /yyxel/ yyleng, yytextinteger yyfnd, yymorf, yylsta, yylsp, yytext, yyprev, yyleng, yytopinteger  lexshf, yytext(YYLMAX), yyback, yybgininteger z, tif (yymorf .eq. 0)	yyleng = 0else	yymorf=01776	lsp = 1	state = yybgin	if (yyprev .eq. YYNEWLINE)		state = state + 1	for (;;){		r = stoff(state)		if (r .eq. 0){			z = sfall(state)			if (z .eq. 0)				break			if(stoff(z) == 0) break			}		ch = input(dummy)		ich = lexshf(ch)		yyleng = yyleng+1		yytext(yyleng) = ch		1984		if(r .gt. 0){			t = r + ich			if (t<= yytop){			  if (verif(t) .eq. state){				if(advan(t) == YYERROR){					call unput(yytext(yyleng))					yyleng = yyleng - 1					break					}				state = advan(t)				yylsta(lsp) = state				lsp = lsp +1				goto 2001				}			  }			}		if(r < 0){			t = r + ich			if (t <= yytop .and. verif(t) .eq. state){				if(advan(t) == YYERROR){					call unput(yytext(yyleng))					yyleng = yyleng - 1					break					}				state = advan(t)				yylsta(lsp) = state				lsp = lsp +1				goto 2001				}			t = r + match(ich)			if(t <= yytop && state == verif(t)){				if(advan(t) == YYERROR){					call unput(yytext(yyleng))					yyleng = yyleng - 1					break					}			state = advan(t)			yylsta(lsp) = state			lsp = lsp + 1			goto 2001			}		}		else {			if (state > 0) state = sfall(state)			if (state .gt. 0) r = stoff(state)			if (state .gt. 0 .and. r .ne. 0)				goto 1984			call unput(yytext(yyleng))			yyleng = yyleng -1			break			}	2001		continue		}	while (lsp .gt. 1){		lsp = lsp -1		ilsp = yylsta(lsp)		yyfnd = atable(ilsp)		if (yyfnd .gt. 0)			if (vstop(yyfnd) .gt. 0){				r = vstop(yyfnd)				if (extra(r) .ne. 0){					for(;;){					ilsp = yylsta(lsp)					if (yyback(atable(ilsp), -r) .eq. 1)						break					lsp= lsp -1					call unput(yytext(yyleng))					yyleng = yyleng -1					}					}				yyprev = lexshf(yytext(yyleng))				yylsp = lsp				yyfnd = yyfnd + 1				yylook = r				yytext(yyleng+1) = 0				return				}		call unput(yytext(yyleng))		}	if (yytext(1) .eq. 0){		yylook=0		return		}	yyprev = input(dummy)	call output(yyprev)	yyprev = lexshf(yyprev)	yyleng = 0	goto 1776endinteger function yyback (isub, n)common /Lvstop/ vstopinteger vstop(Svstop)if (isub .ne. 0)while (vstop(isub) .ne. 0){	if (vstop(isub) .eq. m){		yyback = 1		return		}	isub = isub + 1	}yyback = 0return end

⌨️ 快捷键说明

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