aboutsummaryrefslogtreecommitdiff
path: root/unix/boot/spp/rpp/rpprat/errchk.r
blob: 4b948936199efe23902672cb52b33c87c957771e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
include defs

# ERRCHK -- Code called to process an ERRCHK declaration.

subroutine errchk

character tok, last_tok, gnbtok, token(MAXTOK)
integer	ntok
pointer	mktabl
include	COMMON_BLOCKS
string	serrcom1 "logical xerflg, xerpad(84)"
string	serrcom2 "common /xercom/ xerflg, xerpad"

	ntok = 0
	tok = 0

	repeat {
	    last_tok = tok
	    tok = gnbtok (token, MAXTOK)

	    switch (tok) {
	    case ALPHA:
		if (errtbl == NULL) {
		    errtbl = mktabl(0)			# make empty table
		    call outtab				# declare err flag
		    call outstr (serrcom1)
		    call outdon
		    call outtab				# declare err common
		    call outstr (serrcom2)
		    call outdon
		}
		call enter (token, 0, errtbl)		# enter keyw in table
	    case COMMA:
		# no action, but required by syntax
	    case NEWLINE:
		if (last_tok != COMMA)
		    break
	    default:
		call synerr ("Syntax error in ERRCHK declaration.")
	    }
	}
end