1: /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1984. */
2: /* $Header: b2syn.h,v 1.1 84/06/28 00:48:52 timo Exp $ */
3:
4: /* bsyn.h: syntax */
5:
6: /* General parsing routines */
7:
8: #define Eotc '\0'
9: #define Eouc '\036'
10: /* The character Eotc (end of text char) */
11: /* is placed after the last read character in txbuf. */
12: /* In general it follows a newline. */
13: /* If Eotc is encountered and more input is required, */
14: /* getline() is called. */
15: /* Eouc (end of unit char) is similar except the system */
16: /* never has to read beyond it. */
17:
18: #define Char(tx) (*(tx))
19: #define Eol(tx) (Char(tx) == '\n' || Char(tx) == Eouc)
20: #define Ceol(tx) (Char(tx) == '\\' || Eol(tx))
21: #define To_eol(tx) while (!Eol(tx)) tx++;
22: #define Mark_unit_end(tx) *tx= Eouc;
23:
24: #define Space(c) ((c) == ' ' || (c) == '\t')
25: #define Skipsp(tx) while(Space(Char(tx))) tx++
26:
27: #define Letter(c) ('a'<=c&&c<='z')
28: #define Cap(c) ('A'<=c&&c<='Z')
29: #define Dig(c) ('0'<=c&&c<='9')
30: #define Keymark(c) (Cap(c) || Dig(c) || c=='\'' || c=='"')
31: #define Tagmark(c) (Letter(c) || Dig(c) || c=='\'' || c=='"')
32: #define Keytagmark(c) (Keymark(c) || Letter(c))
33: #define Anytormark(c) (c=='+' || c=='-' || c=='*' || c=='/' || c=='#')
34: #define Montormark(c) (c=='~' || Anytormark(c))
35: #define Dyatormark(c) (Anytormark(c) || c=='^' || c=='<' || c=='>')
36:
37: /* Procedure upto(); */
38: /* Procedure need(); */
39: /* Procedure nothing(); */
40: /* Procedure thought(); */
41: /* Procedure findceol(); */
42: bool ateol();
43:
44: value findkw();
45: value keyword();
46: /* Procedure reqkw(); */
47: /* Procedure req(); */
48: value tag();
49:
50: bool atkw();
51: bool find();
52: intlet count();
53:
54: txptr fcol();
55: txptr lcol();
56: extern intlet alino;
57: extern txptr txstart, txend; /*TEMPORARY if possible*/
58:
59: /* Procedure getline(); */
60: intlet ilev();
61: /* Procedure veli(); */
62: /* Procedure inistreams(); */
63: /* Procedure re_streams(); */
64: /* Procedure open_stream(); */
65: /* Procedure close_stream(); */
Defined macros
Cap
defined in line
28; used 11 times
Ceol
defined in line
20; used 4 times
Char
defined in line
18; used 172 times
- in line 19-25(4)
- in /usr/src/new/B/src/bsmall/b2cmd.c line
88,
196-208(6),
234,
310,
362,
418,
430,
437(3),
457
- in /usr/src/new/B/src/bsmall/b2err.c line
64,
93
- in /usr/src/new/B/src/bsmall/b2exp.c line
115,
149,
158,
170,
186-200(10),
240,
256(2),
277-278(3),
305,
326-332(3),
338-346(6),
369-372(4),
381,
389-390(2),
412,
421,
456
- in /usr/src/new/B/src/bsmall/b2fpr.c line
144-157(4),
171-186(7)
- in /usr/src/new/B/src/bsmall/b2sou.c line
96(2),
111,
129,
140-144(2),
315,
325
- in /usr/src/new/B/src/bsmall/b2syn.c line
19,
40-51(12),
61,
69-70(2),
78,
84-92(4),
99-102(2),
109-113(3),
121-123(2),
136-138(3),
152-155(3),
171,
192,
240-255(8),
264(2),
275
- in /usr/src/new/B/src/bsmall/b2tar.c line
39-42(2),
56,
67(2),
77
- in /usr/src/new/B/src/bsmall/b2tes.c line
47,
55,
97,
115-121(4),
128-130(3)
- in /usr/src/new/B/src/bsmall/b2uni.c line
41-42(2),
83-96(7),
102,
110-118(3),
136,
168,
226,
390-392(3),
418-421(2),
464-468(2),
498-510(5)
Dig
defined in line
29; used 9 times
Eol
defined in line
19; used 9 times
Eotc
defined in line
8; used 11 times
Eouc
defined in line
9; used 8 times
Letter
defined in line
27; used 19 times
- in line 31-32(2)
- in /usr/src/new/B/src/bsmall/b2cmd.c line
419
- in /usr/src/new/B/src/bsmall/b2exp.c line
158
- in /usr/src/new/B/src/bsmall/b2sou.c line
144,
325
- in /usr/src/new/B/src/bsmall/b2syn.c line
136
- in /usr/src/new/B/src/bsmall/b2tar.c line
42
- in /usr/src/new/B/src/bsmall/b2tes.c line
55,
97
- in /usr/src/new/B/src/bsmall/b2uni.c line
42,
85,
93,
110,
168,
390,
421,
468,
506
Skipsp
defined in line
25; used 52 times
- in /usr/src/new/B/src/bsmall/b2cmd.c line
58,
195,
416
- in /usr/src/new/B/src/bsmall/b2exp.c line
114,
134,
155,
184,
239,
254,
284,
290,
411,
455-460(2)
- in /usr/src/new/B/src/bsmall/b2sou.c line
128,
314
- in /usr/src/new/B/src/bsmall/b2syn.c line
13,
25,
77,
83,
135,
170
- in /usr/src/new/B/src/bsmall/b2tar.c line
37,
55,
65,
75
- in /usr/src/new/B/src/bsmall/b2tes.c line
23,
45-50(2),
57,
82,
91,
114
- in /usr/src/new/B/src/bsmall/b2uni.c line
33,
39,
49-52(2),
82,
89,
101,
117,
163,
178-182(2),
191,
275,
388,
416,
447,
462,
500,
509
Space
defined in line
24; used 3 times
Usage of this include