Пример #1
0
<?php

include_once dirname(__FILE__) . '/t/t.php';
$lime = new lime_test();
$lime->is(false, PEG::eos()->parse(PEG::context('')));
$context = PEG::context('hoge');
$context->read(4);
$lime->is(false, PEG::eos()->parse($context));
Пример #2
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());
 }