diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-05-22 09:09:37 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-05-22 09:09:37 +0000 |
commit | 943340a5a3f5d725e2cd35ab47f33083837cb904 (patch) | |
tree | 9e94688083bb5cc54cb44e4ac194fc3772345435 /source3/aparser/token.awk | |
parent | 74d677ec591a715e28dba29a33ee40e1b1c2f830 (diff) | |
download | samba-943340a5a3f5d725e2cd35ab47f33083837cb904.tar.gz samba-943340a5a3f5d725e2cd35ab47f33083837cb904.tar.bz2 samba-943340a5a3f5d725e2cd35ab47f33083837cb904.zip |
more aparser stuff - we now handle everything but the idl headers in srvsvc.idl
(This used to be commit 5f1e8422d0ebc589cdfe95f1001a8e55cb60af4a)
Diffstat (limited to 'source3/aparser/token.awk')
-rw-r--r-- | source3/aparser/token.awk | 63 |
1 files changed, 61 insertions, 2 deletions
diff --git a/source3/aparser/token.awk b/source3/aparser/token.awk index d0703439e9..0c4c7f65b1 100644 --- a/source3/aparser/token.awk +++ b/source3/aparser/token.awk @@ -10,7 +10,7 @@ function parse_error(msg) { next; } -/^\#define.*;/ { +/^\#define.*/ { split($0,a,"[ \t;]*"); parse_define(a[2], a[3]); next; @@ -46,6 +46,20 @@ function parse_error(msg) { next; } +/^[ \t]*typedef union.*\{/ { + {if (current_struct!="") parse_error("this cannot appear inside a structure");} + split($0,a,"[ \t;()]*"); + start_union_encap(a[4], a[6], a[7], a[8]); + next; +} + +/^[ \t]*STATUS.*\(/ { + {if (current_struct!="") parse_error("you cannot have nested structures");} + split($0,a,"[ \t;()]*"); + start_function(a[2], a[3]); + next; +} + {if (current_struct=="") parse_error("this must appear inside a structure");} /^[ \t]*union.*\{/ { @@ -54,6 +68,13 @@ function parse_error(msg) { next; } +/^[ \t]*\[switch_is.*union.*\{/ { + {if (current_union!="") parse_error("you cannot have nested unions");} + split($0,a,"[ \t;()]*"); + start_union_notencap(a[3]); + next; +} + /^[ \t]*case.*;/ { {if (current_union=="") parse_error("this must appear inide a union");} split($0,a,"[ \t;]*"); @@ -61,12 +82,27 @@ function parse_error(msg) { next; } +/^[ \t]*\[case(.*)\].*;/ { + {if (current_union=="") parse_error("this must appear inide a union");} + split($0,a,"[ \t;()[\]]*"); + parse_case(a[6],a[8],a[9]); + next; +} + /^[ \t]*\}$/ { {if (current_union=="") parse_error("this must appear inside a union");} - end_union(); + end_union(""); next; } +/^[ \t]*\} .*;/ { + if (current_union!="") { + split($2,a,"[ \t;]*"); + end_union(a[1]); + next; + } +} + {if (current_union!="") parse_error("this cannot appear inside a union");} /^[ \t]*\};/ { @@ -80,12 +116,35 @@ function parse_error(msg) { next; } +/^[ \t]*\);/ { + end_function(); + next; +} + +/^.*size_is.*\*.*;/ { + split($0,a,"[ \t;()]*"); + add_sizeis_array(a[3], a[5], a[6]); + next; +} + /^.*;/ { split($0,a,"[ \t;]*"); add_struct_elem(a[2], a[3]); next; } +/^[\t ]*void/ { + next; +} + +/^[ \t]*\[.*\].*/ { + split($0,a,"[ \t;]*"); + split(a[4], b, "[,]"); + add_function_param(a[2], a[3], b[1]); + next; +} + { parse_error("Unknown construct."); } + |