1: <?php
2: // Parco
3: // Copyright (c) 2015 Niels Sonnich Poulsen (http://nielssp.dk)
4: // Licensed under the MIT license.
5: // See the LICENSE file or http://opensource.org/licenses/MIT for more information.
6: namespace Parco;
7:
8: /**
9: * A parse result.
10: */
11: abstract class Result implements Positional
12: {
13: use Position;
14:
15: /**
16: * Whether parse was successful.
17: *
18: * @var bool
19: */
20: public $successful;
21:
22: /**
23: * Result if successful.
24: *
25: * @var mixed
26: */
27: public $result = null;
28:
29: /**
30: * Failure message if unsuccessful.
31: *
32: * @var string|null
33: */
34: public $message = null;
35:
36: /**
37: * Remaining input.
38: *
39: * @var array
40: */
41: public $nextInput;
42:
43: /**
44: * Next position.
45: *
46: * @var array
47: */
48: public $nextPos;
49:
50: /**
51: * Get stored parse result.
52: *
53: * @throws ParseException If unsuccessful.
54: * @return mixed Stored parse result.
55: */
56: abstract public function get();
57: }
58: