Lines Matching refs:label
38 // open-close parenthesis label pairs are passed in 'parens'.
43 typedef L Label;
49 // 'child_map_' accessed by stack_id and label. The paren_id is
58 PdtStack(const vector<pair<Label, Label> > &parens)
61 const pair<Label, Label> &p = parens[i];
79 // label read. 'Pushes' onto a stack if the label is an open
81 // label is a close parenthesis that matches the top of the stack,
82 // returning the parent stack ID. Returns -1 if label is an
85 StackId Find(StackId stack_id, Label label) {
86 if (min_paren_ == kNoLabel || label < min_paren_ || label > max_paren_)
89 typename unordered_map<Label, size_t>::const_iterator pit
90 = paren_map_.find(label);
95 if (label == parens_[paren_id].first) { // Open paren.
96 StackId &child_id = child_map_[make_pair(stack_id, label)];
97 if (child_id == 0) { // Child not found, push label.
111 // Returns the stack ID obtained by "popping" the label at the top
122 ssize_t ParenId(Label label) const {
123 typename unordered_map<Label, size_t>::const_iterator pit
124 = paren_map_.find(label);
132 size_t operator()(const pair<StackId, Label> &p) const {
139 vector<pair<Label, Label> > parens_;
141 unordered_map<Label, size_t> paren_map_;
142 unordered_map<pair<StackId, Label>,
143 StackId, ChildHash> child_map_; // Child of stack node wrt label
144 Label min_paren_; // For faster paren. check
145 Label max_paren_; // For faster paren. check