final class ActionCode
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

The integer encoding of one parse-table action.

A shift or goto is the target state, zero or more. A reduce is the rule negated and shifted by one, so reducing by rule zero, the accept, is minus one. The smallest 32-bit integer marks a token the state rejects outright.

Constants§

public const ERROR = -2147483648

The code of an explicit error, as a non-associative operator leaves behind.

public const ACCEPT = -1

The code that accepts the input: a reduction by the augmented start rule.

Methods§

public static function reduce(int $rule): int

Encodes a reduction.

Parameters

$ruleintRule to reduce by

Returns

int The action code
Test cases 12
Called from 6
public static function isReduce(int $code): bool

Reports whether a code is a reduction, the accept included.

Parameters

$codeintAction code

Returns

bool True for a reduction
Test cases 1
Called from 2
Calls 1
public static function rule(int $code): int

Test cases 23§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 5
Other tests reaching this symbol 18

Relations§

Static calls 17
Constant reads 8