for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* For licensing information, please see the LICENSE file accompanied with this file.
*
* @author Gerard van Helden <[email protected]>
* @copyright 2012 Gerard van Helden <http://melp.nl>
*/
namespace Zicht\Tool\Script;
* Base class for parsing.
abstract class AbstractParser implements ParserInterface
{
* Constructs the parser with an optional parent parser
* @param ParserInterface $parent
public function __construct(ParserInterface $parent = null)
$this->parent = $parent;
parent
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
* Triggers a parse error
* @param TokenStream $stream
* @return void
final public function err(TokenStream $stream)
throw new \UnexpectedValueException(
"Unexpected input near {$stream->current()->value} at offset {$stream->key()}"
);
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: