summaryrefslogtreecommitdiff
path: root/source4/pidl/idl.yp
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-12-24 21:57:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:42 -0500
commite791dd73b98308b949f4ecfb91b5c87183b5de76 (patch)
tree0b749c88ab1f59e756fa8860bf84107b6fd851b2 /source4/pidl/idl.yp
parent557ad72e7ac1988db6f1f030a990bf2979220a69 (diff)
downloadsamba-e791dd73b98308b949f4ecfb91b5c87183b5de76.tar.gz
samba-e791dd73b98308b949f4ecfb91b5c87183b5de76.tar.bz2
samba-e791dd73b98308b949f4ecfb91b5c87183b5de76.zip
r12462: Hide oo magic from callers of the parser
(This used to be commit 0c225d2978b11898d334ec2d6da910e0cca0f4cd)
Diffstat (limited to 'source4/pidl/idl.yp')
-rw-r--r--source4/pidl/idl.yp27
1 files changed, 18 insertions, 9 deletions
diff --git a/source4/pidl/idl.yp b/source4/pidl/idl.yp
index 2613f11320..ef0ec203a7 100644
--- a/source4/pidl/idl.yp
+++ b/source4/pidl/idl.yp
@@ -416,9 +416,24 @@ again:
}
}
-sub parse_idl($$)
+sub parse_string($)
{
- my ($self,$filename) = @_;
+ my ($data) = @_;
+
+ my $self = new Parse::Pidl::IDL;
+
+ $self->YYData->{INPUT} = $data;
+ $self->YYData->{LINE} = 0;
+ $self->YYData->{LAST_TOKEN} = "NONE";
+
+ my $idl = $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );
+
+ return CleanData($idl);
+}
+
+sub parse_file($)
+{
+ my ($filename) = @_;
my $saved_delim = $/;
undef $/;
@@ -429,11 +444,5 @@ sub parse_idl($$)
my $data = `$cpp -D__PIDL__ -xc $filename`;
$/ = $saved_delim;
- $self->YYData->{INPUT} = $data;
- $self->YYData->{LINE} = 0;
- $self->YYData->{LAST_TOKEN} = "NONE";
-
- my $idl = $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );
-
- return CleanData($idl);
+ return parse_string($data);
}