예제 #1
0
 public function __construct(PEG_IParser $elt)
 {
     $dt = PEG::many(PEG::subtract($elt, ':'));
     $dd = PEG::many($elt);
     $this->parser = PEG::many1(PEG::callbackAction(array($this, 'map'), PEG::anything()));
     $this->definitionList = PEG::seq(PEG::drop('-'), $dt, PEG::drop(':'), $dd);
 }
예제 #2
0
파일: Locator.php 프로젝트: nequal/Openpear
 protected function createEmptyParagraph()
 {
     $parser = PEG::count(PEG::many1(PEG::token('')));
     return $this->nodeCreater('emptyparagraph', $parser);
 }
예제 #3
0
 protected function createEmptyParagraph()
 {
     $parser = PEG::count(PEG::many1(PEG::token('')));
     return $this->nodeCreater(OrgModeSyntax_Node::TYPE_EMPTY_PARAGRAPH, $parser);
 }
예제 #4
0
파일: Many1.php 프로젝트: ngyuki/PHPPEG
<?php

include_once dirname(__FILE__) . '/t/t.php';
$lime = new lime_test();
$many1 = PEG::many1(PEG::token('hoge'));
$lime->is($many1->parse(PEG::context('hoge')), array('hoge'));
$lime->is($many1->parse(PEG::context('')), PEG::failure());
$lime->is(array('hoge', 'hoge'), $many1->parse(PEG::context('hogehoge')));
예제 #5
0
 function __construct(PEG_IParser $lineelt)
 {
     $cellbody = PEG::many(PEG::subtract($lineelt, '|'));
     $this->parser = PEG::many1(PEG::callbackAction(array($this, 'map'), PEG::anything()));
     $this->line = PEG::second('|', PEG::many1(PEG::optional('*'), $cellbody, PEG::drop('|')), PEG::eos());
 }
예제 #6
0
 public function __construct(PEG_IParser $lineelt)
 {
     $item = PEG::callbackAction(array($this, 'mapLine'), PEG::anything());
     $this->parser = PEG::callbackAction(array('OrgModeSyntax_Tree', 'make'), PEG::many1($item));
     $this->li = PEG::callbackAction(array('OrgModeSyntax_Util', 'processListItem'), PEG::seq(PEG::many(PEG::char('+')), PEG::many($lineelt)));
 }