|  line  | 
 stmt  | 
 bran  | 
 cond  | 
 sub  | 
 pod  | 
 time  | 
 code  | 
| 
1
 | 
  
 
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  | 
| 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # ParsingPatternParser.yp  | 
| 
3
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #   | 
| 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  used to generate Lingua::YaTeA::ParsingPatternParser.pm  | 
| 
5
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  | 
| 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  Use: yapp -m 'Lingua::YaTeA::ParsingPatternParser' -o lib/Lingua/YaTeA/ParsingPatternParser.pm lib/Lingua/YaTeA/ParsingPatternParser.yp  | 
| 
7
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  | 
| 
8
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # Parse::Yapp input grammar for parsing the yatea PArsint patterns  | 
| 
9
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  | 
| 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  | 
| 
11
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #  | 
| 
12
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 %{  | 
| 
13
 | 
5
 | 
 
 | 
 
 | 
  
5
  
 | 
 
 | 
1486
 | 
     use Lingua::YaTeA;  | 
| 
 
 | 
5
 | 
 
 | 
 
 | 
 
 | 
 
 | 
14
 | 
    | 
| 
 
 | 
5
 | 
 
 | 
 
 | 
 
 | 
 
 | 
48
 | 
    | 
| 
14
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #     use Data::Dumper;  | 
| 
15
 | 
5
 | 
 
 | 
 
 | 
  
5
  
 | 
 
 | 
166
 | 
     use warnings;  | 
| 
 
 | 
5
 | 
 
 | 
 
 | 
 
 | 
 
 | 
88
 | 
    | 
| 
 
 | 
5
 | 
 
 | 
 
 | 
 
 | 
 
 | 
9774
 | 
    | 
| 
16
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
17
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $node_set;  | 
| 
18
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $level = 0;  | 
| 
19
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $node;  | 
| 
20
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my @uncomplete;  | 
| 
21
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my @parse;  | 
| 
22
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $edge;  | 
| 
23
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $num_content_words;  | 
| 
24
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my @pos_sequence;  | 
| 
25
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $priority;  | 
| 
26
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $direction;  | 
| 
27
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $pos_sequence;  | 
| 
28
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $pattern;  | 
| 
29
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $parse;  | 
| 
30
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     my $num_line = 1;  | 
| 
31
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 %}  | 
| 
32
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 %%  | 
| 
33
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 input:  #empty  | 
| 
34
 | 
4
 | 
 
 | 
 
 | 
  
672
  
 | 
  
0
  
 | 
15
 | 
         |   input line  { # print STDERR "INPUT $_[1] \n";  | 
| 
 
 | 
 
 | 
 
 | 
 
 | 
  
4
  
 | 
 
 | 
 
 | 
    | 
| 
35
 | 
4
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
19
 | 
 		      }  | 
| 
36
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ;  | 
| 
37
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
38
 | 
392
 | 
 
 | 
 
 | 
  
392
  
 | 
 
 | 
14343
 | 
 line:       '\n' { $_[1] }  | 
| 
39
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         |  parsingpattern '\n' {   | 
| 
40
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # 	     print STDERR "=>$_[1]\n";  | 
| 
41
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
42
 | 
280
 | 
 
 | 
 
 | 
  
280
  
 | 
 
 | 
10623
 | 
 	     $pos_sequence = join(" ",@pos_sequence);  | 
| 
43
 | 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
630
 | 
 	     $parse = join(" ",@parse);  | 
| 
44
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # 	     print STDERR "parse = $parse\n";  | 
| 
45
 | 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
867
 | 
 	     $node_set->setRoot;   | 
| 
46
 | 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
945
 | 
 	     $pattern = Lingua::YaTeA::ParsingPattern->new($parse,$pos_sequence,$node_set,$priority,$direction,$num_content_words,$num_line);  | 
| 
47
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	       | 
| 
48
 | 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
696
 | 
   	     $_[0]->YYData->{PPRS}->addPattern($pattern);  | 
| 
49
 | 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
564
 | 
 	     @pos_sequence = ();  | 
| 
50
 | 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
388
 | 
 	     @uncomplete = ();  | 
| 
51
 | 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
408
 | 
 	     @parse = ();  | 
| 
52
 | 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
359
 | 
 	     $level = 0;  | 
| 
53
 | 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
600
 | 
   	     $_[0]->YYData->{PPRS}->checkContentWords($num_content_words,$num_line);  | 
| 
54
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
55
 | 
280
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
552
 | 
 	     if ($num_content_words > $Lingua::YaTeA::ParsingPatternRecordSet::max_content_words)  | 
| 
56
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	     {  | 
| 
57
 | 
8
 | 
 
 | 
 
 | 
 
 | 
 
 | 
17
 | 
 		 $Lingua::YaTeA::ParsingPatternRecordSet::max_content_words = $num_content_words;  | 
| 
58
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	     }  | 
| 
59
 | 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
343
 | 
 	     $num_content_words = 0;  | 
| 
60
 | 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
516
 | 
 	     $num_line++;  | 
| 
61
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	 }  | 
| 
62
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
 	|  error '\n' { $_[0]->YYErrok }  | 
