From ba2f726efdb97c95c6110b0365a011121e27fce3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 17 May 2000 06:53:21 +0000 Subject: - added typedefs - added parse error checking - made parser more flexible (This used to be commit ab0beaf3573471fab1fda3358987b337811f99b7) --- source3/aparser/parsetree.awk | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'source3/aparser/parsetree.awk') 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"]); -- cgit