blob: d891970c684462307095d5109533d3312ebc57c7 (
plain)
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
|
# the main program
@include dump.awk
@include parsetree.awk
@include header.awk
@include util.awk
@include template.awk
@include parsefn.awk
@include harness.awk
/^module/ {
start_module($2);
next;
}
/^test/ {
test=$2;
next;
}
/^struct.*\{/ {
start_struct($2);
next;
}
/^[ \t]*union.*\{/ {
start_union($2);
next;
}
/^[ \t]*case.*;/ {
split($0,a,"[ \t;]*");
parse_case(a[3],a[4],a[5]);
next;
}
/^\};/ {
end_struct();
next;
}
/^[ \t]*\}/ {
end_union();
next;
}
/.*;/ {
split($0,a,"[ \t;]*");
add_struct_elem(a[2], a[3]);
}
END {
dump_structs("debug.out");
produce_headers("prs_"module".h");
produce_parsers("prs_"module".c");
produce_harness("test.h");
}
|