| 
63
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ;  | 
| 
64
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
65
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 parsingpattern: { # print STDERR "START\n";  | 
| 
66
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
67
 | 
280
 | 
 
 | 
 
 | 
  
280
  
 | 
 
 | 
7373
 | 
 		  $node_set = Lingua::YaTeA::NodeSet->new;  | 
| 
68
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
69
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
                 } OPEN pattern END priority direction   | 
| 
70
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
 		|	error 'parsingpattern' { $_[0]->YYErrok }  | 
| 
71
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ;  | 
| 
72
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
73
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
74
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 pattern: CANDIDATE PREP DET CANDIDATE  | 
| 
75
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
              | CANDIDATE PREP CANDIDATE  | 
| 
76
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
              | CANDIDATE PREP PREP CANDIDATE  | 
| 
77
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
              | CANDIDATE DET CANDIDATE  | 
| 
78
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
              | CANDIDATE CANDIDATE  | 
| 
79
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
 	     |	error '\nnew_pattern: ' { $_[0]->YYErrok }  | 
| 
80
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ;  | 
| 
81
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
82
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 OPEN: OPEN_TAG {# print STDERR "OPEN $_[1]\n";  | 
| 
83
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
84
 | 
300
 | 
  
100
  
 | 
 
 | 
  
300
  
 | 
 
 | 
14927
 | 
 		if ($level == 0)  | 
| 
85
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 		{  | 
| 
86
 | 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
774
 | 
 		    $node = Lingua::YaTeA::RootNode->new($level);  | 
| 
87
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 		}  | 
| 
88
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 		else  | 
| 
89
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 		{  | 
| 
90
 | 
20
 | 
 
 | 
 
 | 
 
 | 
 
 | 
132
 | 
 		    $node = Lingua::YaTeA::InternalNode->new($level);  | 
| 
91
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 		}  | 
| 
92
 | 
300
 | 
 
 | 
 
 | 
 
 | 
 
 | 
854
 | 
 		$node_set->addNode($node);  | 
| 
93
 | 
300
 | 
 
 | 
 
 | 
 
 | 
 
 | 
577
 | 
 		push @uncomplete, $node;  | 
| 
94
 | 
300
 | 
 
 | 
 
 | 
 
 | 
 
 | 
403
 | 
 		$level++;  | 
| 
95
 | 
300
 | 
 
 | 
 
 | 
 
 | 
 
 | 
733
 | 
 		push @parse, $_[1];  | 
| 
96
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
97
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
 	     |	error '\nOPEN: ' { $_[0]->YYErrok }  | 
| 
98
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ;  | 
| 
99
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
100
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 CANDIDATE: CANDIDATE_TAG POSITION_TAG {  | 
| 
101
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #                print STDERR "CANDIDATE $_[1] $_[2]\n";  | 
| 
102
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
103
 | 
580
 | 
 
 | 
 
 | 
  
580
  
 | 
 
 | 
22864
 | 
 	       $edge = Lingua::YaTeA::PatternLeaf->new($_[1],$node);  | 
| 
104
 | 
580
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1618
 | 
 	       $node->addEdge($edge,$_[2]);  | 
| 
105
 | 
580
 | 
 
 | 
 
 | 
 
 | 
 
 | 
768
 | 
 	       $num_content_words++;  | 
| 
106
 | 
580
 | 
 
 | 
 
 | 
 
 | 
 
 | 
956
 | 
 	       push @pos_sequence,$_[1];    | 
| 
107
 | 
580
 | 
 
 | 
 
 | 
 
 | 
 
 | 
1517
 | 
 	       push @parse, "$_[1]<=$_[2]>";  | 
| 
108
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
109
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	   }  | 
| 
110
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	     | OPEN pattern CLOSE  | 
| 
111
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
 	     |	error '\nCANDIDATE: ' { $_[0]->YYErrok }  | 
| 
112
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ;  | 
| 
113
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
114
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 PREP: PREP_TAG {# print STDERR "PREP $_[1]\n";  | 
| 
115
 | 
108
 | 
 
 | 
 
 | 
  
108
  
 | 
 
 | 
3947
 | 
 		$node->{"PREP"} = $_[1];   | 
| 
116
 | 
108
 | 
 
 | 
 
 | 
 
 | 
 
 | 
174
 | 
 		push @pos_sequence, $_[1];  | 
| 
117
 | 
108
 | 
 
 | 
 
 | 
 
 | 
 
 | 
217
 | 
 		push @parse, $_[1];  | 
| 
118
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	    }  | 
| 
119
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
 	     |	error '\nPREP: ' { $_[0]->YYErrok }  | 
| 
120
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ;  | 
| 
121
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
122
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
123
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 DET: DET_TAG {# print STDERR "DET $_[1]\n";  | 
| 
124
 | 
52
 | 
 
 | 
 
 | 
  
52
  
 | 
 
 | 
1872
 | 
 	      $node->{"DET"} = $_[1];   | 
| 
125
 | 
52
 | 
 
 | 
 
 | 
 
 | 
 
 | 
88
 | 
 	      push @pos_sequence, $_[1];   | 
| 
126
 | 
52
 | 
 
 | 
 
 | 
 
 | 
 
 | 
116
 | 
 	      push @parse, $_[1];  | 
| 
127
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	  }  | 
| 
128
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
 	     |	error '\nDET: ' { $_[0]->YYErrok }  | 
| 
129
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ;  | 
| 
130
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
131
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 CLOSE: CLOSE_TAG {# print STDERR "CLOSE_TAG $_[1]\n";  | 
| 
132
 | 
20
 | 
 
 | 
 
 | 
  
20
  
 | 
 
 | 
765
 | 
 		  pop @uncomplete;  | 
| 
133
 | 
20
 | 
 
 | 
 
 | 
 
 | 
 
 | 
100
 | 
 		  $node->linkToFather(\@uncomplete,$_[1]);  | 
| 
134
 | 
20
 | 
 
 | 
 
 | 
 
 | 
 
 | 
44
 | 
 		  $node = $uncomplete[$#uncomplete];  | 
| 
135
 | 
20
 | 
 
 | 
 
 | 
 
 | 
 
 | 
38
 | 
 		  $level--;  | 
| 
136
 | 
20
 | 
 
 | 
 
 | 
 
 | 
 
 | 
46
 | 
 		  push @parse, ')';  | 
| 
137
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	      }  | 
| 
138
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
 	     |	error '\nCLOSE: ' { $_[0]->YYErrok }  | 
| 
139
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ;  | 
| 
140
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
141
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 END: END_TAG {# print STDERR "END $_[1]\n";   | 
| 
142
 | 
280
 | 
 
 | 
 
 | 
  
280
  
 | 
 
 | 
10334
 | 
 	      push @parse, $_[1];  | 
| 
143
 | 
280
 | 
 
 | 
 
 | 
 
 | 
 
 | 
520
 | 
 	      $_[1];  | 
| 
144
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	  }  | 
| 
145
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
 	     |	error '\nEND: ' { $_[0]->YYErrok };  | 
| 
146
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
147
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 priority: PRIORITY_TAG {# print STDERR "PRIORITY\n";  | 
| 
148
 | 
280
 | 
 
 | 
 
 | 
  
280
  
 | 
 
 | 
10290
 | 
 			$priority = $_[1];  | 
| 
149
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 		    }  | 
| 
150
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
 	     |	error '\npriority: ' { $_[0]->YYErrok }  | 
| 
151
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 ;  | 
| 
152
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
153
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 direction: DIRECTION_TAG {# print STDERR "DIRECTION $_[1]\n";  | 
| 
154
 | 
280
 | 
 
 | 
 
 | 
  
280
  
 | 
 
 | 
10436
 | 
 			  $direction = $_[1];  | 
| 
155
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 		      }  | 
| 
156
 | 
  
0
  
 | 
 
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
 	     |	error '\ndirection: ' { $_[0]->YYErrok }  | 
| 
157
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
731
 | 
 ;  | 
| 
158
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
159
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 %%  | 
| 
160
 | 
4
 | 
 
 | 
 
 | 
 
 | 
 
 | 
409
 | 
    | 
| 
161
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
162
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
163
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub _Error {  | 
| 
164
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         exists $_[0]->YYData->{ERRMSG}  | 
| 
165
 | 
  
0
  
 | 
  
  0
  
 | 
 
 | 
  
0
  
 | 
 
 | 
0
 | 
     and do {  | 
| 
166
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         print $_[0]->YYData->{ERRMSG};  | 
| 
167
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         delete $_[0]->YYData->{ERRMSG};  | 
| 
168
 | 
  
0
  
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
         return;  | 
| 
169
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     };  | 
| 
170
 | 
0
 | 
 
 | 
 
 | 
 
 | 
 
 | 
0
 | 
     print "Syntax error.\n";  | 
| 
171
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
172
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
173
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub _Lexer {  | 
| 
174
 | 
3156
 | 
 
 | 
 
 | 
  
3156
  
 | 
 
 | 
84509
 | 
     my($parser)=shift;  | 
| 
175
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
176
 | 
3156
 | 
 
 | 
 
 | 
 
 | 
 
 | 
6099
 | 
      my $fh = $parser->YYData->{FH};  | 
| 
177
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
178
 | 
3156
 | 
 
 | 
 
 | 
 
 | 
 
 | 
17133
 | 
     my $open = '(\()';  | 
| 
179
 | 
3156
 | 
 
 | 
 
 | 
 
 | 
 
 | 
5342
 | 
     my $det = $parser->YYData->{DETERMINERS};  | 
| 
180
 | 
3156
 | 
 
 | 
 
 | 
 
 | 
 
 | 
17427
 | 
     my $prep = $parser->YYData->{PREPOSITIONS};  | 
| 
181
 | 
3156
 | 
 
 | 
 
 | 
 
 | 
 
 | 
17084
 | 
     my $candidates = $parser->YYData->{CANDIDATES};  | 
| 
182
 | 
3156
 | 
 
 | 
 
 | 
 
 | 
 
 | 
15736
 | 
     my $positions = '<=(([MH])||(C[12]))>';  | 
| 
183
 | 
3156
 | 
 
 | 
 
 | 
 
 | 
 
 | 
4002
 | 
     my $close = '\)<=(([MH])||(C[12]))>';  | 
| 
184
 | 
3156
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3546
 | 
     my $end = '(\))\t+';  | 
| 
185
 | 
3156
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3522
 | 
     my $priority = '([0-9]+)\t+';  | 
| 
186
 | 
3156
 | 
 
 | 
 
 | 
 
 | 
 
 | 
3800
 | 
     my $direction = '((LEFT)|(RIGHT))';  | 
| 
187
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
188
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
189
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         $parser->YYData->{INPUT}  | 
| 
190
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
      or  $parser->YYData->{INPUT} = <$fh>  | 
| 
191
 | 
3156
 | 
  
100
  
 | 
  
100
  
 | 
 
 | 
 
 | 
5101
 | 
     or  return('',undef);  | 
| 
192
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
193
 | 
3152
 | 
 
 | 
 
 | 
 
 | 
 
 | 
25829
 | 
     $parser->YYData->{INPUT}=~s/^[ \t]*#.*//;  | 
| 
194
 | 
3152
 | 
 
 | 
 
 | 
 
 | 
 
 | 
20799
 | 
     $parser->YYData->{INPUT}=~s/^[ \t]*//;  | 
| 
195
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
196
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
197
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
198
 | 
3152
 | 
 
 | 
 
 | 
 
 | 
 
 | 
25596
 | 
     for ($parser->YYData->{INPUT}) {  | 
| 
199
 | 
3152
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
25392
 | 
         s/^$open\s*// and return ('OPEN_TAG', $1);  | 
| 
200
 | 
2852
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
12470
 | 
 	s/^$candidates\s*// and return('CANDIDATE_TAG', $1);  | 
| 
201
 | 
2272
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
6248
 | 
 	s/^$prep// and return('PREP_TAG', $1);  | 
| 
202
 | 
2164
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
5072
 | 
 	s/^$det// and return('DET_TAG', $1);  | 
| 
203
 | 
2112
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
8045
 | 
 	s/^$positions\s*// and return('POSITION_TAG', $1);  | 
| 
204
 | 
1532
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
3624
 | 
 	s/^$close// and return('CLOSE_TAG', $1);  | 
| 
205
 | 
1512
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
4640
 | 
 	s/^$end// and return('END_TAG', $1);  | 
| 
206
 | 
1232
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
4377
 | 
 	s/^$priority// and return('PRIORITY_TAG', $1);  | 
| 
207
 | 
952
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
3581
 | 
 	s/^$direction// and return('DIRECTION_TAG', $1);  | 
| 
208
 | 
672
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
4353
 | 
         s/^(.)//s  and return($1,$1);  | 
| 
209
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 	  | 
| 
210
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
211
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
212
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
213
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # sub Run {  | 
| 
214
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #     my($self)=shift;  | 
| 
215
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 #     $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );  | 
| 
216
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # }  | 
| 
217
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
218
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # my($parsingpattern)=new ParsingPatternParser;  | 
| 
219
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 # $parsingpattern->Run;  | 
| 
220
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
221
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
222
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 __END__  |