ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/ActiveDoc/ActiveDoc.pm
(Generate patch)

Comparing COMP/SCRAM/src/ActiveDoc/ActiveDoc.pm (file contents):
Revision 1.11 by williamc, Fri Dec 17 15:29:01 1999 UTC vs.
Revision 1.12 by williamc, Fri Jan 14 18:01:03 2000 UTC

# Line 17 | Line 17
17   #                               : Add tags to the parse given by label
18   # checktag(tagname, hashref, param) : check for existence of param in
19   #                                       hashref from a tag call
20 + # includeparse(local_parsename, objparsename, activedoc) : copy the parse from
21 + #                                                       one object to another
22 + # currentparsename([name]) : get/set current parse name
23   # newdoc(file)  : Return an new object of the appropriate type
24   # getfile(url)  : get a processedfile object given a url
25   # activatedoc(url) : Return the object ref for a doc described by the given url
# Line 65 | Line 68 | sub parse {
68  
69          my $file=$self->file();
70          if ( $file ) {
71 +          $self->{currentparsename}=$parselabel;
72            $self->{currentparser}=$self->{parsers}{$parselabel};
73            $self->{parsers}{$parselabel}->parse($file,@_);
74            delete $self->{currentparser};
75 +          $self->{currentparsename}="";
76          }
77          else {
78            print "Cannot parse - file not known\n";
79          }
80   }
81  
82 + sub currentparsename {
83 +        my $self=shift;
84 +        @_?$self->{currentparsename}=shift
85 +          :$self->{currentparsename};
86 + }
87 +
88   sub newparse {
89          my $self=shift;
90          my $parselabel=shift;
# Line 83 | Line 94 | sub newparse {
94          $self->{parsers}{$parselabel}->addgrouptags();
95   }
96  
97 + sub includeparse {
98 +        my $self=shift;
99 +        my $parselabel=shift;
100 +        my $remoteparselabel=shift;
101 +        my $activedoc=shift;
102 +
103 +        # Some error trapping
104 +        if ( ! exists $self->{parsers}{$parselabel} ) {
105 +          $self->error("Unknown local parse name specified");
106 +        }
107 +        if ( ! exists $activedoc->{parsers}{$remoteparselabel} ) {
108 +          $self->error("Unknown parse name specified in remote obj $activedoc");
109 +        }
110 +
111 +        #
112 +        my $rp=$activedoc->{parsers}{$remoteparselabel};
113 +        $self->{parsers}{$parselabel}->includeparse($rp);
114 + }
115 +
116   sub addtag {
117          my $self=shift;
118          my $parselabel=shift;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines