Lines Matching refs:this

30         $this->handler = new refnotes_bibtex_handler();
31 $this->lexer = new refnotes_bibtex_lexer($this->handler, 'base', true);
33 $this->addBibtexMode(new refnotes_bibtex_outside_mode());
34 $this->addBibtexMode(new refnotes_bibtex_entry_mode('parented'));
35 $this->addBibtexMode(new refnotes_bibtex_entry_mode('braced'));
36 $this->addBibtexMode(new refnotes_bibtex_field_mode());
37 $this->addBibtexMode(new refnotes_bibtex_integer_value_mode());
38 $this->addBibtexMode(new refnotes_bibtex_string_value_mode('quoted'));
39 $this->addBibtexMode(new refnotes_bibtex_string_value_mode('braced'));
40 $this->addBibtexMode(new refnotes_bibtex_nested_braces_mode('quoted'));
41 $this->addBibtexMode(new refnotes_bibtex_nested_braces_mode('braced'));
42 $this->addBibtexMode(new refnotes_bibtex_concatenation_mode());
49 $this->addMode($mode->getName(), $mode);
56 if (!$this->connected) {
57 $this->modes['outside']->connectTo('base');
58 $this->modes['entry_parented']->connectTo('base');
59 $this->modes['entry_braced']->connectTo('base');
69 $this->connectModes();
71 $this->handler->reset();
72 $this->lexer->parse(str_replace("\r\n", "\n", $text));
74 return $this->handler->finalize();
87 while (is_array($parsed = $this->reduce($text))) {
90 if (!$this->dispatchTokens($unmatched, $matched, $mode, 0, 0)) {
94 if (empty($unmatched) && empty($matched) && ($lastMode == $this->modeStack->getCurrent())) {
98 $lastMode = $this->modeStack->getCurrent();
105 return $this->invokeHandler($text, DOKU_LEXER_UNMATCHED, 0);
116 $mode = $this->modeStack->getCurrent();
117 $handler = isset($this->mode_handlers[$mode]) ? $this->mode_handlers[$mode] : $mode;
119 return $this->handler->$handler($text, $state, $pos);
136 $this->name = preg_replace('/refnotes_bibtex_(\w+)_mode/', '$1', get_class($this));
137 $this->handler = '';
139 $this->specialPattern = array();
140 $this->entryPattern = array();
141 $this->exitPattern = array();
155 return $this->name;
162 foreach ($this->specialPattern as $pattern) {
163 $this->Lexer->addSpecialPattern($pattern, $mode, $this->name);
166 foreach ($this->entryPattern as $pattern) {
167 $this->Lexer->addEntryPattern($pattern, $mode, $this->name);
170 if ($this->handler != '') {
171 $this->Lexer->mapHandler($this->name, $this->handler);
179 foreach ($this->exitPattern as $pattern) {
180 $this->Lexer->addExitPattern($pattern, $this->name);
194 $this->specialPattern[] = '[^@]+(?=@)';
203 $this->Lexer->mapHandler('base', $this->name);
216 $this->handler = $this->name;
217 $this->name .= '_' . $type;
221 $this->entryPattern[] = '^@\w+\s*' . $open . '(?=.*' . $close . ')';
222 $this->exitPattern[] = '\s*(?:' . $close . '|(?=@))';
224 $this->allowedModes = array('field');
237 $this->entryPattern[] = '^\s*\w[\w-]+\s*=\s*';
238 $this->exitPattern[] = '\s*(?:,|(?=[\)}@]))';
240 $this->allowedModes = array('integer_value', 'string_value_quoted', 'string_value_braced', 'concatenation');
253 $this->specialPattern[] = '^\d+';
266 $this->handler = $this->name;
267 $this->name .= '_' . $type;
271 $this->entryPattern[] = '^' . $open . '(?=.*' . $close . ')';
272 $this->exitPattern[] = $exit;
274 $this->allowedModes = array('nested_braces_' . $type);
287 $this->handler = $this->name;
288 $this->name .= '_' . $type;
290 $this->entryPattern[] = '{(?=.*})';
291 $this->exitPattern[] = ($type == 'quoted') ? '}' : '(?:}|(?=@))';
293 $this->allowedModes = array($this->name);
306 $this->specialPattern[] = '\s*#\s*';
321 $this->reset();
328 $this->entries = new refnotes_bibtex_entry_stash();
329 $this->entry = NULL;
330 $this->field = NULL;
337 $entries = $this->entries->getEntries();
368 $this->entry = new refnotes_bibtex_entry(preg_replace('/@(\w+)\W+/', '$1', $match));
372 $this->entry->handleUnmatched($match);
376 $this->entries->add($this->entry);
377 $this->entry = NULL;
390 $this->field = new refnotes_bibtex_field(preg_replace('/\W*(\w[\w-]+)\W*/', '$1', $match));
394 $this->field->addToken('unmatched', $match);
398 $this->entry->addField($this->field);
399 $this->field = NULL;
410 $this->field->addToken('integer', $match);
420 $this->field->addToken('string', $match);
431 $this->field->addToken('braces', $match);
457 $this->entry = array();
458 $this->strings = new refnotes_bibtex_strings();
459 $this->namespace = ':';
466 return $this->entry;
481 if ($this->isValidRefnotesName($name)) {
483 $name = $this->namespace . $name;
486 $this->entry[] = array_merge(array('note-name' => $name), $entry->getData($this->strings));
490 $data = $entry->getData($this->strings);
493 if ($this->isValidStringName($name)) {
494 $this->strings->add($name, $data[$name]);
498 $data = $entry->getData($this->strings);
500 if (isset($data['namespace']) && $this->isValidRefnotesName($data['namespace'])) {
501 $this->namespace = refnotes_namespace::canonizeName($data['namespace']);
532 $this->type = strtolower($type);
533 $this->name = '';
534 $this->field = array();
541 return $this->type;
548 return $this->name;
557 foreach ($this->field as $field) {
568 if (($this->name == '') && (preg_match('/\s*([^\s,]+)\s*,/', $token, $match) == 1)) {
569 $this->name = $match[1];
577 $this->field[] = $field;
591 $this->name = strtolower($name);
592 $this->token = array();
599 return $this->name;
608 foreach ($this->token as $token) {
625 $this->token[] = new refnotes_bibtex_field_token($type, $text);
639 $this->type = $type;
640 $this->text = $text;
653 $this->string = array();
660 $this->string[$name] = $value;
667 return array_key_exists($name, $this->string) ? $this->string[$name] : '';