aboutsummaryrefslogtreecommitdiff
path: root/5.20/main.c
blob: 689c229d6debc5787032c70712637bb8699d60b0 (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
#include <stdio.h>
#include <string.h>
#include "token.h"
#include "getch.h"
#include "dcl.h"

char datatype[MAXTOKEN];

int main(void)
{
	while (gettoken() != EOF) {
		if (tokentype == '\n') /* skip empty lines */
			continue;

		datatype[0] = '\0';
		do {
			strcat(datatype, token);
			strcat(datatype, " ");
		} while (gettoken() == NAME && isdtspec());
		prevtoken = YES;

		if (tokentype == EOF)
			break;

		out[0] = '\0';
		dcl();
		if (tokentype != '\n')
			printf("synatx error\n");
		printf("%s: %s %s\n", name, out, datatype);
	}

	return 0;
}