source: applications/nimpad/branches/0.2/lib/PEG/Action.php @ 1488

SVN
Revision 1488, 618 bytes checked in by anatoo, 10 months ago (diff)

HatenaSyntax?とPEGをリポジトリの中に置いておくようにした

Line 
1<?php
2/**
3 * @package PEG
4 * @author anatoo<anatoo@nequal.jp>
5 * @license http://www.opensource.org/licenses/mit-license.php MIT License
6 * @version $Id: Action.php 655 2009-04-12 07:26:42Z anatoo $
7 */
8
9abstract class PEG_Action implements PEG_IParser
10{
11    protected $parser;
12    function __construct(PEG_IParser $p)
13    {
14        $this->parser = $p;
15    }
16    function parse(PEG_IContext $context)
17    {
18        $result = $this->parser->parse($context);
19        return $result instanceof PEG_Failure ? $result : $this->process($result);
20    }
21    abstract protected function process($result);
22}
Note: See TracBrowser for help on using the repository browser.