Removed dep on API
[ninja.git] / src / op5 / ninja_sdk / parsegen / LalrError.php
blob73b7bab8c25cba1508131cfe93dac70f9038dad4
1 <?php
3 class LalrError {
4 private $name;
5 private $generate;
6 private $follow;
8 public function __construct( $name, $generate, $follow ) {
9 $this->name = $name;
10 $this->generate = $generate;
11 $this->follow = $follow;
14 public function get_name() {
15 return $this->name;
18 public function generates() {
19 return $this->generate;
22 public function produces( $symbol ) {
23 return $this->generate == $symbol;
26 public function follow() {
27 return $this->follow;
29 public function follows( $symbol ) {
30 return in_array($symbol,$this->follow);
33 public function equals( $item ) {
34 return ($item->name == $this->name);
37 public function __toString() {
38 $outp = sprintf( "%s: %s := error(%s)", $this->name, $this->generate, $this->follow );
39 return $outp;