diff options
Diffstat (limited to 'source4/build/pidl/util.pm')
-rw-r--r-- | source4/build/pidl/util.pm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/build/pidl/util.pm b/source4/build/pidl/util.pm index 26c940c02a..1420e21f41 100644 --- a/source4/build/pidl/util.pm +++ b/source4/build/pidl/util.pm @@ -215,4 +215,24 @@ sub useUintEnums() return $useUintEnums; } +sub ParseExpr($$) +{ + my($expr,$varlist) = @_; + + die("Undefined value in ParseExpr") if not defined($expr); + + my @tokens = split /((?:[A-Za-z_])(?:(?:(?:[A-Za-z0-9_.])|(?:->))+))/, $expr; + my $ret = ""; + + foreach my $t (@tokens) { + if (defined($varlist->{$t})) { + $ret .= $varlist->{$t}; + } else { + $ret .= $t; + } + } + + return $ret; +} + 1; |