File Coverage

lib/Parse/Gnaw/LinkedListConstants.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1              
2             package Parse::Gnaw::LinkedListConstants;
3              
4             our $VERSION = '0.001';
5              
6 19     19   103 use warnings;
  19         30  
  19         509  
7 19     19   292 use strict;
  19         37  
  19         858  
8              
9             =head1 NAME
10              
11             Parse::Gnaw::LinkedListLetterConstants - Hold subroutine/constants for LinkedListLetter objects
12             These are NOT contained in a separate package so that another file can use them and they automatically
13             get imported into that package.
14              
15             =head1 VERSION
16              
17             Version 0.01
18              
19             =cut
20              
21              
22             =head1 SUBROUTINES/METHODS
23              
24             =cut
25              
26             =head2 LIST__LETTER_PACKAGE
27             This is a constant index into the object array for the "letter" object package name.
28             The linked list object will need to create new letters and it will need to know
29             what package to use to create those letters from.
30             =cut
31              
32             =head2 LIST__CONNECTIONS_MINUS_ONE
33             This is a constant index into the object array for the Maximum Number of Axis, minus 1.
34             An object with 3 axis will have this set to 2.
35             Index into the axis array will be 0 .. LIST__CONNECTIONS_MINUS_ONE
36             =cut
37              
38             =head2 LIST__FIRST_START
39             This is a constant index into the object array for the LIST__FIRST_START.
40             The First start is a dummy placeholder letter that is always the "first"
41             Start position in the linked list and doesn't contain any real payload.
42             =cut
43              
44             =head2 LIST__LAST_START
45             This is a constant index into the object array for the LIST__LAST_START.
46             The Last Start is a dummy placeholder letter that is always the "last"
47             letter in the linked list "start" sequence and doesn't contain any real payload.
48             =cut
49              
50             =head2 LIST__CURR_START
51             This is a constant index into the object array for the LIST__CURR_START.
52             This is the current letter where we would start our next match/parse.
53             This is the letter AFTER the previous match.
54              
55             A B C D E F G
56              
57             If we do a match/parse that matches "A B C" then LIST__CURR_START will point to D.
58             =cut
59              
60             =head2 LIST__MOST_RECENTLY_CREATED_LETTER
61             This is a pointer to whatever was the last letter that was created by the linked list.
62             =cut
63              
64             =head2 LIST__HEADING_DIRECTION_INDEX
65             This remembers which way we are heading when we start finding a match.
66             =cut
67              
68             =head2 LIST__HEADING_PREVNEXT_INDEX
69             This remembers which way we are heading when we start finding a match.
70             =cut
71              
72             =head2 LIST__PREVIOUS_LINE_LETTER
73             This remembers the letter from the previous line.
74             Need this for 2D text and any other linked list structure that isn't just 1D.
75             =cut
76              
77             =head2 LIST__QUANTIFIER_STACK
78             As we parse this linked/list, ew need to keep track of the quantifiers we encounter.
79             =cut
80              
81             =head2 LIST__RULE_STACK
82             might need this later. currently not using it.
83             =cut
84              
85 19     19   88 use Exporter 'import';
  19         33  
  19         4109  
86             our @EXPORT = qw( LIST__LETTER_PACKAGE LIST__CONNECTIONS_MINUS_ONE LIST__FIRST_START LIST__LAST_START
87             LIST__CURR_START LIST__MOST_RECENTLY_CREATED_LETTER LIST__HEADING_DIRECTION_INDEX LIST__HEADING_PREVNEXT_INDEX
88             LIST__PREVIOUS_LINE_LETTER LIST__QUANTIFIER_STACK LIST__RULE_STACK );
89              
90             sub LIST__LETTER_PACKAGE (){0} # package name of letter class
91             sub LIST__CONNECTIONS_MINUS_ONE (){1} # max number of axis in this linked list minus 1
92             sub LIST__FIRST_START (){2} # pointer to FIRST start START position (always a place holder, not an actual letter)
93             sub LIST__LAST_START (){3} # pointer to LAST letter (always a place holder, not an actual letter)
94             sub LIST__CURR_START (){4} # pointer to CURRENT letter. Sometimes a placeholder, sometimes a letter.
95             sub LIST__MOST_RECENTLY_CREATED_LETTER (){5} # pointer to the most recently created letter associated with this linked list
96             sub LIST__HEADING_DIRECTION_INDEX (){6} # the direction index used by advance_to_next_connection
97             sub LIST__HEADING_PREVNEXT_INDEX (){7} # the prevnext index used by advance_to_next_connection
98             sub LIST__PREVIOUS_LINE_LETTER (){8} # the letter that is one line "up" from last appended letter (last start)
99             sub LIST__QUANTIFIER_STACK (){9} # quantifiers have to be kept track of so we can try differnt quantities.
100             sub LIST__RULE_STACK (){10} # quantifiers have to be kept track of so we can try differnt quantities.
101              
102              
103             1;
104              
105