-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathd.shilka
63 lines (57 loc) · 3.36 KB
/
d.shilka
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
Copyright (C) 1997-2016 Vladimir Makarov.
Written by Vladimir Makarov <[email protected]>
This file is part of the tool SHILKA.
This is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
/* Keywords of ANSI C. */
%import {
struct keyword {int kw; int primitive_type_flag;};
typedef struct keyword *keyword_t;
}
%type keyword_t
%%
if {static struct keyword res = {KR_if, 0}; return &res;}
do {static struct keyword res = {KR_do, 0}; return &res;}
int {static struct keyword res = {KR_int, 1}; return &res;}
for {static struct keyword res = {KR_for, 0}; return &res;}
case {static struct keyword res = {KR_case, 0}; return &res;}
char 1600 {static struct keyword res = {KR_char, 1}; return &res;}
auto {static struct keyword res = {KR_auto, 0}; return &res;}
goto {static struct keyword res = {KR_goto, 0}; return &res;}
else 5700 {static struct keyword res = {KR_else, 0}; return &res;}
long {static struct keyword res = {KR_long, 0}; return &res;}
void 8200 {static struct keyword res = {KR_void, 1}; return &res;}
enum {static struct keyword res = {KR_void, 0}; return &res;}
float {static struct keyword res = {KR_float, 1}; return &res;}
short {static struct keyword res = {KR_short, 0}; return &res;}
union {static struct keyword res = {KR_union, 0}; return &res;}
break {static struct keyword res = {KR_break, 0}; return &res;}
while {static struct keyword res = {KR_while, 0}; return &res;}
const {static struct keyword res = {KR_const, 0}; return &res;}
double {static struct keyword res = {KR_double, 0}; return &res;}
static 7300 {static struct keyword res = {KR_static, 0}; return &res;}
extern {static struct keyword res = {KR_extern, 0}; return &res;}
struct {static struct keyword res = {KR_struct, 0}; return &res;}
return 1000 {static struct keyword res = {KR_return, 0}; return &res;}
sizeof 1100 {static struct keyword res = {KR_sizeof, 0}; return &res;}
switch {static struct keyword res = {KR_switch, 0}; return &res;}
signed {static struct keyword res = {KR_signed, 0}; return &res;}
typedef {static struct keyword res = {KR_typedef, 0}; return &res;}
default {static struct keyword res = {KR_default, 0}; return &res;}
unsigned {static struct keyword res = {KR_unsigned, 0}; return &res;}
continue {static struct keyword res = {KR_continue, 0}; return &res;}
register {static struct keyword res = {KR_register, 0}; return &res;}
volatile {static struct keyword res = {KR_volatile, 0}; return &res;}
%other {return NULL;}