diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-05-17 06:53:21 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-05-17 06:53:21 +0000 |
commit | ba2f726efdb97c95c6110b0365a011121e27fce3 (patch) | |
tree | ab61d7cddc2bb615a938505b817cf0fd438999e0 /source3/aparser/parsetree.awk | |
parent | c560164030c0b842ee06f651a2b019c5596624a2 (diff) | |
download | samba-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/parsetree.awk')
-rw-r--r-- | source3/aparser/parsetree.awk | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source3/aparser/parsetree.awk b/source3/aparser/parsetree.awk index e99793f516..fe0958e7bf 100644 --- a/source3/aparser/parsetree.awk +++ b/source3/aparser/parsetree.awk @@ -9,6 +9,19 @@ function start_module(name) num_tests=0; } +function parse_typedef(type1, type2, + LOCAL, type, i) +{ + type=type2; + if (substr(type,1,1)=="*") type=substr(type,2); + + i=match(type,"[[]"); + if (i != 0) type = substr(type, 1, i-1); + start_struct(type); + add_struct_elem(type1, type2); + end_struct(""); +} + function start_struct(name) { current_struct=num_structs; @@ -18,8 +31,9 @@ function start_struct(name) structs[current_struct, "num_unions"]=0; } -function end_struct() +function end_struct(name) { + if (name!="") structs[num_structs, "name"]=name; printf("struct %s with %d elements\n", structs[num_structs, "name"], structs[num_structs, "num_elems"]); |