-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoken.c
More file actions
34 lines (32 loc) · 763 Bytes
/
token.c
File metadata and controls
34 lines (32 loc) · 763 Bytes
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
/*
* token.c
*
* PCS2056 - Linguagens e Compiladores
* Pedro Napolitano Sant’Ana 8041817
* Rafael Freitas da Silva 6480585
*
*/
#include <stdio.h>
#include "token.h"
void printTokenType(int type) {
switch (type) {
case TYPE_IDENTIFIER:
printf("<Identifier>");
break;
case TYPE_CONSTANT:
printf("<Constant> ");
break;
case TYPE_STRING:
printf("<String> ");
break;
case TYPE_OPERATOR:
printf("<Operator> ");
break;
case TYPE_PUNCTUATOR:
printf("<Punctuator>");
break;
case TYPE_KEYWORD:
printf("<Keyword> ");
break;
}
}