/
grammar.h
38 lines (32 loc) · 900 Bytes
/
grammar.h
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
#ifndef GRAMMAR_H
#define GRAMMAR_H
// all of the grammar in this file is
// referenced here:
// https://cs.wmich.edu/~gupta/teaching/cs4850/sumII06/The%20syntax%20of%20C%20in%20Backus-Naur%20form.htm
bool is_reserved_keyword(const char* keyword);
/*
<type-specifier> ::= void
| char
| short
| int
| long
| float
| double
| signed
| unsigned
*/
bool is_type_specifier(const char* str);
/*
<type-qualifier> ::= const
| volatile
*/
bool is_type_qualifier(const char* str);
/*
<storage-class-specifier> ::= auto
| register
| static
| extern
| typedef
*/
bool is_storage_class_specifier(const char* str);
#endif