summaryrefslogtreecommitdiff
path: root/source3/aparser/main.awk
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-05-17 06:53:21 +0000
committerAndrew Tridgell <tridge@samba.org>2000-05-17 06:53:21 +0000
commitba2f726efdb97c95c6110b0365a011121e27fce3 (patch)
treeab61d7cddc2bb615a938505b817cf0fd438999e0 /source3/aparser/main.awk
parentc560164030c0b842ee06f651a2b019c5596624a2 (diff)
downloadsamba-ba2f726efdb97c95c6110b0365a011121e27fce3.tar.gz
samba-ba2f726efdb97c95c6110b0365a011121e27fce3.tar.bz2
samba-ba2f726efdb97c95c6110b0365a011121e27fce3.zip
- added typedefs
- added parse error checking - made parser more flexible (This used to be commit ab0beaf3573471fab1fda3358987b337811f99b7)
Diffstat (limited to 'source3/aparser/main.awk')
-rw-r--r--source3/aparser/main.awk51
1 files changed, 8 insertions, 43 deletions
diff --git a/source3/aparser/main.awk b/source3/aparser/main.awk
index 5d67f123c7..46acfe5c59 100644
--- a/source3/aparser/main.awk
+++ b/source3/aparser/main.awk
@@ -1,57 +1,22 @@
# 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/ {
- add_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]);
-}
+@include parsetree.awk
+@include token.awk
END {
- dump_structs("debug.out");
+ dump_structs("dump.out");
+ printf("Producing headers...\n");
produce_headers("prs_"module".h");
+ printf("Producing parsers...\n");
produce_parsers("prs_"module".c");
+ printf("Producing harness...\n");
produce_harness("test.h");
+ printf("Done.\n");
+ exit 0;
}