<?php

/**
 * Generated by Peggy 5.0.6 with PHPeggy plugin 3.0.0
 *
 * https://peggyjs.org/
 * https://github.com/marcelbolten/phpeggy
 */

declare(strict_types=1);

namespace MediaWiki\Extension\Math\WikiTexVC;

use MediaWiki\Extension\Math\WikiTexVC\Nodes\Box;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Big;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\ChemFun2u;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\ChemWord;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Declh;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Dollar;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\DQ;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\FQ;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun1;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun1nb;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun2;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun2nb;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun2sq;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun4;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Infix;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Literal;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Lr;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\LengthSpec;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Matrix;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Mhchem;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\UQ;
use MediaWiki\Extension\Math\WikiTexVC\Nodes\TexArray;

/* BEGIN Utility functions */
/* chr_unicode - get unicode character from its char code */
if (!\function_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\chr_unicode")) {
    /** @param float|int $code */
    function chr_unicode(
        $code
    ): string {
        return \html_entity_decode("&#" . (int) $code . ";", ENT_QUOTES, "UTF-8");
    }
}

/* ord_unicode - get unicode char code from string */
if (!\function_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\ord_unicode")) {
    function ord_unicode(
        string $character
    ): int {
        if (\strlen($character) === 1) {
            return \ord($character);
        }
        $json = \json_encode($character, \JSON_THROW_ON_ERROR);
        $utf16_1 = (int) \hexdec(\substr($json, 3, 4));
        if (substr($json, 7, 2) === "\u") {
            $utf16_2 = (int) \hexdec(\substr($json, 9, 4));
            return 0x10000 + (($utf16_1 & 0x3ff) << 10) + ($utf16_2 & 0x3ff);
        }

        return $utf16_1;
    }
}
/* END Utility functions */

/* Syntax error exception */
if (!\class_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\SyntaxError", false)) {
    class SyntaxError extends \Exception
    {
        public string $name = "SyntaxError";

        /**
         * @param pegExpectation[]|null $expected
         */
        public function __construct(
            ?string $message,
            public ?array $expected,
            public string $found,
            public int $grammarOffset,
            public int $grammarLine,
            public int $grammarColumn,
            public pegLocation $location
        ) {
            parent::__construct($message ?? "", 0);
        }

        /**
         * @param array<int, array<string, string>> $sources
         */
        public function format(
            array $sources
        ): string {
            $str = $this->name . ": " . $this->message;
            if (!empty($this->location->source)) {
                $src = null;
                for ($k = 0; $k < \count($sources); $k++) {
                    if ($sources[$k]["source"] === $this->location->source) {
                        $src = \preg_split("/\r\n|\n|\r/", $sources[$k]["text"]);
                        break;
                    }
                }
                $start = $this->location->start;
                $loc = $this->location->source . ":" . $start->line . ":" . $start->column;
                if ($src) {
                    $end = $this->location->end;
                    $filler = $this->peg_padEnd("", $start->line !== 0 ? (int) \floor(\log10($start->line) + 1.0) : 1);
                    $line = $src[$start->line - 1];
                    $last = $start->line === $end->line ? $end->column : \strlen($line) + 1;
                    $hatLen = ($last - $start->column) ?: 1;
                    $str .= "\n --> " . $loc . "\n"
                        . $filler . " |\n"
                        . $start->line . " | " . $line . "\n"
                        . $filler . " | " . $this->peg_padEnd("", $start->column - 1)
                        . $this->peg_padEnd("", $hatLen, "^");
                } else {
                    $str .= "\n at " . $loc;
                }
            }
            return $str;
        }

        private function peg_padEnd(
            string $str,
            int $targetLength,
            string $padString = " "
        ): string {
            if (\strlen($str) > $targetLength) {
                return $str;
            }
            $targetLength -= \strlen($str);
            $padString .= \str_repeat($padString, $targetLength);
            return $str . \substr($padString, 0, $targetLength);
        }
    }
}

if (!\class_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\pegExpectation", false)) {
    class pegExpectation
    {
        public function __construct(
            public ?string $type = null,
            public ?string $description = null,
            public ?string $value = null,
            public ?string $ignoreCase = null,
            public ?string $unicode = null
        ) {
        }
    }
}

if (!\class_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\pegCacheItem", false)) {
    class pegCacheItem
    {
        public function __construct(
            public int $nextPos,
            public mixed $result
        ) {
        }
    }
}

if (!\class_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\pegCachedPosDetails", false)) {
    class pegCachedPosDetails
    {
        public function __construct(
            public int $line = 1,
            public int $column = 1,
            public bool $seenCR = false
        ) {
        }
    }
}

if (!\class_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\pegLocation", false)) {
    class pegLocation
    {
        public function __construct(
            public string $source,
            public pegPosition $start,
            public pegPosition $end
        ) {
        }
    }
}

if (!\class_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\pegPosition", false)) {
    class pegPosition
    {
        public function __construct(
            public int $offset,
            public int $line,
            public int $column
        ) {
        }
    }
}

if (!\class_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\pegRange", false)) {
    class pegRange
    {
        public function __construct(
            public string $source,
            public int $start,
            public int $end
        ) {
        }
    }
}

class Parser
{
    /** @var pegCacheItem[] */
    public array $peg_cache = [];

    private int $peg_currPos = 0;
    private int $peg_reportedPos = 0;
    private int $peg_cachedPos = 0;
    private pegCachedPosDetails $peg_cachedPosDetails;
    private int $peg_maxFailPos = 0;
    /** @var pegExpectation[] $peg_maxFailExpected */
    private array $peg_maxFailExpected = [];
    private int $peg_silentFails = 0;
    /** @var string[] $input */
    private array $input = [];
    /** @var array<string, mixed> $options */
    private array $options = [];
    private int $input_length = 0;
    private \stdClass $peg_FAILED;
    private string $peg_source = "";

    private string $peg_l0 = "\\{";
    private string $peg_l1 = "\\begin{";
    private string $peg_l2 = "}";
    private string $peg_l3 = "p";
    private string $peg_l4 = "*";
    private string $peg_l5 = "||";
    private string $peg_l6 = "|";
    private string $peg_l7 = "@";
    private string $peg_l8 = "[";
    private string $peg_l9 = "]";
    private string $peg_l10 = " ";
    private string $peg_l11 = "(^)";
    private string $peg_l12 = "^";
    private string $peg_l13 = "_";
    private string $peg_l14 = "{";
    private string $peg_l15 = ":=";
    private string $peg_l16 = "\\";
    private string $peg_l17 = "&";
    private string $peg_l18 = ".";
    private string $peg_l19 = "pt";
    private string $peg_l20 = "pc";
    private string $peg_l21 = "in";
    private string $peg_l22 = "bp";
    private string $peg_l23 = "cm";
    private string $peg_l24 = "mm";
    private string $peg_l25 = "dd";
    private string $peg_l26 = "cc";
    private string $peg_l27 = "sp";
    private string $peg_l28 = "em";
    private string $peg_l29 = "ex";
    private string $peg_l30 = "mu";
    private string $peg_l31 = "nd";
    private string $peg_l32 = "nc";
    private string $peg_l33 = "\\\\";
    private string $peg_l34 = "\\begin";
    private string $peg_l35 = "\\end";
    private string $peg_l36 = "{matrix}";
    private string $peg_l37 = "{pmatrix}";
    private string $peg_l38 = "{bmatrix}";
    private string $peg_l39 = "{Bmatrix}";
    private string $peg_l40 = "{vmatrix}";
    private string $peg_l41 = "{Vmatrix}";
    private string $peg_l42 = "{array}";
    private string $peg_l43 = "{align}";
    private string $peg_l44 = "{aligned}";
    private string $peg_l45 = "{alignat}";
    private string $peg_l46 = "{alignedat}";
    private string $peg_l47 = "{smallmatrix}";
    private string $peg_l48 = "{cases}";
    private string $peg_l49 = "named";
    private string $peg_l50 = "gray";
    private string $peg_l51 = "rgb";
    private string $peg_l52 = "RGB";
    private string $peg_l53 = "cmyk";
    private string $peg_l54 = ",";
    private string $peg_l55 = "0";
    private string $peg_l56 = "~--";
    private string $peg_l57 = "~-";
    private string $peg_l58 = "~=";
    private string $peg_l59 = "~";
    private string $peg_l60 = "-~-";
    private string $peg_l61 = "....";
    private string $peg_l62 = "...";
    private string $peg_l63 = "<-";
    private string $peg_l64 = "->";
    private string $peg_l65 = "{math}";
    private string $peg_l66 = "\\}";
    private string $peg_c0 = "/^[ \\t\\n\\r]/";
    private string $peg_c1 = "/^[\\(\\[]/";
    private string $peg_c2 = "/^[lrc]/";
    private string $peg_c3 = "/^[0-9]/";
    private string $peg_c4 = "/^[tcb]/";
    private string $peg_c5 = "/^[a-zA-Z]/";
    private string $peg_c6 = "/^[-0-9a-zA-Z+*,=\\(\\):\\/;?.!'` \\[\\]\\[\\x{0080}-\\x{D7FF}\\]\\[\\x{E000}-\\x{FFFF}\\]]/u";
    private string $peg_c7 = "/^[!'*--0-;=?A-Za-z]/";
    private string $peg_c8 = "/^[, ;!_#%\\\$&]/";
    private string $peg_c9 = "/^[><~]/";
    private string $peg_c10 = "/^[%\\\$]/";
    private string $peg_c11 = "/^[\\(-\\).-\\/\\[|]/";
    private string $peg_c12 = "/^[{}|]/";
    private string $peg_c13 = "/^[+-]/";
    private string $peg_c14 = "/^[1-9]/";
    private string $peg_c15 = "/^[01]/";
    private string $peg_c16 = "/^['*-.0-9A-Za-z]/";
    private string $peg_c17 = "/^[\\^-_]/";
    private string $peg_c18 = "/^[#=]/";
    private string $peg_c19 = "/^[-1-3]/";
    private string $peg_c20 = "/^[+-=#\\(\\).,;\\/*<>|@&'\\[\\]]/";
    private pegExpectation $peg_e0;
    private pegExpectation $peg_e1;
    private pegExpectation $peg_e2;
    private pegExpectation $peg_e3;
    private pegExpectation $peg_e4;
    private pegExpectation $peg_e5;
    private pegExpectation $peg_e6;
    private pegExpectation $peg_e7;
    private pegExpectation $peg_e8;
    private pegExpectation $peg_e9;
    private pegExpectation $peg_e10;
    private pegExpectation $peg_e11;
    private pegExpectation $peg_e12;
    private pegExpectation $peg_e13;
    private pegExpectation $peg_e14;
    private pegExpectation $peg_e15;
    private pegExpectation $peg_e16;
    private pegExpectation $peg_e17;
    private pegExpectation $peg_e18;
    private pegExpectation $peg_e19;
    private pegExpectation $peg_e20;
    private pegExpectation $peg_e21;
    private pegExpectation $peg_e22;
    private pegExpectation $peg_e23;
    private pegExpectation $peg_e24;
    private pegExpectation $peg_e25;
    private pegExpectation $peg_e26;
    private pegExpectation $peg_e27;
    private pegExpectation $peg_e28;
    private pegExpectation $peg_e29;
    private pegExpectation $peg_e30;
    private pegExpectation $peg_e31;
    private pegExpectation $peg_e32;
    private pegExpectation $peg_e33;
    private pegExpectation $peg_e34;
    private pegExpectation $peg_e35;
    private pegExpectation $peg_e36;
    private pegExpectation $peg_e37;
    private pegExpectation $peg_e38;
    private pegExpectation $peg_e39;
    private pegExpectation $peg_e40;
    private pegExpectation $peg_e41;
    private pegExpectation $peg_e42;
    private pegExpectation $peg_e43;
    private pegExpectation $peg_e44;
    private pegExpectation $peg_e45;
    private pegExpectation $peg_e46;
    private pegExpectation $peg_e47;
    private pegExpectation $peg_e48;
    private pegExpectation $peg_e49;
    private pegExpectation $peg_e50;
    private pegExpectation $peg_e51;
    private pegExpectation $peg_e52;
    private pegExpectation $peg_e53;
    private pegExpectation $peg_e54;
    private pegExpectation $peg_e55;
    private pegExpectation $peg_e56;
    private pegExpectation $peg_e57;
    private pegExpectation $peg_e58;
    private pegExpectation $peg_e59;
    private pegExpectation $peg_e60;
    private pegExpectation $peg_e61;
    private pegExpectation $peg_e62;
    private pegExpectation $peg_e63;
    private pegExpectation $peg_e64;
    private pegExpectation $peg_e65;
    private pegExpectation $peg_e66;
    private pegExpectation $peg_e67;
    private pegExpectation $peg_e68;
    private pegExpectation $peg_e69;
    private pegExpectation $peg_e70;
    private pegExpectation $peg_e71;
    private pegExpectation $peg_e72;
    private pegExpectation $peg_e73;
    private pegExpectation $peg_e74;
    private pegExpectation $peg_e75;
    private pegExpectation $peg_e76;
    private pegExpectation $peg_e77;
    private pegExpectation $peg_e78;
    private pegExpectation $peg_e79;
    private pegExpectation $peg_e80;
    private pegExpectation $peg_e81;
    private pegExpectation $peg_e82;
    private pegExpectation $peg_e83;
    private pegExpectation $peg_e84;
    private pegExpectation $peg_e85;
    private pegExpectation $peg_e86;
    private pegExpectation $peg_e87;

    public function __construct()
    {
        $this->peg_FAILED = new \stdClass();
        $this->peg_cachedPosDetails = new pegCachedPosDetails();
        $this->peg_e0 = new pegExpectation("class", "[ \\t\\n\\r]", "[ \t\n\r]", "false", "false");
        $this->peg_e1 = new pegExpectation("class", "[([]", "[([]", "false", "false");
        $this->peg_e2 = new pegExpectation("literal", "\"\\\\{\"", "\\{", "false");
        $this->peg_e3 = new pegExpectation("literal", "\"\\\\begin{\"", "\\begin{", "false");
        $this->peg_e4 = new pegExpectation("literal", "\"}\"", "}", "false");
        $this->peg_e5 = new pegExpectation("class", "[lrc]", "[lrc]", "false", "false");
        $this->peg_e6 = new pegExpectation("literal", "\"p\"", "p", "false");
        $this->peg_e7 = new pegExpectation("literal", "\"*\"", "*", "false");
        $this->peg_e8 = new pegExpectation("class", "[0-9]", "[0-9]", "false", "false");
        $this->peg_e9 = new pegExpectation("literal", "\"||\"", "||", "false");
        $this->peg_e10 = new pegExpectation("literal", "\"|\"", "|", "false");
        $this->peg_e11 = new pegExpectation("literal", "\"@\"", "@", "false");
        $this->peg_e12 = new pegExpectation("literal", "\"[\"", "[", "false");
        $this->peg_e13 = new pegExpectation("class", "[tcb]", "[tcb]", "false", "false");
        $this->peg_e14 = new pegExpectation("literal", "\"]\"", "]", "false");
        $this->peg_e15 = new pegExpectation("literal", "\" \"", " ", "false");
        $this->peg_e16 = new pegExpectation("literal", "\"(^)\"", "(^)", "false");
        $this->peg_e17 = new pegExpectation("literal", "\"^\"", "^", "false");
        $this->peg_e18 = new pegExpectation("literal", "\"_\"", "_", "false");
        $this->peg_e19 = new pegExpectation("literal", "\"{\"", "{", "false");
        $this->peg_e20 = new pegExpectation("class", "[a-zA-Z]", "[a-zA-Z]", "false", "false");
        $this->peg_e21 = new pegExpectation("class", "[-0-9a-zA-Z+*,=():/;?.!'` [][\\x{0080}-\\u{D7FF}][\\u{E000}-\\u{FFFF}]]", "[-0-9a-zA-Z+*,=():/;?.!'` [][\x{0080}-\u{D7FF}][\u{E000}-\u{FFFF}]]", "false", "true");
        $this->peg_e22 = new pegExpectation("literal", "\":=\"", ":=", "false");
        $this->peg_e23 = new pegExpectation("class", "[!'*--0-;=?A-Za-z]", "[!'*--0-;=?A-Za-z]", "false", "false");
        $this->peg_e24 = new pegExpectation("literal", "\"\\\\\"", "\\", "false");
        $this->peg_e25 = new pegExpectation("class", "[, ;!_#%\\\$&]", "[, ;!_#%\$&]", "false", "false");
        $this->peg_e26 = new pegExpectation("class", "[><~]", "[><~]", "false", "false");
        $this->peg_e27 = new pegExpectation("class", "[%\\\$]", "[%\$]", "false", "false");
        $this->peg_e28 = new pegExpectation("class", "[(-).-/[|]", "[(-).-/[|]", "false", "false");
        $this->peg_e29 = new pegExpectation("class", "[{}|]", "[{}|]", "false", "false");
        $this->peg_e30 = new pegExpectation("literal", "\"&\"", "&", "false");
        $this->peg_e31 = new pegExpectation("class", "[+-]", "[+-]", "false", "false");
        $this->peg_e32 = new pegExpectation("literal", "\".\"", ".", "false");
        $this->peg_e33 = new pegExpectation("literal", "\"pt\"", "pt", "false");
        $this->peg_e34 = new pegExpectation("literal", "\"pc\"", "pc", "false");
        $this->peg_e35 = new pegExpectation("literal", "\"in\"", "in", "false");
        $this->peg_e36 = new pegExpectation("literal", "\"bp\"", "bp", "false");
        $this->peg_e37 = new pegExpectation("literal", "\"cm\"", "cm", "false");
        $this->peg_e38 = new pegExpectation("literal", "\"mm\"", "mm", "false");
        $this->peg_e39 = new pegExpectation("literal", "\"dd\"", "dd", "false");
        $this->peg_e40 = new pegExpectation("literal", "\"cc\"", "cc", "false");
        $this->peg_e41 = new pegExpectation("literal", "\"sp\"", "sp", "false");
        $this->peg_e42 = new pegExpectation("literal", "\"em\"", "em", "false");
        $this->peg_e43 = new pegExpectation("literal", "\"ex\"", "ex", "false");
        $this->peg_e44 = new pegExpectation("literal", "\"mu\"", "mu", "false");
        $this->peg_e45 = new pegExpectation("literal", "\"nd\"", "nd", "false");
        $this->peg_e46 = new pegExpectation("literal", "\"nc\"", "nc", "false");
        $this->peg_e47 = new pegExpectation("literal", "\"\\\\\\\\\"", "\\\\", "false");
        $this->peg_e48 = new pegExpectation("literal", "\"\\\\begin\"", "\\begin", "false");
        $this->peg_e49 = new pegExpectation("literal", "\"\\\\end\"", "\\end", "false");
        $this->peg_e50 = new pegExpectation("literal", "\"{matrix}\"", "{matrix}", "false");
        $this->peg_e51 = new pegExpectation("literal", "\"{pmatrix}\"", "{pmatrix}", "false");
        $this->peg_e52 = new pegExpectation("literal", "\"{bmatrix}\"", "{bmatrix}", "false");
        $this->peg_e53 = new pegExpectation("literal", "\"{Bmatrix}\"", "{Bmatrix}", "false");
        $this->peg_e54 = new pegExpectation("literal", "\"{vmatrix}\"", "{vmatrix}", "false");
        $this->peg_e55 = new pegExpectation("literal", "\"{Vmatrix}\"", "{Vmatrix}", "false");
        $this->peg_e56 = new pegExpectation("literal", "\"{array}\"", "{array}", "false");
        $this->peg_e57 = new pegExpectation("literal", "\"{align}\"", "{align}", "false");
        $this->peg_e58 = new pegExpectation("literal", "\"{aligned}\"", "{aligned}", "false");
        $this->peg_e59 = new pegExpectation("literal", "\"{alignat}\"", "{alignat}", "false");
        $this->peg_e60 = new pegExpectation("literal", "\"{alignedat}\"", "{alignedat}", "false");
        $this->peg_e61 = new pegExpectation("literal", "\"{smallmatrix}\"", "{smallmatrix}", "false");
        $this->peg_e62 = new pegExpectation("literal", "\"{cases}\"", "{cases}", "false");
        $this->peg_e63 = new pegExpectation("literal", "\"named\"", "named", "true");
        $this->peg_e64 = new pegExpectation("literal", "\"gray\"", "gray", "true");
        $this->peg_e65 = new pegExpectation("literal", "\"rgb\"", "rgb", "false");
        $this->peg_e66 = new pegExpectation("literal", "\"RGB\"", "RGB", "false");
        $this->peg_e67 = new pegExpectation("literal", "\"cmyk\"", "cmyk", "true");
        $this->peg_e68 = new pegExpectation("literal", "\",\"", ",", "false");
        $this->peg_e69 = new pegExpectation("literal", "\"0\"", "0", "false");
        $this->peg_e70 = new pegExpectation("class", "[1-9]", "[1-9]", "false", "false");
        $this->peg_e71 = new pegExpectation("class", "[01]", "[01]", "false", "false");
        $this->peg_e72 = new pegExpectation("class", "['*-.0-9A-Za-z]", "['*-.0-9A-Za-z]", "false", "false");
        $this->peg_e73 = new pegExpectation("class", "[^-_]", "[^-_]", "false", "false");
        $this->peg_e74 = new pegExpectation("class", "[#=]", "[#=]", "false", "false");
        $this->peg_e75 = new pegExpectation("literal", "\"~--\"", "~--", "false");
        $this->peg_e76 = new pegExpectation("literal", "\"~-\"", "~-", "false");
        $this->peg_e77 = new pegExpectation("literal", "\"~=\"", "~=", "false");
        $this->peg_e78 = new pegExpectation("literal", "\"~\"", "~", "false");
        $this->peg_e79 = new pegExpectation("literal", "\"-~-\"", "-~-", "false");
        $this->peg_e80 = new pegExpectation("literal", "\"....\"", "....", "false");
        $this->peg_e81 = new pegExpectation("literal", "\"...\"", "...", "false");
        $this->peg_e82 = new pegExpectation("literal", "\"<-\"", "<-", "false");
        $this->peg_e83 = new pegExpectation("literal", "\"->\"", "->", "false");
        $this->peg_e84 = new pegExpectation("class", "[-1-3]", "[-1-3]", "false", "false");
        $this->peg_e85 = new pegExpectation("literal", "\"{math}\"", "{math}", "false");
        $this->peg_e86 = new pegExpectation("literal", "\"\\\\}\"", "\\}", "false");
        $this->peg_e87 = new pegExpectation("class", "[+-=#().,;/*<>|@&'[]]", "[+-=#().,;/*<>|@&'[]]", "false", "false");
    }

    private TexUtil $tu;
    private function initialize(): void
    {
      $this->tu = TexUtil::getInstance();
      # get reference of the options for usage in functions.
      $this->options = ParserUtil::createOptions($this->options);
    }

    /**
     * @param string|string[] $input
     * @param mixed[] $args
     * @throws \Exception
     * @throws SyntaxError
     */
    public function parse(
        $input,
        array ...$args
    ): mixed {
        $this->peg_cleanup_state();
        $this->options = $args[0] ?? [];
        if (\is_array($input)) {
            $this->input = $input;
        } else {
            \preg_match_all("/./us", $input, $match);
            $this->input = $match[0];
        }
        $this->input_length = \count($this->input);
        $this->peg_source = $this->options["grammarSource"] ?? "";

        $old_regex_encoding = (string) \mb_regex_encoding();
        \mb_regex_encoding("UTF-8");

        if (method_exists($this, 'initialize')) {
            $this->initialize();
        }

        $peg_startRuleFunctions = ["start" => [$this, "peg_parse_start"]];
        $peg_startRuleFunction = [$this, "peg_parse_start"];
        if (isset($this->options["startRule"])) {
            if (!isset($peg_startRuleFunctions[$this->options["startRule"]])) {
                throw new \Exception("Can't start parsing from rule \"" . $this->options["startRule"] . "\".");
            }

            $peg_startRuleFunction = $peg_startRuleFunctions[$this->options["startRule"]];
        }

        /* @var mixed $peg_result */
        $peg_result = \call_user_func($peg_startRuleFunction);

        $this->peg_cache = [];

        \mb_regex_encoding($old_regex_encoding);

        if ($peg_result !== $this->peg_FAILED && $this->peg_currPos === $this->input_length) {
            $this->peg_cleanup_state();
            return $peg_result;
        }

        if ($peg_result !== $this->peg_FAILED && $this->peg_currPos < $this->input_length) {
            $this->peg_fail(new pegExpectation("end", "end of input"));
        }

        $exception = $this->peg_buildException(null, $this->peg_maxFailExpected, $this->peg_maxFailPos);
        $this->peg_cleanup_state();
        throw $exception;
    }

    private function peg_cleanup_state(): void
    {
        $this->peg_cache = [];
        $this->peg_currPos = 0;
        $this->peg_reportedPos = 0;
        $this->peg_cachedPos = 0;
        $this->peg_cachedPosDetails = new pegCachedPosDetails();
        $this->peg_maxFailPos = 0;
        $this->peg_maxFailExpected = [];
        $this->peg_silentFails = 0;
        $this->input = [];
        $this->input_length = 0;
        $this->options = [];
        $this->peg_source = "";
    }

    private function input_substr(
        int $start,
        int $length
    ): string {
        if ($length === 1 && $start < $this->input_length) {
            return $this->input[$start];
        }
        $substr = "";
        $max = \min($start + $length, $this->input_length);
        for ($i = $start; $i < $max; $i++) {
            $substr .= $this->input[$i];
        }
        return $substr;
    }

    private function text(): string
    {
        return $this->input_substr($this->peg_reportedPos, $this->peg_currPos - $this->peg_reportedPos);
    }

    private function offset(): int
    {
        return $this->peg_reportedPos;
    }

    private function range(): pegRange
    {
        return new pegRange($this->peg_source, $this->peg_reportedPos, $this->peg_currPos);
    }

    private function location(
        bool $fail = false
    ): pegLocation {
        $start = $this->peg_reportedPos;
        $end = $this->peg_currPos;
        if ($fail) {
            $start = $this->peg_maxFailPos;
            $end = $this->peg_maxFailPos + ($this->peg_maxFailPos < \count($this->input) ? 1 : 0);
        }
        $compute_pd_start = clone $this->peg_computePosDetails($start);
        $compute_pd_end = clone $this->peg_computePosDetails($end);

        return new pegLocation(
            $this->peg_source,
            new pegPosition($start, $compute_pd_start->line, $compute_pd_start->column),
            new pegPosition($end, $compute_pd_end->line, $compute_pd_end->column),
        );
    }

    private function line(): int
    {
        return $this->peg_computePosDetails($this->peg_reportedPos)->line;
    }

    private function column(): int
    {
        return $this->peg_computePosDetails($this->peg_reportedPos)->column;
    }

    /**
     * @throws SyntaxError
     */
    private function expected(
        string $description,
        ?int $where = null
    ): void {
        throw $this->peg_buildException(
            null,
            [new pegExpectation("other", $description)],
            $where ?? $this->peg_reportedPos
        );
    }

    /**
     * @throws SyntaxError
     */
    private function error(
        string $message,
        ?int $where = null
    ): void {
        throw $this->peg_buildException(
            $message,
            null,
            $where ?? $this->peg_reportedPos,
        );
    }

    private function peg_advancePos(
        pegCachedPosDetails $details,
        int $startPos,
        int $endPos
    ): void {
        for ($p = $startPos; $p < $endPos; $p++) {
            $ch = $this->input_substr($p, 1);
            if ($ch === "\n") {
                if (!$details->seenCR) {
                    $details->line++;
                }
                $details->column = 1;
                $details->seenCR = false;
            } elseif ($ch === "\r" || $ch === "\u2028" || $ch === "\u2029") {
                $details->line++;
                $details->column = 1;
                $details->seenCR = true;
            } else {
                $details->column++;
                $details->seenCR = false;
            }
        }
    }

    private function peg_computePosDetails(
        int $pos
    ): pegCachedPosDetails {
        if ($this->peg_cachedPos !== $pos) {
            if ($this->peg_cachedPos > $pos) {
                $this->peg_cachedPos = 0;
                $this->peg_cachedPosDetails = new pegCachedPosDetails();
            }
            $this->peg_advancePos($this->peg_cachedPosDetails, $this->peg_cachedPos, $pos);
            $this->peg_cachedPos = $pos;
        }

        return $this->peg_cachedPosDetails;
    }

    private function peg_fail(
        pegExpectation $expected
    ): void {
        if ($this->peg_currPos < $this->peg_maxFailPos) {
            return;
        }

        if ($this->peg_currPos > $this->peg_maxFailPos) {
            $this->peg_maxFailPos = $this->peg_currPos;
            $this->peg_maxFailExpected = [];
        }

        $this->peg_maxFailExpected[] = $expected;
    }

    private function peg_buildException_expectedComparator(
        pegExpectation $a,
        pegExpectation $b
    ): int {
        return $a->description <=> $b->description;
    }

    /** @param pegExpectation[]|null $expected */
    private function peg_buildException(
        ?string $message,
        ?array $expected,
        int $pos
    ): SyntaxError {
        $posDetails = $this->peg_computePosDetails($pos);
        $found = $pos < $this->input_length ? $this->input[$pos] : null;

        if ($expected !== null) {
            \usort($expected, [$this, "peg_buildException_expectedComparator"]);
            $i = 1;
            while ($i < \count($expected)) {
                if ($expected[$i - 1] === $expected[$i]) {
                    \array_splice($expected, $i, 1);
                } else {
                    $i++;
                }
            }
        }

        if ($message === null && $expected !== null) {
            $expectedDescs = \array_fill(0, \count($expected), null);

            for ($i = 0; $i < \count($expected); $i++) {
                $expectedDescs[$i] = $expected[$i]->description;
            }

            $expectedDesc = \count($expected) > 1
                ? \implode(", ", \array_slice($expectedDescs, 0, -1))
                    . " or "
                    . ($expectedDescs[\count($expected) - 1] ?? "")
                : $expectedDescs[0] ?? "";

            $foundDesc = $found === null ? "end of input" : \json_encode($found, JSON_THROW_ON_ERROR);

            $message = \sprintf("Expected %s but %s found.", $expectedDesc, $foundDesc);
        }

        return new SyntaxError(
            $message,
            $expected,
            $found ?? "",
            $pos,
            $posDetails->line,
            $posDetails->column,
            $this->location(true)
        );
    }

    private function peg_f0(
        mixed $t,
    ): mixed {
        assert($t instanceof TexArray);
            return $t;
    }

    private function peg_f1(
        mixed $e,
    ): mixed {
        return $e;
    }

    private function peg_f2(
        mixed $e1,
        mixed $name,
        mixed $e2,
    ): mixed {
        return new TexArray( new Infix($name, $e1, $e2));
    }

    private function peg_f3(
    ): mixed {
        return new TexArray();
    }

    private function peg_f4(
        mixed $h,
        mixed $t,
    ): mixed {
        return $t->unshift($h);
    }

    private function peg_f5(
        mixed $h,
        mixed $t,
    ): mixed {
        return $t->unshift($h);
    }

    private function peg_f6(
        mixed $d,
        mixed $e,
    ): mixed {
        return new TexArray(new Declh($d->getFname(), $e));
    }

    private function peg_f7(
        mixed $l1,
        mixed $l2,
    ): mixed {
        return new FQ($l1->getBase(), $l1->getDown(), $l2);
    }

    private function peg_f8(
        mixed $l1,
        mixed $l2,
    ): mixed {
        return new FQ($l1->getBase(), $l2, $l1->getUp());
    }

    private function peg_f9(
        mixed $base,
        mixed $upi,
    ): mixed {
        return new UQ($base, $upi);
    }

    private function peg_f10(
        mixed $base,
        mixed $downi,
    ): mixed {
        return new DQ($base, $downi);
    }

    private function peg_f11(
    ): mixed {
        return new Literal( "]");
    }

    private function peg_f12(
        mixed $l,
        mixed $e,
    ): mixed {
        return $e ->unshift( $l );
    }

    private function peg_f13(
    ): mixed {
        return new TexArray();
    }

    private function peg_f14(
        mixed $l1,
        mixed $l2,
    ): mixed {
        return new FQ($l1->getBase(), $l1->getDown(), $l2);
    }

    private function peg_f15(
        mixed $l1,
        mixed $l2,
    ): mixed {
        return new FQ ($l1->getBase(), $l2, $l1->getUp());
    }

    private function peg_f16(
        mixed $l1,
        mixed $l2,
    ): mixed {
        return new FQ(new TexArray(), $l1->getDown(), $l2);
    }

    private function peg_f17(
        mixed $base,
        mixed $upi,
    ): mixed {
        return new UQ($base, $upi);
    }

    private function peg_f18(
        mixed $base,
        mixed $downi,
    ): mixed {
        return new DQ($base, $downi);
    }

    private function peg_f19(
        mixed $l,
    ): mixed {
        return new UQ(new TexArray(),$l);
    }

    private function peg_f20(
        mixed $l,
    ): mixed {
        return new DQ(new TexArray(),$l);
    }

    private function peg_f21(
        mixed $d,
    ): mixed {
        return $d;
    }

    private function peg_f22(
    ): mixed {
        return  "]";
    }

    private function peg_f23(
        mixed $d,
    ): mixed {
        return $d;
    }

    private function peg_f24(
    ): mixed {
        return  "]";
    }

    private function peg_f25(
        mixed $r,
    ): mixed {
        return new Literal($r);
    }

    private function peg_f26(
        mixed $f,
    ): mixed {
        return $this->tu->latex_function_names($f);
    }

    private function peg_f27(
        mixed $f,
    ): mixed {
        return " ";
    }

    private function peg_f28(
        mixed $f,
        mixed $c,
    ): mixed {
        return new TexArray( new Literal( $f ) , new Literal( $c ) ) ;
    }

    private function peg_f29(
        mixed $f,
    ): mixed {
        return $this->tu->nullary_macro_aliase($f);
    }

    private function peg_f30(
        mixed $f,
    ): mixed {
        $parser = new Parser();
         $ast = $parser->parse($this->tu->nullary_macro_aliase($f), $this->options);
         assert($ast instanceof TexArray && $ast->getLength() === 1);
         return $ast->first();
    }

    private function peg_f31(
        mixed $f,
    ): mixed {
        return $this->tu->deprecated_nullary_macro_aliase($f);
    }

    private function peg_f32(
        mixed $f,
    ): mixed {
        $parser = new Parser();
         $ast = $parser->parse($this->tu->deprecated_nullary_macro_aliase($f), $this->options);
         assert($ast instanceof TexArray && $ast->getLength() === 1);
         if ($this->options['oldtexvc']){
           return $ast->first();
         } else {
              throw new SyntaxError("Deprecation: Alias no longer supported.", [], $this->text(), $this->offset(),
                $this->line(), $this->column(), $this->location());
         }
    }

    private function peg_f33(
        mixed $f,
    ): mixed {
        return $this->tu->mediawiki_function_names($f);
    }

    private function peg_f34(
        mixed $f,
    ): mixed {
        if(is_array($f)) {
                     // This is an unexpected case, but covers the ambiguity of slice in javascript.
                     $fProcessed = implode(array_slice($f, 1));
                 } else {
                     $fProcessed = substr($f,1);
                 }
                 return new Fun1nb( '\\operatorname', new Literal( $fProcessed ) );
    }

    private function peg_f35(
        mixed $r,
    ): mixed {
        return new Literal($r);
    }

    private function peg_f36(
        mixed $b,
        mixed $r,
    ): mixed {
        return new Big($b, $r);
    }

    private function peg_f37(
        mixed $b,
    ): mixed {
        return new Big($b,  "]");
    }

    private function peg_f38(
        mixed $l,
        mixed $e,
        mixed $r,
    ): mixed {
        return new Lr($l, $r, $e);
    }

    private function peg_f39(
        mixed $name,
        mixed $e,
        mixed $l,
    ): mixed {
        return new Fun2sq($name, $e->setCurly(), $l);
    }

    private function peg_f40(
        mixed $name,
        mixed $l,
    ): mixed {
        return new Fun1($name, $l);
    }

    private function peg_f41(
        mixed $name,
        mixed $l,
    ): mixed {
        return new Fun1nb($name, $l);
    }

    private function peg_f42(
        mixed $name,
        mixed $l,
    ): mixed {
        return new Mhchem($name, $l);
    }

    private function peg_f43(
        mixed $name,
        mixed $l1,
        mixed $l2,
    ): mixed {
        return new Fun2($name, $l1, $l2);
    }

    private function peg_f44(
        mixed $name,
        mixed $l1,
        mixed $l2,
        mixed $l3,
        mixed $l4,
    ): mixed {
        return new Fun4($name, $l1, $l2, $l3, $l4);
    }

    private function peg_f45(
        mixed $name,
        mixed $l1,
        mixed $l2,
    ): mixed {
        return new Fun2nb($name, $l1, $l2);
    }

    private function peg_f46(
        mixed $e,
    ): mixed {
        return $e->setCurly();
    }

    private function peg_f47(
        mixed $e1,
        mixed $name,
        mixed $e2,
    ): mixed {
        return new Infix($name, $e1, $e2);
    }

    private function peg_f48(
        mixed $m,
    ): mixed {
        return $m->setTop( 'matrix' );
    }

    private function peg_f49(
        mixed $m,
    ): mixed {
        return $m->setTop( 'pmatrix' );
    }

    private function peg_f50(
        mixed $m,
    ): mixed {
        return $m->setTop( 'bmatrix' );
    }

    private function peg_f51(
        mixed $m,
    ): mixed {
        return $m->setTop( 'Bmatrix' );
    }

    private function peg_f52(
        mixed $m,
    ): mixed {
        return $m->setTop( 'vmatrix' );
    }

    private function peg_f53(
        mixed $m,
    ): mixed {
        return $m->setTop( 'Vmatrix' );
    }

    private function peg_f54(
        mixed $m,
    ): mixed {
        return $m->setTop( 'array' );
    }

    private function peg_f55(
        mixed $m,
    ): mixed {
        return $m->setTop( 'aligned' );
    }

    private function peg_f56(
        mixed $m,
    ): mixed {
        return $m->setTop( 'aligned' );
    }

    private function peg_f57(
        mixed $m,
    ): mixed {
        return $m->setTop( 'alignedat' );
    }

    private function peg_f58(
        mixed $m,
    ): mixed {
        return $m->setTop( 'alignedat' );
    }

    private function peg_f59(
        mixed $m,
    ): mixed {
        return $m->setTop( 'smallmatrix' );
    }

    private function peg_f60(
        mixed $m,
    ): mixed {
        return $m->setTop( 'cases' );
    }

    private function peg_f61(
    ): mixed {
        throw new SyntaxError("Illegal TeX function", [], $this->text(), $this->offset(),
                                $this->line(), $this->column(), $this->location());
    }

    private function peg_f62(
        mixed $f,
    ): mixed {
        return !$this->tu->getAllFunctionsAt($f);
    }

    private function peg_f63(
        mixed $f,
    ): mixed {
        throw new SyntaxError("Illegal TeX function", [], $f, $this->offset(), $this->line(), $this->column(), $this->location());
    }

    private function peg_f64(
        mixed $cs,
        mixed $m,
    ): mixed {
        return $m->setColumnSpecs( $cs );
    }

    private function peg_f65(
        mixed $as,
        mixed $m,
    ): mixed {
        return $m->setColumnSpecs( $as );
    }

    private function peg_f66(
        mixed $l,
        mixed $r,
        mixed $m,
    ): mixed {
        return [$m,$r];
    }

    private function peg_f67(
        mixed $l,
        mixed $tail,
    ): mixed {
        if ($tail === null) { return new Matrix( 'matrix', new TexArray( $l ) ); }
         return new Matrix( 'matrix', $tail[0]->unshift($l), $tail[1] );
    }

    private function peg_f68(
        mixed $f,
        mixed $l,
    ): mixed {
        if ($l->first() === null ) {
                $l->push(new TexArray());
            }
            $l->first()->unshift(new Literal($f . " ")); return $l;
    }

    private function peg_f69(
        mixed $e,
        mixed $l,
    ): mixed {
        return $l;
    }

    private function peg_f70(
        mixed $e,
        mixed $tail,
    ): mixed {
        if ($tail === null) { return new TexArray( $e )  ; }
        return $tail->unshift($e);
    }

    private function peg_f71(
    ): mixed {
        return $this->text();
    }

    private function peg_f72(
        mixed $cs,
    ): mixed {
        return TexArray::newCurly(new Literal($cs));
    }

    private function peg_f73(
    ): mixed {
        return $this->text();
    }

    private function peg_f74(
        mixed $num,
    ): mixed {
        return TexArray::newCurly(new Literal($num));
    }

    private function peg_f75(
        mixed $e,
    ): mixed {
        return $e->setCurly();
    }

    private function peg_f76(
        mixed $p,
        mixed $s,
    ): mixed {
        return new TexArray($p,new TexArray(new Literal(" "),$s));
    }

    private function peg_f77(
        mixed $p,
    ): mixed {
        return new TexArray($p,new TexArray());
    }

    private function peg_f78(
        mixed $m,
    ): mixed {
        return new Literal($m);
    }

    private function peg_f79(
        mixed $m,
        mixed $n,
    ): mixed {
        return new ChemWord($m, new Literal($n));
    }

    private function peg_f80(
        mixed $m,
    ): mixed {
        return $m;
    }

    private function peg_f81(
        mixed $m,
    ): mixed {
        return new Literal($m);
    }

    private function peg_f82(
        mixed $m,
    ): mixed {
        return new Literal($m);
    }

    private function peg_f83(
        mixed $m,
        mixed $n,
    ): mixed {
        return new ChemWord($m, $n);
    }

    private function peg_f84(
        mixed $m,
        mixed $n,
        mixed $o,
    ): mixed {
        return new ChemWord(new ChemWord(new Literal($m), $n), $o);
    }

    private function peg_f85(
        mixed $m,
    ): mixed {
        return $m;
    }

    private function peg_f86(
    ): mixed {
        return new Literal("");
    }

    private function peg_f87(
        mixed $m,
    ): mixed {
        return $m;
    }

    private function peg_f88(
        mixed $c,
    ): mixed {
        return new Literal($c);
    }

    private function peg_f89(
        mixed $m,
    ): mixed {
        return $m;
    }

    private function peg_f90(
        mixed $c,
    ): mixed {
        return TexArray::newCurly($c);
    }

    private function peg_f91(
        mixed $c,
    ): mixed {
        return new Dollar($c);
    }

    private function peg_f92(
        mixed $name,
        mixed $l,
    ): mixed {
        return new Fun1($name, $l);
    }

    private function peg_f93(
        mixed $m,
    ): mixed {
        return $m;
    }

    private function peg_f94(
        mixed $c,
    ): mixed {
        return new Literal($c);
    }

    private function peg_f95(
        mixed $e,
    ): mixed {
        return TexArray::newCurly(new Literal($e));
    }

    private function peg_f96(
        mixed $a,
        mixed $b,
    ): mixed {
        return new ChemWord(new Literal($a), new Literal($b));
    }

    private function peg_f97(
        mixed $a,
        mixed $b,
    ): mixed {
        return new ChemWord(new Literal($a), $b);
    }

    private function peg_f98(
        mixed $a,
        mixed $b,
    ): mixed {
        return new ChemWord(new Literal($a), new Dollar($b));
    }

    private function peg_f99(
        mixed $name,
        mixed $l1,
        mixed $l2,
    ): mixed {
        return new ChemFun2u($name, $l1, $l2);
    }

    private function peg_f100(
        mixed $name,
        mixed $l1,
        mixed $l2,
    ): mixed {
        return new Fun2($name, $l1, $l2);
    }

    private function peg_f101(
        mixed $name,
        mixed $l1,
        mixed $l2,
    ): mixed {
        return new Fun2($name, $l1, $l2);
    }

    private function peg_f102(
        mixed $name,
        mixed $l,
    ): mixed {
        return new Fun1($name, $l);
    }

    private function peg_f103(
        mixed $cs,
    ): mixed {
        return new Literal(join('',$cs));
    }

    private function peg_f104(
        mixed $name,
    ): mixed {
        return new Literal(join('',$name));
    }

    private function peg_f105(
        mixed $b,
    ): mixed {
        return $this->tu->box_functions($b);
    }

    private function peg_f106(
        mixed $b,
        mixed $cs,
    ): mixed {
        return new Box($b, join('', $cs));
    }

    private function peg_f107(
    ): mixed {
        return ":=";
    }

    private function peg_f108(
        mixed $c,
    ): mixed {
        return $c;
    }

    private function peg_f109(
        mixed $f,
    ): mixed {
        return $this->tu->nullary_macro($f);
    }

    private function peg_f110(
        mixed $f,
    ): mixed {
        return $f . " ";
    }

    private function peg_f111(
        mixed $f,
    ): mixed {
        return $this->options['usemathrm'] && $this->tu->nullary_macro_in_mbox($f);
    }

    private function peg_f112(
        mixed $f,
    ): mixed {
        return "\\mathrm {" . $f . "} ";
    }

    private function peg_f113(
        mixed $mathrm,
    ): mixed {
        return $this->options['usemathrm'] && $mathrm === "\\mathrm";
    }

    private function peg_f114(
        mixed $mathrm,
        mixed $f,
    ): mixed {
        return $this->options['usemathrm'] && $this->tu->nullary_macro_in_mbox($f);
    }

    private function peg_f115(
        mixed $mathrm,
        mixed $f,
    ): mixed {
        return  $this->options['usemathrm'] ? "\\mathrm {" . $f . "} " : false;
    }

    private function peg_f116(
        mixed $f,
    ): mixed {
        return $this->tu->nullary_macro_in_mbox($f);
    }

    private function peg_f117(
        mixed $f,
    ): mixed {
        return "\\mbox{" . $f . "} ";
    }

    private function peg_f118(
        mixed $mbox,
    ): mixed {
        return $mbox === "\\mbox";
    }

    private function peg_f119(
        mixed $mbox,
        mixed $f,
    ): mixed {
        return $this->tu->nullary_macro_in_mbox($f);
    }

    private function peg_f120(
        mixed $mbox,
        mixed $f,
    ): mixed {
        return "\\mbox{" . $f . "} ";
    }

    private function peg_f121(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f122(
        mixed $c,
    ): mixed {
        return "\\" . $c;
    }

    private function peg_f123(
        mixed $c,
    ): mixed {
        return $c;
    }

    private function peg_f124(
        mixed $c,
    ): mixed {
        if($this->options['oldtexvc']) {
        return "\\" . $c; /* escape dangerous chars */
        } else {
         throw new SyntaxError("Deprecation: % and $ need to be escaped.", [], $this->text(), $this->offset(),
            $this->line(), $this->column(), $this->location());
        }
    }

    private function peg_f125(
        mixed $c,
    ): mixed {
        return $c;
    }

    private function peg_f126(
        mixed $c,
    ): mixed {
        return "\\" . $c;
    }

    private function peg_f127(
        mixed $f,
    ): mixed {
        return $this->tu->other_delimiters1($f);
    }

    private function peg_f128(
        mixed $f,
    ): mixed {
        return $f . " ";
    }

    private function peg_f129(
        mixed $f,
    ): mixed {
        return $this->tu->other_delimiters2($f);
    }

    private function peg_f130(
        mixed $f,
    ): mixed {
        $parser = new Parser();
         $p = $parser->parse($this->tu->other_delimiters2($f), $this->options);
         # assert.ok(p instanceof TexArray && p.length === 1);
         assert($p instanceof TexArray && count($p->getArgs()) === 1);

         # assert.ok(p.first() instanceof Literal);
          assert($p->first() instanceof Literal);

         return $p->first()->getArg();
    }

    private function peg_f131(
        mixed $f,
    ): mixed {
        return $this->tu->fun_ar1nb($f);
    }

    private function peg_f132(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f133(
        mixed $f,
    ): mixed {
        return $this->tu->fun_ar1opt($f);
    }

    private function peg_f134(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f135(
        mixed $s,
        mixed $n,
        mixed $u,
    ): mixed {
        return new LengthSpec($s, $n, $u);
    }

    private function peg_f136(
        mixed $l,
    ): mixed {
        return $l;
    }

    private function peg_f137(
        mixed $s,
    ): mixed {
        return $s;
    }

    private function peg_f138(
    ): mixed {
        return $this->text();
    }

    private function peg_f139(
        mixed $f,
    ): mixed {
        return $this->tu->big_literals($f);
    }

    private function peg_f140(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f141(
        mixed $f,
    ): mixed {
        return $this->tu->fun_ar1($f);
    }

    private function peg_f142(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f143(
        mixed $f,
    ): mixed {
        return $this->options['oldmhchem'] && $this->tu->fun_mhchem($f);
    }

    private function peg_f144(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f145(
        mixed $f,
    ): mixed {
        return $this->tu->other_fun_ar1($f);
    }

    private function peg_f146(
        mixed $f,
    ): mixed {
        if ($this->options['oldtexvc']) {
            return $this->tu->other_fun_ar1($f);
         } else {
            throw new SyntaxError("Deprecation: \\Bbb and \\bold are not allowed in math mode.", [],
                $this->text(), $this->offset(), $this->line(), $this->column(), $this->location());
         }
    }

    private function peg_f147(
        mixed $f,
    ): mixed {
        return $this->tu->fun_mhchem($f);
    }

    private function peg_f148(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f149(
        mixed $f,
    ): mixed {
        return $this->tu->fun_ar2($f);
    }

    private function peg_f150(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f151(
        mixed $f,
    ): mixed {
        return $this->tu->fun_ar4($f) && $this->tu->mhchemtexified_required($f);
    }

    private function peg_f152(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f153(
        mixed $f,
    ): mixed {
        return $this->tu->fun_infix($f);
    }

    private function peg_f154(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f155(
        mixed $f,
    ): mixed {
        return $this->tu->declh_function($f);
    }

    private function peg_f156(
        mixed $f,
    ): mixed {
        return new Declh($f, new TexArray());
    }

    private function peg_f157(
        mixed $f,
    ): mixed {
        return $this->tu->fun_ar2nb($f);
    }

    private function peg_f158(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f159(
        mixed $f,
    ): mixed {
        return $this->tu->left_function($f);
    }

    private function peg_f160(
        mixed $f,
    ): mixed {
        return $this->tu->right_function($f);
    }

    private function peg_f161(
        mixed $f,
    ): mixed {
        return $this->tu->hline_function($f);
    }

    private function peg_f162(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f163(
        mixed $f,
    ): mixed {
        return $this->tu->color_function($f);
    }

    private function peg_f164(
        mixed $f,
        mixed $cs,
    ): mixed {
        return $f . " " . $cs;
    }

    private function peg_f165(
        mixed $f,
    ): mixed {
        return $this->tu->definecolor_function($f);
    }

    private function peg_f166(
        mixed $f,
        mixed $name,
        mixed $cs,
    ): mixed {
        return "{named}" . $cs;
    }

    private function peg_f167(
        mixed $f,
        mixed $name,
        mixed $cs,
    ): mixed {
        return "{gray}" . $cs;
    }

    private function peg_f168(
        mixed $f,
        mixed $name,
        mixed $cs,
    ): mixed {
        return "{rgb}" . $cs;
    }

    private function peg_f169(
        mixed $f,
        mixed $name,
        mixed $cs,
    ): mixed {
        return "{rgb}" . $cs;
    }

    private function peg_f170(
        mixed $f,
        mixed $name,
        mixed $cs,
    ): mixed {
        return "{cmyk}" . $cs;
    }

    private function peg_f171(
        mixed $f,
        mixed $name,
        mixed $a,
    ): mixed {
        return $f . " {" . join('',$name) . "}" . $a;
    }

    private function peg_f172(
        mixed $cs,
    ): mixed {
        return "[named]" . $cs;
    }

    private function peg_f173(
        mixed $cs,
    ): mixed {
        return "[gray]" . $cs;
    }

    private function peg_f174(
        mixed $cs,
    ): mixed {
        return "[rgb]" . $cs;
    }

    private function peg_f175(
        mixed $cs,
    ): mixed {
        return "[rgb]" . $cs;
    }

    private function peg_f176(
        mixed $cs,
    ): mixed {
        return "[cmyk]" . $cs;
    }

    private function peg_f177(
        mixed $name,
    ): mixed {
        return "{" . join('', $name) . "}";
    }

    private function peg_f178(
        mixed $k,
    ): mixed {
        $s = is_array($k) ? $k[0] : $k;
          return "{" . $s . "}";
    }

    private function peg_f179(
        mixed $r,
        mixed $g,
        mixed $b,
    ): mixed {
        return "{" . $r . "," . $g . "," . $b . "}";
    }

    private function peg_f180(
        mixed $r,
        mixed $g,
        mixed $b,
    ): mixed {
        return "{" . $r . "," . $g . "," . $b . "}";
    }

    private function peg_f181(
        mixed $c,
        mixed $m,
        mixed $y,
        mixed $k,
    ): mixed {
        return "{" . $c . "," . $m . "," . $y . "," . $k . "}";
    }

    private function peg_f182(
        mixed $n,
    ): mixed {
        return intval($n, 10) <= 255;
    }

    private function peg_f183(
        mixed $n,
    ): mixed {
        return $n / 255;
    }

    private function peg_f184(
        mixed $n,
    ): mixed {
        return $n;
    }

    private function peg_f185(
        mixed $n,
    ): mixed {
        return $n;
    }

    private function peg_f186(
        mixed $f,
    ): mixed {
        return $this->tu->mhchem_single_macro($f);
    }

    private function peg_f187(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f188(
        mixed $c,
    ): mixed {
        return "\\" . $c;
    }

    private function peg_f189(
        mixed $f,
    ): mixed {
        return $this->tu->mhchem_bond($f);
    }

    private function peg_f190(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f191(
        mixed $f,
    ): mixed {
        return $this->tu->mhchem_macro_1p($f);
    }

    private function peg_f192(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f193(
        mixed $f,
    ): mixed {
        return $this->tu->mhchem_macro_2p($f);
    }

    private function peg_f194(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f195(
        mixed $f,
    ): mixed {
        return $this->tu->mhchem_macro_2pu($f);
    }

    private function peg_f196(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f197(
        mixed $f,
    ): mixed {
        return $this->tu->mhchem_macro_2pc($f);
    }

    private function peg_f198(
        mixed $f,
    ): mixed {
        return $f;
    }

    private function peg_f199(
        mixed $c,
    ): mixed {
        return $c;
    }

    private function peg_f200(
        mixed $c,
    ): mixed {
        return $c;
    }

    private function peg_f201(
        mixed $c,
    ): mixed {
        return $c;
    }

    private function peg_f202(
        mixed $c,
    ): mixed {
        return $c;
    }

    private function peg_f203(
        mixed $c,
    ): mixed {
        return $c;
    }

    private function peg_f204(
    ): mixed {
        return "{}";
    }

    private function peg_f205(
    ): mixed {
        return $this->peg_currPos === $this->input_length;
    }

    private function peg_parse_start(): mixed
    {
        $key = $this->peg_currPos * 124 + 0;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse__();
        $s2 = $this->peg_parse_tex_expr();
        if ($s2 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $s0;
            $s0 = $this->peg_f0($s2);
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse__(): mixed
    {
        $key = $this->peg_currPos * 124 + 1;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = [];
        $s1 = $this->input_substr($this->peg_currPos, 1);
        if (\preg_match($this->peg_c0, $s1)) {
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e0);
            }
        }
        while ($s1 !== $this->peg_FAILED) {
            $s0[] = $s1;
            $s1 = $this->input_substr($this->peg_currPos, 1);
            if (\preg_match($this->peg_c0, $s1)) {
                $this->peg_currPos++;
            } else {
                $s1 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e0);
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_tex_expr(): mixed
    {
        $key = $this->peg_currPos * 124 + 2;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_expr();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_EOF();
            if ($s2 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f1($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_parse_ne_expr();
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->peg_parse_FUN_INFIX();
                if ($s2 !== $this->peg_FAILED) {
                    $s3 = $this->peg_parse_ne_expr();
                    if ($s3 !== $this->peg_FAILED) {
                        $s4 = $this->peg_parse_EOF();
                        if ($s4 !== $this->peg_FAILED) {
                            $this->peg_reportedPos = $s0;
                            $s0 = $this->peg_f2($s1, $s2, $s3);
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_expr(): mixed
    {
        $key = $this->peg_currPos * 124 + 3;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_parse_ne_expr();
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = "";
            $this->peg_reportedPos = $s0;
            $s1 = $this->peg_f3();
            $s0 = $s1;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_ne_expr(): mixed
    {
        $key = $this->peg_currPos * 124 + 4;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_lit_aq();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_expr();
            if ($s2 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f4($s1, $s2);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_parse_litsq_aq();
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->peg_parse_expr();
                if ($s2 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f5($s1, $s2);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
            if ($s0 === $this->peg_FAILED) {
                $s0 = $this->peg_currPos;
                $s1 = $this->peg_parse_DECLh();
                if ($s1 !== $this->peg_FAILED) {
                    $s2 = $this->peg_parse_expr();
                    if ($s2 !== $this->peg_FAILED) {
                        $this->peg_reportedPos = $s0;
                        $s0 = $this->peg_f6($s1, $s2);
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_litsq_aq(): mixed
    {
        $key = $this->peg_currPos * 124 + 5;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_parse_litsq_fq();
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_parse_litsq_dq();
            if ($s0 === $this->peg_FAILED) {
                $s0 = $this->peg_parse_litsq_uq();
                if ($s0 === $this->peg_FAILED) {
                    $s0 = $this->peg_parse_litsq_zq();
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_litsq_fq(): mixed
    {
        $key = $this->peg_currPos * 124 + 6;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_litsq_dq();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_SUP();
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse_lit();
                if ($s3 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f7($s1, $s3);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_parse_litsq_uq();
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->peg_parse_SUB();
                if ($s2 !== $this->peg_FAILED) {
                    $s3 = $this->peg_parse_lit();
                    if ($s3 !== $this->peg_FAILED) {
                        $this->peg_reportedPos = $s0;
                        $s0 = $this->peg_f8($s1, $s3);
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_litsq_uq(): mixed
    {
        $key = $this->peg_currPos * 124 + 7;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_litsq_zq();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_SUP();
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse_lit();
                if ($s3 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f9($s1, $s3);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_litsq_dq(): mixed
    {
        $key = $this->peg_currPos * 124 + 8;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_litsq_zq();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_SUB();
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse_lit();
                if ($s3 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f10($s1, $s3);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_litsq_zq(): mixed
    {
        $key = $this->peg_currPos * 124 + 9;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_SQ_CLOSE();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $s0;
            $s1 = $this->peg_f11();
        }
        $s0 = $s1;

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_expr_nosqc(): mixed
    {
        $key = $this->peg_currPos * 124 + 10;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_lit_aq();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_expr_nosqc();
            if ($s2 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f12($s1, $s2);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = "";
            $this->peg_reportedPos = $s0;
            $s1 = $this->peg_f13();
            $s0 = $s1;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_lit_aq(): mixed
    {
        $key = $this->peg_currPos * 124 + 11;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_parse_lit_fq();
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_parse_lit_dq();
            if ($s0 === $this->peg_FAILED) {
                $s0 = $this->peg_parse_lit_uq();
                if ($s0 === $this->peg_FAILED) {
                    $s0 = $this->peg_parse_lit_dqn();
                    if ($s0 === $this->peg_FAILED) {
                        $s0 = $this->peg_parse_lit_uqn();
                        if ($s0 === $this->peg_FAILED) {
                            $s0 = $this->peg_parse_lit();
                        }
                    }
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_lit_fq(): mixed
    {
        $key = $this->peg_currPos * 124 + 12;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_lit_dq();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_SUP();
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse_lit();
                if ($s3 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f14($s1, $s3);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_parse_lit_uq();
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->peg_parse_SUB();
                if ($s2 !== $this->peg_FAILED) {
                    $s3 = $this->peg_parse_lit();
                    if ($s3 !== $this->peg_FAILED) {
                        $this->peg_reportedPos = $s0;
                        $s0 = $this->peg_f15($s1, $s3);
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
            if ($s0 === $this->peg_FAILED) {
                $s0 = $this->peg_currPos;
                $s1 = $this->peg_parse_lit_dqn();
                if ($s1 !== $this->peg_FAILED) {
                    $s2 = $this->peg_parse_SUP();
                    if ($s2 !== $this->peg_FAILED) {
                        $s3 = $this->peg_parse_lit();
                        if ($s3 !== $this->peg_FAILED) {
                            $this->peg_reportedPos = $s0;
                            $s0 = $this->peg_f16($s1, $s3);
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_lit_uq(): mixed
    {
        $key = $this->peg_currPos * 124 + 13;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_lit();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_SUP();
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse_lit();
                if ($s3 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f17($s1, $s3);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_lit_dq(): mixed
    {
        $key = $this->peg_currPos * 124 + 14;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_lit();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_SUB();
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse_lit();
                if ($s3 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f18($s1, $s3);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_lit_uqn(): mixed
    {
        $key = $this->peg_currPos * 124 + 15;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_SUP();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_lit();
            if ($s2 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f19($s2);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_lit_dqn(): mixed
    {
        $key = $this->peg_currPos * 124 + 16;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_SUB();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_lit();
            if ($s2 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f20($s2);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_left(): mixed
    {
        $key = $this->peg_currPos * 124 + 17;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_LEFTI();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_DELIMITER();
            if ($s2 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f21($s2);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_parse_LEFTI();
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->peg_parse_SQ_CLOSE();
                if ($s2 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f22();
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_right(): mixed
    {
        $key = $this->peg_currPos * 124 + 18;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_RIGHTI();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_DELIMITER();
            if ($s2 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f23($s2);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_parse_RIGHTI();
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->peg_parse_SQ_CLOSE();
                if ($s2 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f24();
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_lit(): mixed
    {
        $key = $this->peg_currPos * 124 + 19;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_LITERAL();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $s0;
            $s1 = $this->peg_f25($s1);
        }
        $s0 = $s1;
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_parse_generic_func();
            if ($s1 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $this->peg_currPos;
                $s2 = $this->peg_f26($s1);
                if ($s2) {
                    $s2 = null;
                } else {
                    $s2 = $this->peg_FAILED;
                }
                if ($s2 !== $this->peg_FAILED) {
                    $s3 = $this->peg_parse__();
                    $s4 = $this->input_substr($this->peg_currPos, 1);
                    if (\preg_match($this->peg_c1, $s4)) {
                        $this->peg_currPos++;
                    } else {
                        $s4 = $this->peg_FAILED;
                        if ($this->peg_silentFails === 0) {
                            $this->peg_fail($this->peg_e1);
                        }
                    }
                    if ($s4 === $this->peg_FAILED) {
                        if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l0) {
                            $s4 = $this->peg_l0;
                            $this->peg_currPos += 2;
                        } else {
                            $s4 = $this->peg_FAILED;
                            if ($this->peg_silentFails === 0) {
                                $this->peg_fail($this->peg_e2);
                            }
                        }
                        if ($s4 === $this->peg_FAILED) {
                            $s4 = $this->peg_currPos;
                            $s5 = "";
                            $this->peg_reportedPos = $s4;
                            $s5 = $this->peg_f27($s1);
                            $s4 = $s5;
                        }
                    }
                    if ($s4 !== $this->peg_FAILED) {
                        $s5 = $this->peg_parse__();
                        $this->peg_reportedPos = $s0;
                        $s0 = $this->peg_f28($s1, $s4);
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
            if ($s0 === $this->peg_FAILED) {
                $s0 = $this->peg_currPos;
                $s1 = $this->peg_parse_generic_func();
                if ($s1 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $this->peg_currPos;
                    $s2 = $this->peg_f29($s1);
                    if ($s2) {
                        $s2 = null;
                    } else {
                        $s2 = $this->peg_FAILED;
                    }
                    if ($s2 !== $this->peg_FAILED) {
                        $s3 = $this->peg_parse__();
                        $this->peg_reportedPos = $s0;
                        $s0 = $this->peg_f30($s1);
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
                if ($s0 === $this->peg_FAILED) {
                    $s0 = $this->peg_currPos;
                    $s1 = $this->peg_parse_generic_func();
                    if ($s1 !== $this->peg_FAILED) {
                        $this->peg_reportedPos = $this->peg_currPos;
                        $s2 = $this->peg_f31($s1);
                        if ($s2) {
                            $s2 = null;
                        } else {
                            $s2 = $this->peg_FAILED;
                        }
                        if ($s2 !== $this->peg_FAILED) {
                            $s3 = $this->peg_parse__();
                            $this->peg_reportedPos = $s0;
                            $s0 = $this->peg_f32($s1);
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                    if ($s0 === $this->peg_FAILED) {
                        $s0 = $this->peg_currPos;
                        $s1 = $this->peg_parse_generic_func();
                        if ($s1 !== $this->peg_FAILED) {
                            $this->peg_reportedPos = $this->peg_currPos;
                            $s2 = $this->peg_f33($s1);
                            if ($s2) {
                                $s2 = null;
                            } else {
                                $s2 = $this->peg_FAILED;
                            }
                            if ($s2 !== $this->peg_FAILED) {
                                $s3 = $this->peg_parse__();
                                $this->peg_reportedPos = $s0;
                                $s0 = $this->peg_f34($s1);
                            } else {
                                $this->peg_currPos = $s0;
                                $s0 = $this->peg_FAILED;
                            }
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                        if ($s0 === $this->peg_FAILED) {
                            $s0 = $this->peg_currPos;
                            $s1 = $this->peg_parse_DELIMITER();
                            if ($s1 !== $this->peg_FAILED) {
                                $this->peg_reportedPos = $s0;
                                $s1 = $this->peg_f35($s1);
                            }
                            $s0 = $s1;
                            if ($s0 === $this->peg_FAILED) {
                                $s0 = $this->peg_currPos;
                                $s1 = $this->peg_parse_BIG();
                                if ($s1 !== $this->peg_FAILED) {
                                    $s2 = $this->peg_parse_DELIMITER();
                                    if ($s2 !== $this->peg_FAILED) {
                                        $this->peg_reportedPos = $s0;
                                        $s0 = $this->peg_f36($s1, $s2);
                                    } else {
                                        $this->peg_currPos = $s0;
                                        $s0 = $this->peg_FAILED;
                                    }
                                } else {
                                    $this->peg_currPos = $s0;
                                    $s0 = $this->peg_FAILED;
                                }
                                if ($s0 === $this->peg_FAILED) {
                                    $s0 = $this->peg_currPos;
                                    $s1 = $this->peg_parse_BIG();
                                    if ($s1 !== $this->peg_FAILED) {
                                        $s2 = $this->peg_parse_SQ_CLOSE();
                                        if ($s2 !== $this->peg_FAILED) {
                                            $this->peg_reportedPos = $s0;
                                            $s0 = $this->peg_f37($s1);
                                        } else {
                                            $this->peg_currPos = $s0;
                                            $s0 = $this->peg_FAILED;
                                        }
                                    } else {
                                        $this->peg_currPos = $s0;
                                        $s0 = $this->peg_FAILED;
                                    }
                                    if ($s0 === $this->peg_FAILED) {
                                        $s0 = $this->peg_currPos;
                                        $s1 = $this->peg_parse_left();
                                        if ($s1 !== $this->peg_FAILED) {
                                            $s2 = $this->peg_parse_expr();
                                            if ($s2 !== $this->peg_FAILED) {
                                                $s3 = $this->peg_parse_right();
                                                if ($s3 !== $this->peg_FAILED) {
                                                    $this->peg_reportedPos = $s0;
                                                    $s0 = $this->peg_f38($s1, $s2, $s3);
                                                } else {
                                                    $this->peg_currPos = $s0;
                                                    $s0 = $this->peg_FAILED;
                                                }
                                            } else {
                                                $this->peg_currPos = $s0;
                                                $s0 = $this->peg_FAILED;
                                            }
                                        } else {
                                            $this->peg_currPos = $s0;
                                            $s0 = $this->peg_FAILED;
                                        }
                                        if ($s0 === $this->peg_FAILED) {
                                            $s0 = $this->peg_currPos;
                                            $s1 = $this->peg_parse_FUN_AR1opt();
                                            if ($s1 !== $this->peg_FAILED) {
                                                $s2 = $this->peg_parse_expr_nosqc();
                                                if ($s2 !== $this->peg_FAILED) {
                                                    $s3 = $this->peg_parse_SQ_CLOSE();
                                                    if ($s3 !== $this->peg_FAILED) {
                                                        $s4 = $this->peg_parse_lit();
                                                        if ($s4 !== $this->peg_FAILED) {
                                                            $this->peg_reportedPos = $s0;
                                                            $s0 = $this->peg_f39($s1, $s2, $s4);
                                                        } else {
                                                            $this->peg_currPos = $s0;
                                                            $s0 = $this->peg_FAILED;
                                                        }
                                                    } else {
                                                        $this->peg_currPos = $s0;
                                                        $s0 = $this->peg_FAILED;
                                                    }
                                                } else {
                                                    $this->peg_currPos = $s0;
                                                    $s0 = $this->peg_FAILED;
                                                }
                                            } else {
                                                $this->peg_currPos = $s0;
                                                $s0 = $this->peg_FAILED;
                                            }
                                            if ($s0 === $this->peg_FAILED) {
                                                $s0 = $this->peg_currPos;
                                                $s1 = $this->peg_parse_FUN_AR1();
                                                if ($s1 !== $this->peg_FAILED) {
                                                    $s2 = $this->peg_parse_lit();
                                                    if ($s2 !== $this->peg_FAILED) {
                                                        $this->peg_reportedPos = $s0;
                                                        $s0 = $this->peg_f40($s1, $s2);
                                                    } else {
                                                        $this->peg_currPos = $s0;
                                                        $s0 = $this->peg_FAILED;
                                                    }
                                                } else {
                                                    $this->peg_currPos = $s0;
                                                    $s0 = $this->peg_FAILED;
                                                }
                                                if ($s0 === $this->peg_FAILED) {
                                                    $s0 = $this->peg_currPos;
                                                    $s1 = $this->peg_parse_FUN_AR1nb();
                                                    if ($s1 !== $this->peg_FAILED) {
                                                        $s2 = $this->peg_parse_lit();
                                                        if ($s2 !== $this->peg_FAILED) {
                                                            $this->peg_reportedPos = $s0;
                                                            $s0 = $this->peg_f41($s1, $s2);
                                                        } else {
                                                            $this->peg_currPos = $s0;
                                                            $s0 = $this->peg_FAILED;
                                                        }
                                                    } else {
                                                        $this->peg_currPos = $s0;
                                                        $s0 = $this->peg_FAILED;
                                                    }
                                                    if ($s0 === $this->peg_FAILED) {
                                                        $s0 = $this->peg_currPos;
                                                        $s1 = $this->peg_parse_FUN_MHCHEM();
                                                        if ($s1 !== $this->peg_FAILED) {
                                                            $s2 = $this->peg_parse_chem_lit();
                                                            if ($s2 !== $this->peg_FAILED) {
                                                                $this->peg_reportedPos = $s0;
                                                                $s0 = $this->peg_f42($s1, $s2);
                                                            } else {
                                                                $this->peg_currPos = $s0;
                                                                $s0 = $this->peg_FAILED;
                                                            }
                                                        } else {
                                                            $this->peg_currPos = $s0;
                                                            $s0 = $this->peg_FAILED;
                                                        }
                                                        if ($s0 === $this->peg_FAILED) {
                                                            $s0 = $this->peg_currPos;
                                                            $s1 = $this->peg_parse_FUN_AR2();
                                                            if ($s1 !== $this->peg_FAILED) {
                                                                $s2 = $this->peg_parse_lit();
                                                                if ($s2 !== $this->peg_FAILED) {
                                                                    $s3 = $this->peg_parse_lit();
                                                                    if ($s3 !== $this->peg_FAILED) {
                                                                        $this->peg_reportedPos = $s0;
                                                                        $s0 = $this->peg_f43($s1, $s2, $s3);
                                                                    } else {
                                                                        $this->peg_currPos = $s0;
                                                                        $s0 = $this->peg_FAILED;
                                                                    }
                                                                } else {
                                                                    $this->peg_currPos = $s0;
                                                                    $s0 = $this->peg_FAILED;
                                                                }
                                                            } else {
                                                                $this->peg_currPos = $s0;
                                                                $s0 = $this->peg_FAILED;
                                                            }
                                                            if ($s0 === $this->peg_FAILED) {
                                                                $s0 = $this->peg_currPos;
                                                                $s1 = $this->peg_parse_FUN_AR4_MHCHEM_TEXIFIED();
                                                                if ($s1 !== $this->peg_FAILED) {
                                                                    $s2 = $this->peg_parse_lit();
                                                                    if ($s2 !== $this->peg_FAILED) {
                                                                        $s3 = $this->peg_parse_lit();
                                                                        if ($s3 !== $this->peg_FAILED) {
                                                                            $s4 = $this->peg_parse_lit();
                                                                            if ($s4 !== $this->peg_FAILED) {
                                                                                $s5 = $this->peg_parse_lit();
                                                                                if ($s5 !== $this->peg_FAILED) {
                                                                                    $this->peg_reportedPos = $s0;
                                                                                    $s0 = $this->peg_f44($s1, $s2, $s3, $s4, $s5);
                                                                                } else {
                                                                                    $this->peg_currPos = $s0;
                                                                                    $s0 = $this->peg_FAILED;
                                                                                }
                                                                            } else {
                                                                                $this->peg_currPos = $s0;
                                                                                $s0 = $this->peg_FAILED;
                                                                            }
                                                                        } else {
                                                                            $this->peg_currPos = $s0;
                                                                            $s0 = $this->peg_FAILED;
                                                                        }
                                                                    } else {
                                                                        $this->peg_currPos = $s0;
                                                                        $s0 = $this->peg_FAILED;
                                                                    }
                                                                } else {
                                                                    $this->peg_currPos = $s0;
                                                                    $s0 = $this->peg_FAILED;
                                                                }
                                                                if ($s0 === $this->peg_FAILED) {
                                                                    $s0 = $this->peg_currPos;
                                                                    $s1 = $this->peg_parse_FUN_AR2nb();
                                                                    if ($s1 !== $this->peg_FAILED) {
                                                                        $s2 = $this->peg_parse_lit();
                                                                        if ($s2 !== $this->peg_FAILED) {
                                                                            $s3 = $this->peg_parse_lit();
                                                                            if ($s3 !== $this->peg_FAILED) {
                                                                                $this->peg_reportedPos = $s0;
                                                                                $s0 = $this->peg_f45($s1, $s2, $s3);
                                                                            } else {
                                                                                $this->peg_currPos = $s0;
                                                                                $s0 = $this->peg_FAILED;
                                                                            }
                                                                        } else {
                                                                            $this->peg_currPos = $s0;
                                                                            $s0 = $this->peg_FAILED;
                                                                        }
                                                                    } else {
                                                                        $this->peg_currPos = $s0;
                                                                        $s0 = $this->peg_FAILED;
                                                                    }
                                                                    if ($s0 === $this->peg_FAILED) {
                                                                        $s0 = $this->peg_parse_BOX();
                                                                        if ($s0 === $this->peg_FAILED) {
                                                                            $s0 = $this->peg_currPos;
                                                                            $s1 = $this->peg_parse_CURLY_OPEN();
                                                                            if ($s1 !== $this->peg_FAILED) {
                                                                                $s2 = $this->peg_parse_expr();
                                                                                if ($s2 !== $this->peg_FAILED) {
                                                                                    $s3 = $this->peg_parse_CURLY_CLOSE();
                                                                                    if ($s3 !== $this->peg_FAILED) {
                                                                                        $this->peg_reportedPos = $s0;
                                                                                        $s0 = $this->peg_f46($s2);
                                                                                    } else {
                                                                                        $this->peg_currPos = $s0;
                                                                                        $s0 = $this->peg_FAILED;
                                                                                    }
                                                                                } else {
                                                                                    $this->peg_currPos = $s0;
                                                                                    $s0 = $this->peg_FAILED;
                                                                                }
                                                                            } else {
                                                                                $this->peg_currPos = $s0;
                                                                                $s0 = $this->peg_FAILED;
                                                                            }
                                                                            if ($s0 === $this->peg_FAILED) {
                                                                                $s0 = $this->peg_currPos;
                                                                                $s1 = $this->peg_parse_CURLY_OPEN();
                                                                                if ($s1 !== $this->peg_FAILED) {
                                                                                    $s2 = $this->peg_parse_ne_expr();
                                                                                    if ($s2 !== $this->peg_FAILED) {
                                                                                        $s3 = $this->peg_parse_FUN_INFIX();
                                                                                        if ($s3 !== $this->peg_FAILED) {
                                                                                            $s4 = $this->peg_parse_ne_expr();
                                                                                            if ($s4 !== $this->peg_FAILED) {
                                                                                                $s5 = $this->peg_parse_CURLY_CLOSE();
                                                                                                if ($s5 !== $this->peg_FAILED) {
                                                                                                    $this->peg_reportedPos = $s0;
                                                                                                    $s0 = $this->peg_f47($s2, $s3, $s4);
                                                                                                } else {
                                                                                                    $this->peg_currPos = $s0;
                                                                                                    $s0 = $this->peg_FAILED;
                                                                                                }
                                                                                            } else {
                                                                                                $this->peg_currPos = $s0;
                                                                                                $s0 = $this->peg_FAILED;
                                                                                            }
                                                                                        } else {
                                                                                            $this->peg_currPos = $s0;
                                                                                            $s0 = $this->peg_FAILED;
                                                                                        }
                                                                                    } else {
                                                                                        $this->peg_currPos = $s0;
                                                                                        $s0 = $this->peg_FAILED;
                                                                                    }
                                                                                } else {
                                                                                    $this->peg_currPos = $s0;
                                                                                    $s0 = $this->peg_FAILED;
                                                                                }
                                                                                if ($s0 === $this->peg_FAILED) {
                                                                                    $s0 = $this->peg_currPos;
                                                                                    $s1 = $this->peg_parse_BEGIN_MATRIX();
                                                                                    if ($s1 !== $this->peg_FAILED) {
                                                                                        $s2 = $this->peg_parse_array();
                                                                                        if ($s2 === $this->peg_FAILED) {
                                                                                            $s2 = $this->peg_parse_matrix();
                                                                                        }
                                                                                        if ($s2 !== $this->peg_FAILED) {
                                                                                            $s3 = $this->peg_parse_END_MATRIX();
                                                                                            if ($s3 !== $this->peg_FAILED) {
                                                                                                $this->peg_reportedPos = $s0;
                                                                                                $s0 = $this->peg_f48($s2);
                                                                                            } else {
                                                                                                $this->peg_currPos = $s0;
                                                                                                $s0 = $this->peg_FAILED;
                                                                                            }
                                                                                        } else {
                                                                                            $this->peg_currPos = $s0;
                                                                                            $s0 = $this->peg_FAILED;
                                                                                        }
                                                                                    } else {
                                                                                        $this->peg_currPos = $s0;
                                                                                        $s0 = $this->peg_FAILED;
                                                                                    }
                                                                                    if ($s0 === $this->peg_FAILED) {
                                                                                        $s0 = $this->peg_currPos;
                                                                                        $s1 = $this->peg_parse_BEGIN_PMATRIX();
                                                                                        if ($s1 !== $this->peg_FAILED) {
                                                                                            $s2 = $this->peg_parse_array();
                                                                                            if ($s2 === $this->peg_FAILED) {
                                                                                                $s2 = $this->peg_parse_matrix();
                                                                                            }
                                                                                            if ($s2 !== $this->peg_FAILED) {
                                                                                                $s3 = $this->peg_parse_END_PMATRIX();
                                                                                                if ($s3 !== $this->peg_FAILED) {
                                                                                                    $this->peg_reportedPos = $s0;
                                                                                                    $s0 = $this->peg_f49($s2);
                                                                                                } else {
                                                                                                    $this->peg_currPos = $s0;
                                                                                                    $s0 = $this->peg_FAILED;
                                                                                                }
                                                                                            } else {
                                                                                                $this->peg_currPos = $s0;
                                                                                                $s0 = $this->peg_FAILED;
                                                                                            }
                                                                                        } else {
                                                                                            $this->peg_currPos = $s0;
                                                                                            $s0 = $this->peg_FAILED;
                                                                                        }
                                                                                        if ($s0 === $this->peg_FAILED) {
                                                                                            $s0 = $this->peg_currPos;
                                                                                            $s1 = $this->peg_parse_BEGIN_BMATRIX();
                                                                                            if ($s1 !== $this->peg_FAILED) {
                                                                                                $s2 = $this->peg_parse_array();
                                                                                                if ($s2 === $this->peg_FAILED) {
                                                                                                    $s2 = $this->peg_parse_matrix();
                                                                                                }
                                                                                                if ($s2 !== $this->peg_FAILED) {
                                                                                                    $s3 = $this->peg_parse_END_BMATRIX();
                                                                                                    if ($s3 !== $this->peg_FAILED) {
                                                                                                        $this->peg_reportedPos = $s0;
                                                                                                        $s0 = $this->peg_f50($s2);
                                                                                                    } else {
                                                                                                        $this->peg_currPos = $s0;
                                                                                                        $s0 = $this->peg_FAILED;
                                                                                                    }
                                                                                                } else {
                                                                                                    $this->peg_currPos = $s0;
                                                                                                    $s0 = $this->peg_FAILED;
                                                                                                }
                                                                                            } else {
                                                                                                $this->peg_currPos = $s0;
                                                                                                $s0 = $this->peg_FAILED;
                                                                                            }
                                                                                            if ($s0 === $this->peg_FAILED) {
                                                                                                $s0 = $this->peg_currPos;
                                                                                                $s1 = $this->peg_parse_BEGIN_BBMATRIX();
                                                                                                if ($s1 !== $this->peg_FAILED) {
                                                                                                    $s2 = $this->peg_parse_array();
                                                                                                    if ($s2 === $this->peg_FAILED) {
                                                                                                        $s2 = $this->peg_parse_matrix();
                                                                                                    }
                                                                                                    if ($s2 !== $this->peg_FAILED) {
                                                                                                        $s3 = $this->peg_parse_END_BBMATRIX();
                                                                                                        if ($s3 !== $this->peg_FAILED) {
                                                                                                            $this->peg_reportedPos = $s0;
                                                                                                            $s0 = $this->peg_f51($s2);
                                                                                                        } else {
                                                                                                            $this->peg_currPos = $s0;
                                                                                                            $s0 = $this->peg_FAILED;
                                                                                                        }
                                                                                                    } else {
                                                                                                        $this->peg_currPos = $s0;
                                                                                                        $s0 = $this->peg_FAILED;
                                                                                                    }
                                                                                                } else {
                                                                                                    $this->peg_currPos = $s0;
                                                                                                    $s0 = $this->peg_FAILED;
                                                                                                }
                                                                                                if ($s0 === $this->peg_FAILED) {
                                                                                                    $s0 = $this->peg_currPos;
                                                                                                    $s1 = $this->peg_parse_BEGIN_VMATRIX();
                                                                                                    if ($s1 !== $this->peg_FAILED) {
                                                                                                        $s2 = $this->peg_parse_array();
                                                                                                        if ($s2 === $this->peg_FAILED) {
                                                                                                            $s2 = $this->peg_parse_matrix();
                                                                                                        }
                                                                                                        if ($s2 !== $this->peg_FAILED) {
                                                                                                            $s3 = $this->peg_parse_END_VMATRIX();
                                                                                                            if ($s3 !== $this->peg_FAILED) {
                                                                                                                $this->peg_reportedPos = $s0;
                                                                                                                $s0 = $this->peg_f52($s2);
                                                                                                            } else {
                                                                                                                $this->peg_currPos = $s0;
                                                                                                                $s0 = $this->peg_FAILED;
                                                                                                            }
                                                                                                        } else {
                                                                                                            $this->peg_currPos = $s0;
                                                                                                            $s0 = $this->peg_FAILED;
                                                                                                        }
                                                                                                    } else {
                                                                                                        $this->peg_currPos = $s0;
                                                                                                        $s0 = $this->peg_FAILED;
                                                                                                    }
                                                                                                    if ($s0 === $this->peg_FAILED) {
                                                                                                        $s0 = $this->peg_currPos;
                                                                                                        $s1 = $this->peg_parse_BEGIN_VVMATRIX();
                                                                                                        if ($s1 !== $this->peg_FAILED) {
                                                                                                            $s2 = $this->peg_parse_array();
                                                                                                            if ($s2 === $this->peg_FAILED) {
                                                                                                                $s2 = $this->peg_parse_matrix();
                                                                                                            }
                                                                                                            if ($s2 !== $this->peg_FAILED) {
                                                                                                                $s3 = $this->peg_parse_END_VVMATRIX();
                                                                                                                if ($s3 !== $this->peg_FAILED) {
                                                                                                                    $this->peg_reportedPos = $s0;
                                                                                                                    $s0 = $this->peg_f53($s2);
                                                                                                                } else {
                                                                                                                    $this->peg_currPos = $s0;
                                                                                                                    $s0 = $this->peg_FAILED;
                                                                                                                }
                                                                                                            } else {
                                                                                                                $this->peg_currPos = $s0;
                                                                                                                $s0 = $this->peg_FAILED;
                                                                                                            }
                                                                                                        } else {
                                                                                                            $this->peg_currPos = $s0;
                                                                                                            $s0 = $this->peg_FAILED;
                                                                                                        }
                                                                                                        if ($s0 === $this->peg_FAILED) {
                                                                                                            $s0 = $this->peg_currPos;
                                                                                                            $s1 = $this->peg_parse_BEGIN_ARRAY();
                                                                                                            if ($s1 !== $this->peg_FAILED) {
                                                                                                                $s2 = $this->peg_parse_opt_pos();
                                                                                                                if ($s2 !== $this->peg_FAILED) {
                                                                                                                    $s3 = $this->peg_parse_array();
                                                                                                                    if ($s3 !== $this->peg_FAILED) {
                                                                                                                        $s4 = $this->peg_parse_END_ARRAY();
                                                                                                                        if ($s4 !== $this->peg_FAILED) {
                                                                                                                            $this->peg_reportedPos = $s0;
                                                                                                                            $s0 = $this->peg_f54($s3);
                                                                                                                        } else {
                                                                                                                            $this->peg_currPos = $s0;
                                                                                                                            $s0 = $this->peg_FAILED;
                                                                                                                        }
                                                                                                                    } else {
                                                                                                                        $this->peg_currPos = $s0;
                                                                                                                        $s0 = $this->peg_FAILED;
                                                                                                                    }
                                                                                                                } else {
                                                                                                                    $this->peg_currPos = $s0;
                                                                                                                    $s0 = $this->peg_FAILED;
                                                                                                                }
                                                                                                            } else {
                                                                                                                $this->peg_currPos = $s0;
                                                                                                                $s0 = $this->peg_FAILED;
                                                                                                            }
                                                                                                            if ($s0 === $this->peg_FAILED) {
                                                                                                                $s0 = $this->peg_currPos;
                                                                                                                $s1 = $this->peg_parse_BEGIN_ALIGN();
                                                                                                                if ($s1 !== $this->peg_FAILED) {
                                                                                                                    $s2 = $this->peg_parse_opt_pos();
                                                                                                                    if ($s2 !== $this->peg_FAILED) {
                                                                                                                        $s3 = $this->peg_parse_matrix();
                                                                                                                        if ($s3 !== $this->peg_FAILED) {
                                                                                                                            $s4 = $this->peg_parse_END_ALIGN();
                                                                                                                            if ($s4 !== $this->peg_FAILED) {
                                                                                                                                $this->peg_reportedPos = $s0;
                                                                                                                                $s0 = $this->peg_f55($s3);
                                                                                                                            } else {
                                                                                                                                $this->peg_currPos = $s0;
                                                                                                                                $s0 = $this->peg_FAILED;
                                                                                                                            }
                                                                                                                        } else {
                                                                                                                            $this->peg_currPos = $s0;
                                                                                                                            $s0 = $this->peg_FAILED;
                                                                                                                        }
                                                                                                                    } else {
                                                                                                                        $this->peg_currPos = $s0;
                                                                                                                        $s0 = $this->peg_FAILED;
                                                                                                                    }
                                                                                                                } else {
                                                                                                                    $this->peg_currPos = $s0;
                                                                                                                    $s0 = $this->peg_FAILED;
                                                                                                                }
                                                                                                                if ($s0 === $this->peg_FAILED) {
                                                                                                                    $s0 = $this->peg_currPos;
                                                                                                                    $s1 = $this->peg_parse_BEGIN_ALIGNED();
                                                                                                                    if ($s1 !== $this->peg_FAILED) {
                                                                                                                        $s2 = $this->peg_parse_opt_pos();
                                                                                                                        if ($s2 !== $this->peg_FAILED) {
                                                                                                                            $s3 = $this->peg_parse_matrix();
                                                                                                                            if ($s3 !== $this->peg_FAILED) {
                                                                                                                                $s4 = $this->peg_parse_END_ALIGNED();
                                                                                                                                if ($s4 !== $this->peg_FAILED) {
                                                                                                                                    $this->peg_reportedPos = $s0;
                                                                                                                                    $s0 = $this->peg_f56($s3);
                                                                                                                                } else {
                                                                                                                                    $this->peg_currPos = $s0;
                                                                                                                                    $s0 = $this->peg_FAILED;
                                                                                                                                }
                                                                                                                            } else {
                                                                                                                                $this->peg_currPos = $s0;
                                                                                                                                $s0 = $this->peg_FAILED;
                                                                                                                            }
                                                                                                                        } else {
                                                                                                                            $this->peg_currPos = $s0;
                                                                                                                            $s0 = $this->peg_FAILED;
                                                                                                                        }
                                                                                                                    } else {
                                                                                                                        $this->peg_currPos = $s0;
                                                                                                                        $s0 = $this->peg_FAILED;
                                                                                                                    }
                                                                                                                    if ($s0 === $this->peg_FAILED) {
                                                                                                                        $s0 = $this->peg_currPos;
                                                                                                                        $s1 = $this->peg_parse_BEGIN_ALIGNAT();
                                                                                                                        if ($s1 !== $this->peg_FAILED) {
                                                                                                                            $s2 = $this->peg_parse_alignat();
                                                                                                                            if ($s2 !== $this->peg_FAILED) {
                                                                                                                                $s3 = $this->peg_parse_END_ALIGNAT();
                                                                                                                                if ($s3 !== $this->peg_FAILED) {
                                                                                                                                    $this->peg_reportedPos = $s0;
                                                                                                                                    $s0 = $this->peg_f57($s2);
                                                                                                                                } else {
                                                                                                                                    $this->peg_currPos = $s0;
                                                                                                                                    $s0 = $this->peg_FAILED;
                                                                                                                                }
                                                                                                                            } else {
                                                                                                                                $this->peg_currPos = $s0;
                                                                                                                                $s0 = $this->peg_FAILED;
                                                                                                                            }
                                                                                                                        } else {
                                                                                                                            $this->peg_currPos = $s0;
                                                                                                                            $s0 = $this->peg_FAILED;
                                                                                                                        }
                                                                                                                        if ($s0 === $this->peg_FAILED) {
                                                                                                                            $s0 = $this->peg_currPos;
                                                                                                                            $s1 = $this->peg_parse_BEGIN_ALIGNEDAT();
                                                                                                                            if ($s1 !== $this->peg_FAILED) {
                                                                                                                                $s2 = $this->peg_parse_alignat();
                                                                                                                                if ($s2 !== $this->peg_FAILED) {
                                                                                                                                    $s3 = $this->peg_parse_END_ALIGNEDAT();
                                                                                                                                    if ($s3 !== $this->peg_FAILED) {
                                                                                                                                        $this->peg_reportedPos = $s0;
                                                                                                                                        $s0 = $this->peg_f58($s2);
                                                                                                                                    } else {
                                                                                                                                        $this->peg_currPos = $s0;
                                                                                                                                        $s0 = $this->peg_FAILED;
                                                                                                                                    }
                                                                                                                                } else {
                                                                                                                                    $this->peg_currPos = $s0;
                                                                                                                                    $s0 = $this->peg_FAILED;
                                                                                                                                }
                                                                                                                            } else {
                                                                                                                                $this->peg_currPos = $s0;
                                                                                                                                $s0 = $this->peg_FAILED;
                                                                                                                            }
                                                                                                                            if ($s0 === $this->peg_FAILED) {
                                                                                                                                $s0 = $this->peg_currPos;
                                                                                                                                $s1 = $this->peg_parse_BEGIN_SMALLMATRIX();
                                                                                                                                if ($s1 !== $this->peg_FAILED) {
                                                                                                                                    $s2 = $this->peg_parse_array();
                                                                                                                                    if ($s2 === $this->peg_FAILED) {
                                                                                                                                        $s2 = $this->peg_parse_matrix();
                                                                                                                                    }
                                                                                                                                    if ($s2 !== $this->peg_FAILED) {
                                                                                                                                        $s3 = $this->peg_parse_END_SMALLMATRIX();
                                                                                                                                        if ($s3 !== $this->peg_FAILED) {
                                                                                                                                            $this->peg_reportedPos = $s0;
                                                                                                                                            $s0 = $this->peg_f59($s2);
                                                                                                                                        } else {
                                                                                                                                            $this->peg_currPos = $s0;
                                                                                                                                            $s0 = $this->peg_FAILED;
                                                                                                                                        }
                                                                                                                                    } else {
                                                                                                                                        $this->peg_currPos = $s0;
                                                                                                                                        $s0 = $this->peg_FAILED;
                                                                                                                                    }
                                                                                                                                } else {
                                                                                                                                    $this->peg_currPos = $s0;
                                                                                                                                    $s0 = $this->peg_FAILED;
                                                                                                                                }
                                                                                                                                if ($s0 === $this->peg_FAILED) {
                                                                                                                                    $s0 = $this->peg_currPos;
                                                                                                                                    $s1 = $this->peg_parse_BEGIN_CASES();
                                                                                                                                    if ($s1 !== $this->peg_FAILED) {
                                                                                                                                        $s2 = $this->peg_parse_matrix();
                                                                                                                                        if ($s2 !== $this->peg_FAILED) {
                                                                                                                                            $s3 = $this->peg_parse_END_CASES();
                                                                                                                                            if ($s3 !== $this->peg_FAILED) {
                                                                                                                                                $this->peg_reportedPos = $s0;
                                                                                                                                                $s0 = $this->peg_f60($s2);
                                                                                                                                            } else {
                                                                                                                                                $this->peg_currPos = $s0;
                                                                                                                                                $s0 = $this->peg_FAILED;
                                                                                                                                            }
                                                                                                                                        } else {
                                                                                                                                            $this->peg_currPos = $s0;
                                                                                                                                            $s0 = $this->peg_FAILED;
                                                                                                                                        }
                                                                                                                                    } else {
                                                                                                                                        $this->peg_currPos = $s0;
                                                                                                                                        $s0 = $this->peg_FAILED;
                                                                                                                                    }
                                                                                                                                    if ($s0 === $this->peg_FAILED) {
                                                                                                                                        $s0 = $this->peg_currPos;
                                                                                                                                        if ($this->input_substr($this->peg_currPos, 7) === $this->peg_l1) {
                                                                                                                                            $s1 = $this->peg_l1;
                                                                                                                                            $this->peg_currPos += 7;
                                                                                                                                        } else {
                                                                                                                                            $s1 = $this->peg_FAILED;
                                                                                                                                            if ($this->peg_silentFails === 0) {
                                                                                                                                                $this->peg_fail($this->peg_e3);
                                                                                                                                            }
                                                                                                                                        }
                                                                                                                                        if ($s1 !== $this->peg_FAILED) {
                                                                                                                                            $s2 = [];
                                                                                                                                            $s3 = $this->peg_parse_alpha();
                                                                                                                                            if ($s3 !== $this->peg_FAILED) {
                                                                                                                                                while ($s3 !== $this->peg_FAILED) {
                                                                                                                                                    $s2[] = $s3;
                                                                                                                                                    $s3 = $this->peg_parse_alpha();
                                                                                                                                                }
                                                                                                                                            } else {
                                                                                                                                                $s2 = $this->peg_FAILED;
                                                                                                                                            }
                                                                                                                                            if ($s2 !== $this->peg_FAILED) {
                                                                                                                                                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                                                                                                                                                    $s3 = $this->peg_l2;
                                                                                                                                                    $this->peg_currPos++;
                                                                                                                                                } else {
                                                                                                                                                    $s3 = $this->peg_FAILED;
                                                                                                                                                    if ($this->peg_silentFails === 0) {
                                                                                                                                                        $this->peg_fail($this->peg_e4);
                                                                                                                                                    }
                                                                                                                                                }
                                                                                                                                                if ($s3 !== $this->peg_FAILED) {
                                                                                                                                                    $this->peg_reportedPos = $s0;
                                                                                                                                                    $s0 = $this->peg_f61();
                                                                                                                                                } else {
                                                                                                                                                    $this->peg_currPos = $s0;
                                                                                                                                                    $s0 = $this->peg_FAILED;
                                                                                                                                                }
                                                                                                                                            } else {
                                                                                                                                                $this->peg_currPos = $s0;
                                                                                                                                                $s0 = $this->peg_FAILED;
                                                                                                                                            }
                                                                                                                                        } else {
                                                                                                                                            $this->peg_currPos = $s0;
                                                                                                                                            $s0 = $this->peg_FAILED;
                                                                                                                                        }
                                                                                                                                        if ($s0 === $this->peg_FAILED) {
                                                                                                                                            $s0 = $this->peg_currPos;
                                                                                                                                            $s1 = $this->peg_parse_generic_func();
                                                                                                                                            if ($s1 !== $this->peg_FAILED) {
                                                                                                                                                $this->peg_reportedPos = $this->peg_currPos;
                                                                                                                                                $s2 = $this->peg_f62($s1);
                                                                                                                                                if ($s2) {
                                                                                                                                                    $s2 = null;
                                                                                                                                                } else {
                                                                                                                                                    $s2 = $this->peg_FAILED;
                                                                                                                                                }
                                                                                                                                                if ($s2 !== $this->peg_FAILED) {
                                                                                                                                                    $this->peg_reportedPos = $s0;
                                                                                                                                                    $s0 = $this->peg_f63($s1);
                                                                                                                                                } else {
                                                                                                                                                    $this->peg_currPos = $s0;
                                                                                                                                                    $s0 = $this->peg_FAILED;
                                                                                                                                                }
                                                                                                                                            } else {
                                                                                                                                                $this->peg_currPos = $s0;
                                                                                                                                                $s0 = $this->peg_FAILED;
                                                                                                                                            }
                                                                                                                                        }
                                                                                                                                    }
                                                                                                                                }
                                                                                                                            }
                                                                                                                        }
                                                                                                                    }
                                                                                                                }
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_array(): mixed
    {
        $key = $this->peg_currPos * 124 + 20;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_column_spec();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_matrix();
            if ($s2 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f64($s1, $s2);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_alignat(): mixed
    {
        $key = $this->peg_currPos * 124 + 21;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_alignat_spec();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_matrix();
            if ($s2 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f65($s1, $s2);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_matrix(): mixed
    {
        $key = $this->peg_currPos * 124 + 22;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_line_start();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_currPos;
            $s3 = $this->peg_parse_NEXT_ROW();
            if ($s3 !== $this->peg_FAILED) {
                $s4 = $this->peg_parse_matrix();
                if ($s4 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s2;
                    $s2 = $this->peg_f66($s1, $s3, $s4);
                } else {
                    $this->peg_currPos = $s2;
                    $s2 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s2;
                $s2 = $this->peg_FAILED;
            }
            if ($s2 === $this->peg_FAILED) {
                $s2 = null;
            }
            $this->peg_reportedPos = $s0;
            $s0 = $this->peg_f67($s1, $s2);
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_line_start(): mixed
    {
        $key = $this->peg_currPos * 124 + 23;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_HLINE();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_line_start();
            if ($s2 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f68($s1, $s2);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_parse_line();
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_line(): mixed
    {
        $key = $this->peg_currPos * 124 + 24;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_expr();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_currPos;
            $s3 = $this->peg_parse_NEXT_CELL();
            if ($s3 !== $this->peg_FAILED) {
                $s4 = $this->peg_parse_line();
                if ($s4 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s2;
                    $s2 = $this->peg_f69($s1, $s4);
                } else {
                    $this->peg_currPos = $s2;
                    $s2 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s2;
                $s2 = $this->peg_FAILED;
            }
            if ($s2 === $this->peg_FAILED) {
                $s2 = null;
            }
            $this->peg_reportedPos = $s0;
            $s0 = $this->peg_f70($s1, $s2);
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_column_spec(): mixed
    {
        $key = $this->peg_currPos * 124 + 25;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_CURLY_OPEN();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_currPos;
            $s3 = [];
            $s4 = $this->peg_parse_one_col();
            if ($s4 !== $this->peg_FAILED) {
                while ($s4 !== $this->peg_FAILED) {
                    $s3[] = $s4;
                    $s4 = $this->peg_parse_one_col();
                }
            } else {
                $s3 = $this->peg_FAILED;
            }
            if ($s3 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s2;
                $s3 = $this->peg_f71();
            }
            $s2 = $s3;
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse_CURLY_CLOSE();
                if ($s3 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f72($s2);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_one_col(): mixed
    {
        $key = $this->peg_currPos * 124 + 26;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->input_substr($this->peg_currPos, 1);
        if (\preg_match($this->peg_c2, $s1)) {
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e5);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s1 = [$s1, $s2];
            $s0 = $s1;
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l3) {
                $s1 = $this->peg_l3;
                $this->peg_currPos++;
            } else {
                $s1 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e6);
                }
            }
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->peg_parse_CURLY_OPEN();
                if ($s2 !== $this->peg_FAILED) {
                    $s3 = [];
                    $s4 = $this->peg_parse_boxchars();
                    if ($s4 !== $this->peg_FAILED) {
                        while ($s4 !== $this->peg_FAILED) {
                            $s3[] = $s4;
                            $s4 = $this->peg_parse_boxchars();
                        }
                    } else {
                        $s3 = $this->peg_FAILED;
                    }
                    if ($s3 !== $this->peg_FAILED) {
                        $s4 = $this->peg_parse_CURLY_CLOSE();
                        if ($s4 !== $this->peg_FAILED) {
                            $s1 = [$s1, $s2, $s3, $s4];
                            $s0 = $s1;
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
            if ($s0 === $this->peg_FAILED) {
                $s0 = $this->peg_currPos;
                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l4) {
                    $s1 = $this->peg_l4;
                    $this->peg_currPos++;
                } else {
                    $s1 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e7);
                    }
                }
                if ($s1 !== $this->peg_FAILED) {
                    $s2 = $this->peg_parse_CURLY_OPEN();
                    if ($s2 !== $this->peg_FAILED) {
                        $s3 = [];
                        $s4 = $this->input_substr($this->peg_currPos, 1);
                        if (\preg_match($this->peg_c3, $s4)) {
                            $this->peg_currPos++;
                        } else {
                            $s4 = $this->peg_FAILED;
                            if ($this->peg_silentFails === 0) {
                                $this->peg_fail($this->peg_e8);
                            }
                        }
                        if ($s4 !== $this->peg_FAILED) {
                            while ($s4 !== $this->peg_FAILED) {
                                $s3[] = $s4;
                                $s4 = $this->input_substr($this->peg_currPos, 1);
                                if (\preg_match($this->peg_c3, $s4)) {
                                    $this->peg_currPos++;
                                } else {
                                    $s4 = $this->peg_FAILED;
                                    if ($this->peg_silentFails === 0) {
                                        $this->peg_fail($this->peg_e8);
                                    }
                                }
                            }
                        } else {
                            $s3 = $this->peg_FAILED;
                        }
                        if ($s3 !== $this->peg_FAILED) {
                            $s4 = $this->peg_parse__();
                            $s5 = $this->peg_parse_CURLY_CLOSE();
                            if ($s5 !== $this->peg_FAILED) {
                                $s6 = $this->peg_parse_one_col();
                                if ($s6 === $this->peg_FAILED) {
                                    $s6 = $this->peg_currPos;
                                    $s7 = $this->peg_parse_CURLY_OPEN();
                                    if ($s7 !== $this->peg_FAILED) {
                                        $s8 = [];
                                        $s9 = $this->peg_parse_one_col();
                                        if ($s9 !== $this->peg_FAILED) {
                                            while ($s9 !== $this->peg_FAILED) {
                                                $s8[] = $s9;
                                                $s9 = $this->peg_parse_one_col();
                                            }
                                        } else {
                                            $s8 = $this->peg_FAILED;
                                        }
                                        if ($s8 !== $this->peg_FAILED) {
                                            $s9 = $this->peg_parse_CURLY_CLOSE();
                                            if ($s9 !== $this->peg_FAILED) {
                                                $s7 = [$s7, $s8, $s9];
                                                $s6 = $s7;
                                            } else {
                                                $this->peg_currPos = $s6;
                                                $s6 = $this->peg_FAILED;
                                            }
                                        } else {
                                            $this->peg_currPos = $s6;
                                            $s6 = $this->peg_FAILED;
                                        }
                                    } else {
                                        $this->peg_currPos = $s6;
                                        $s6 = $this->peg_FAILED;
                                    }
                                }
                                if ($s6 !== $this->peg_FAILED) {
                                    $s1 = [$s1, $s2, $s3, $s4, $s5, $s6];
                                    $s0 = $s1;
                                } else {
                                    $this->peg_currPos = $s0;
                                    $s0 = $this->peg_FAILED;
                                }
                            } else {
                                $this->peg_currPos = $s0;
                                $s0 = $this->peg_FAILED;
                            }
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
                if ($s0 === $this->peg_FAILED) {
                    $s0 = $this->peg_currPos;
                    if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l5) {
                        $s1 = $this->peg_l5;
                        $this->peg_currPos += 2;
                    } else {
                        $s1 = $this->peg_FAILED;
                        if ($this->peg_silentFails === 0) {
                            $this->peg_fail($this->peg_e9);
                        }
                    }
                    if ($s1 !== $this->peg_FAILED) {
                        $s2 = $this->peg_parse__();
                        $s1 = [$s1, $s2];
                        $s0 = $s1;
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                    if ($s0 === $this->peg_FAILED) {
                        $s0 = $this->peg_currPos;
                        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l6) {
                            $s1 = $this->peg_l6;
                            $this->peg_currPos++;
                        } else {
                            $s1 = $this->peg_FAILED;
                            if ($this->peg_silentFails === 0) {
                                $this->peg_fail($this->peg_e10);
                            }
                        }
                        if ($s1 !== $this->peg_FAILED) {
                            $s2 = $this->peg_parse__();
                            $s1 = [$s1, $s2];
                            $s0 = $s1;
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                        if ($s0 === $this->peg_FAILED) {
                            $s0 = $this->peg_currPos;
                            if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l7) {
                                $s1 = $this->peg_l7;
                                $this->peg_currPos++;
                            } else {
                                $s1 = $this->peg_FAILED;
                                if ($this->peg_silentFails === 0) {
                                    $this->peg_fail($this->peg_e11);
                                }
                            }
                            if ($s1 !== $this->peg_FAILED) {
                                $s2 = $this->peg_parse__();
                                $s3 = $this->peg_parse_CURLY_OPEN();
                                if ($s3 !== $this->peg_FAILED) {
                                    $s4 = [];
                                    $s5 = $this->peg_parse_boxchars();
                                    if ($s5 !== $this->peg_FAILED) {
                                        while ($s5 !== $this->peg_FAILED) {
                                            $s4[] = $s5;
                                            $s5 = $this->peg_parse_boxchars();
                                        }
                                    } else {
                                        $s4 = $this->peg_FAILED;
                                    }
                                    if ($s4 !== $this->peg_FAILED) {
                                        $s5 = $this->peg_parse_CURLY_CLOSE();
                                        if ($s5 !== $this->peg_FAILED) {
                                            $s1 = [$s1, $s2, $s3, $s4, $s5];
                                            $s0 = $s1;
                                        } else {
                                            $this->peg_currPos = $s0;
                                            $s0 = $this->peg_FAILED;
                                        }
                                    } else {
                                        $this->peg_currPos = $s0;
                                        $s0 = $this->peg_FAILED;
                                    }
                                } else {
                                    $this->peg_currPos = $s0;
                                    $s0 = $this->peg_FAILED;
                                }
                            } else {
                                $this->peg_currPos = $s0;
                                $s0 = $this->peg_FAILED;
                            }
                        }
                    }
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_alignat_spec(): mixed
    {
        $key = $this->peg_currPos * 124 + 27;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_CURLY_OPEN();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_currPos;
            $s3 = [];
            $s4 = $this->input_substr($this->peg_currPos, 1);
            if (\preg_match($this->peg_c3, $s4)) {
                $this->peg_currPos++;
            } else {
                $s4 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e8);
                }
            }
            if ($s4 !== $this->peg_FAILED) {
                while ($s4 !== $this->peg_FAILED) {
                    $s3[] = $s4;
                    $s4 = $this->input_substr($this->peg_currPos, 1);
                    if (\preg_match($this->peg_c3, $s4)) {
                        $this->peg_currPos++;
                    } else {
                        $s4 = $this->peg_FAILED;
                        if ($this->peg_silentFails === 0) {
                            $this->peg_fail($this->peg_e8);
                        }
                    }
                }
            } else {
                $s3 = $this->peg_FAILED;
            }
            if ($s3 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s2;
                $s3 = $this->peg_f73();
            }
            $s2 = $s3;
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s4 = $this->peg_parse_CURLY_CLOSE();
                if ($s4 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f74($s2);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_opt_pos(): mixed
    {
        $key = $this->peg_currPos * 124 + 28;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l8) {
            $s1 = $this->peg_l8;
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e12);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s3 = $this->input_substr($this->peg_currPos, 1);
            if (\preg_match($this->peg_c4, $s3)) {
                $this->peg_currPos++;
            } else {
                $s3 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e13);
                }
            }
            if ($s3 !== $this->peg_FAILED) {
                $s4 = $this->peg_parse__();
                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l9) {
                    $s5 = $this->peg_l9;
                    $this->peg_currPos++;
                } else {
                    $s5 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e14);
                    }
                }
                if ($s5 !== $this->peg_FAILED) {
                    $s6 = $this->peg_parse__();
                    $s1 = [$s1, $s2, $s3, $s4, $s5, $s6];
                    $s0 = $s1;
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = "";
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_chem_lit(): mixed
    {
        $key = $this->peg_currPos * 124 + 29;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_CURLY_OPEN();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_chem_sentence();
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse_CURLY_CLOSE();
                if ($s3 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f75($s2);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_chem_sentence(): mixed
    {
        $key = $this->peg_currPos * 124 + 30;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse__();
        $s2 = $this->peg_parse_chem_phrase();
        if ($s2 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l10) {
                $s3 = $this->peg_l10;
                $this->peg_currPos++;
            } else {
                $s3 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e15);
                }
            }
            if ($s3 !== $this->peg_FAILED) {
                $s4 = $this->peg_parse_chem_sentence();
                if ($s4 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f76($s2, $s4);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_parse__();
            $s2 = $this->peg_parse_chem_phrase();
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f77($s2);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_chem_phrase(): mixed
    {
        $key = $this->peg_currPos * 124 + 31;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 3) === $this->peg_l11) {
            $s1 = $this->peg_l11;
            $this->peg_currPos += 3;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e16);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $s0;
            $s1 = $this->peg_f78($s1);
        }
        $s0 = $s1;
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_parse_chem_word();
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->peg_parse_CHEM_SINGLE_MACRO();
                if ($s2 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f79($s1, $s2);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
            if ($s0 === $this->peg_FAILED) {
                $s0 = $this->peg_currPos;
                $s1 = $this->peg_parse_chem_word();
                if ($s1 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s1 = $this->peg_f80($s1);
                }
                $s0 = $s1;
                if ($s0 === $this->peg_FAILED) {
                    $s0 = $this->peg_currPos;
                    $s1 = $this->peg_parse_CHEM_SINGLE_MACRO();
                    if ($s1 !== $this->peg_FAILED) {
                        $this->peg_reportedPos = $s0;
                        $s1 = $this->peg_f81($s1);
                    }
                    $s0 = $s1;
                    if ($s0 === $this->peg_FAILED) {
                        $s0 = $this->peg_currPos;
                        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l12) {
                            $s1 = $this->peg_l12;
                            $this->peg_currPos++;
                        } else {
                            $s1 = $this->peg_FAILED;
                            if ($this->peg_silentFails === 0) {
                                $this->peg_fail($this->peg_e17);
                            }
                        }
                        if ($s1 !== $this->peg_FAILED) {
                            $this->peg_reportedPos = $s0;
                            $s1 = $this->peg_f82($s1);
                        }
                        $s0 = $s1;
                    }
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_chem_word(): mixed
    {
        $key = $this->peg_currPos * 124 + 32;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_chem_char();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_chem_word_nt();
            if ($s2 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f83($s1, $s2);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_parse_CHEM_SINGLE_MACRO();
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->peg_parse_chem_char_nl();
                if ($s2 !== $this->peg_FAILED) {
                    $s3 = $this->peg_parse_chem_word_nt();
                    if ($s3 !== $this->peg_FAILED) {
                        $this->peg_reportedPos = $s0;
                        $s0 = $this->peg_f84($s1, $s2, $s3);
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_chem_word_nt(): mixed
    {
        $key = $this->peg_currPos * 124 + 33;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_chem_word();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $s0;
            $s1 = $this->peg_f85($s1);
        }
        $s0 = $s1;
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = "";
            $this->peg_reportedPos = $s0;
            $s1 = $this->peg_f86();
            $s0 = $s1;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_chem_char(): mixed
    {
        $key = $this->peg_currPos * 124 + 34;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_chem_char_nl();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $s0;
            $s1 = $this->peg_f87($s1);
        }
        $s0 = $s1;
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_parse_CHEM_LETTER();
            if ($s1 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s1 = $this->peg_f88($s1);
            }
            $s0 = $s1;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_chem_char_nl(): mixed
    {
        $key = $this->peg_currPos * 124 + 35;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_chem_script();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $s0;
            $s1 = $this->peg_f89($s1);
        }
        $s0 = $s1;
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_parse_CURLY_OPEN();
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->peg_parse_chem_text();
                if ($s2 !== $this->peg_FAILED) {
                    $s3 = $this->peg_parse_CURLY_CLOSE();
                    if ($s3 !== $this->peg_FAILED) {
                        $this->peg_reportedPos = $s0;
                        $s0 = $this->peg_f90($s2);
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
            if ($s0 === $this->peg_FAILED) {
                $s0 = $this->peg_currPos;
                $s1 = $this->peg_parse_BEGIN_MATH();
                if ($s1 !== $this->peg_FAILED) {
                    $s2 = $this->peg_parse_expr();
                    if ($s2 !== $this->peg_FAILED) {
                        $s3 = $this->peg_parse_END_MATH();
                        if ($s3 !== $this->peg_FAILED) {
                            $this->peg_reportedPos = $s0;
                            $s0 = $this->peg_f91($s2);
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
                if ($s0 === $this->peg_FAILED) {
                    $s0 = $this->peg_currPos;
                    $s1 = $this->peg_parse_CHEM_BONDI();
                    if ($s1 !== $this->peg_FAILED) {
                        $s2 = $this->peg_parse_chem_bond();
                        if ($s2 !== $this->peg_FAILED) {
                            $this->peg_reportedPos = $s0;
                            $s0 = $this->peg_f92($s1, $s2);
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                    if ($s0 === $this->peg_FAILED) {
                        $s0 = $this->peg_currPos;
                        $s1 = $this->peg_parse_chem_macro();
                        if ($s1 !== $this->peg_FAILED) {
                            $this->peg_reportedPos = $s0;
                            $s1 = $this->peg_f93($s1);
                        }
                        $s0 = $s1;
                        if ($s0 === $this->peg_FAILED) {
                            $s0 = $this->peg_currPos;
                            $s1 = $this->peg_parse_CHEM_NONLETTER();
                            if ($s1 !== $this->peg_FAILED) {
                                $this->peg_reportedPos = $s0;
                                $s1 = $this->peg_f94($s1);
                            }
                            $s0 = $s1;
                        }
                    }
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_chem_bond(): mixed
    {
        $key = $this->peg_currPos * 124 + 36;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_CURLY_OPEN();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_CHEM_BOND_TYPE();
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse_CURLY_CLOSE();
                if ($s3 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f95($s2);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_chem_script(): mixed
    {
        $key = $this->peg_currPos * 124 + 37;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_CHEM_SUPERSUB();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_CHEM_SCRIPT_FOLLOW();
            if ($s2 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f96($s1, $s2);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_parse_CHEM_SUPERSUB();
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->peg_parse_chem_lit();
                if ($s2 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f97($s1, $s2);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
            if ($s0 === $this->peg_FAILED) {
                $s0 = $this->peg_currPos;
                $s1 = $this->peg_parse_CHEM_SUPERSUB();
                if ($s1 !== $this->peg_FAILED) {
                    $s2 = $this->peg_parse_BEGIN_MATH();
                    if ($s2 !== $this->peg_FAILED) {
                        $s3 = $this->peg_parse_expr();
                        if ($s3 !== $this->peg_FAILED) {
                            $s4 = $this->peg_parse_END_MATH();
                            if ($s4 !== $this->peg_FAILED) {
                                $this->peg_reportedPos = $s0;
                                $s0 = $this->peg_f98($s1, $s3);
                            } else {
                                $this->peg_currPos = $s0;
                                $s0 = $this->peg_FAILED;
                            }
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_chem_macro(): mixed
    {
        $key = $this->peg_currPos * 124 + 38;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_CHEM_MACRO_2PU();
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse_chem_lit();
            if ($s2 !== $this->peg_FAILED) {
                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l13) {
                    $s3 = $this->peg_l13;
                    $this->peg_currPos++;
                } else {
                    $s3 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e18);
                    }
                }
                if ($s3 !== $this->peg_FAILED) {
                    $s4 = $this->peg_parse_chem_lit();
                    if ($s4 !== $this->peg_FAILED) {
                        $this->peg_reportedPos = $s0;
                        $s0 = $this->peg_f99($s1, $s2, $s4);
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_parse_CHEM_MACRO_2PC();
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->peg_parse_CHEM_COLOR();
                if ($s2 !== $this->peg_FAILED) {
                    $s3 = $this->peg_parse_chem_lit();
                    if ($s3 !== $this->peg_FAILED) {
                        $this->peg_reportedPos = $s0;
                        $s0 = $this->peg_f100($s1, $s2, $s3);
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
            if ($s0 === $this->peg_FAILED) {
                $s0 = $this->peg_currPos;
                $s1 = $this->peg_parse_CHEM_MACRO_2P();
                if ($s1 !== $this->peg_FAILED) {
                    $s2 = $this->peg_parse_chem_lit();
                    if ($s2 !== $this->peg_FAILED) {
                        $s3 = $this->peg_parse_chem_lit();
                        if ($s3 !== $this->peg_FAILED) {
                            $this->peg_reportedPos = $s0;
                            $s0 = $this->peg_f101($s1, $s2, $s3);
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
                if ($s0 === $this->peg_FAILED) {
                    $s0 = $this->peg_currPos;
                    $s1 = $this->peg_parse_CHEM_MACRO_1P();
                    if ($s1 !== $this->peg_FAILED) {
                        $s2 = $this->peg_parse_chem_lit();
                        if ($s2 !== $this->peg_FAILED) {
                            $this->peg_reportedPos = $s0;
                            $s0 = $this->peg_f102($s1, $s2);
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_chem_text(): mixed
    {
        $key = $this->peg_currPos * 124 + 39;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = [];
        $s2 = $this->peg_parse_boxchars();
        if ($s2 !== $this->peg_FAILED) {
            while ($s2 !== $this->peg_FAILED) {
                $s1[] = $s2;
                $s2 = $this->peg_parse_boxchars();
            }
        } else {
            $s1 = $this->peg_FAILED;
        }
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $s0;
            $s1 = $this->peg_f103($s1);
        }
        $s0 = $s1;

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CHEM_COLOR(): mixed
    {
        $key = $this->peg_currPos * 124 + 40;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l14) {
            $s1 = $this->peg_l14;
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e19);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s3 = [];
            $s4 = $this->peg_parse_alpha();
            if ($s4 !== $this->peg_FAILED) {
                while ($s4 !== $this->peg_FAILED) {
                    $s3[] = $s4;
                    $s4 = $this->peg_parse_alpha();
                }
            } else {
                $s3 = $this->peg_FAILED;
            }
            if ($s3 !== $this->peg_FAILED) {
                $s4 = $this->peg_parse__();
                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                    $s5 = $this->peg_l2;
                    $this->peg_currPos++;
                } else {
                    $s5 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e4);
                    }
                }
                if ($s5 !== $this->peg_FAILED) {
                    $s6 = $this->peg_parse__();
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f104($s3);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_alpha(): mixed
    {
        $key = $this->peg_currPos * 124 + 41;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->input_substr($this->peg_currPos, 1);
        if (\preg_match($this->peg_c5, $s0)) {
            $this->peg_currPos++;
        } else {
            $s0 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e20);
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_literal_mn(): mixed
    {
        $key = $this->peg_currPos * 124 + 42;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->input_substr($this->peg_currPos, 1);
        if (\preg_match($this->peg_c3, $s0)) {
            $this->peg_currPos++;
        } else {
            $s0 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e8);
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_boxchars(): mixed
    {
        $key = $this->peg_currPos * 124 + 43;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->input_substr($this->peg_currPos, 1);
        if (\preg_match($this->peg_c6, $s0)) {
            $this->peg_currPos++;
        } else {
            $s0 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e21);
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BOX(): mixed
    {
        $key = $this->peg_currPos * 124 + 44;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f105($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l14) {
                    $s4 = $this->peg_l14;
                    $this->peg_currPos++;
                } else {
                    $s4 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e19);
                    }
                }
                if ($s4 !== $this->peg_FAILED) {
                    $s5 = [];
                    $s6 = $this->peg_parse_boxchars();
                    if ($s6 !== $this->peg_FAILED) {
                        while ($s6 !== $this->peg_FAILED) {
                            $s5[] = $s6;
                            $s6 = $this->peg_parse_boxchars();
                        }
                    } else {
                        $s5 = $this->peg_FAILED;
                    }
                    if ($s5 !== $this->peg_FAILED) {
                        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                            $s6 = $this->peg_l2;
                            $this->peg_currPos++;
                        } else {
                            $s6 = $this->peg_FAILED;
                            if ($this->peg_silentFails === 0) {
                                $this->peg_fail($this->peg_e4);
                            }
                        }
                        if ($s6 !== $this->peg_FAILED) {
                            $s7 = $this->peg_parse__();
                            $this->peg_reportedPos = $s0;
                            $s0 = $this->peg_f106($s1, $s5);
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_LITERAL(): mixed
    {
        $key = $this->peg_currPos * 124 + 45;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l15) {
            $s1 = $this->peg_l15;
            $this->peg_currPos += 2;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e22);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $this->peg_reportedPos = $s0;
            $s0 = $this->peg_f107();
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->input_substr($this->peg_currPos, 1);
            if (\preg_match($this->peg_c7, $s1)) {
                $this->peg_currPos++;
            } else {
                $s1 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e23);
                }
            }
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f108($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
            if ($s0 === $this->peg_FAILED) {
                $s0 = $this->peg_currPos;
                $s1 = $this->peg_parse_generic_func();
                if ($s1 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $this->peg_currPos;
                    $s2 = $this->peg_f109($s1);
                    if ($s2) {
                        $s2 = null;
                    } else {
                        $s2 = $this->peg_FAILED;
                    }
                    if ($s2 !== $this->peg_FAILED) {
                        $s3 = $this->peg_parse__();
                        $this->peg_reportedPos = $s0;
                        $s0 = $this->peg_f110($s1);
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
                if ($s0 === $this->peg_FAILED) {
                    $s0 = $this->peg_currPos;
                    $s1 = $this->peg_parse_generic_func();
                    if ($s1 !== $this->peg_FAILED) {
                        $this->peg_reportedPos = $this->peg_currPos;
                        $s2 = $this->peg_f111($s1);
                        if ($s2) {
                            $s2 = null;
                        } else {
                            $s2 = $this->peg_FAILED;
                        }
                        if ($s2 !== $this->peg_FAILED) {
                            $s3 = $this->peg_parse__();
                            $this->peg_reportedPos = $s0;
                            $s0 = $this->peg_f112($s1);
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                    if ($s0 === $this->peg_FAILED) {
                        $s0 = $this->peg_currPos;
                        $s1 = $this->peg_parse_generic_func();
                        if ($s1 !== $this->peg_FAILED) {
                            $this->peg_reportedPos = $this->peg_currPos;
                            $s2 = $this->peg_f113($s1);
                            if ($s2) {
                                $s2 = null;
                            } else {
                                $s2 = $this->peg_FAILED;
                            }
                            if ($s2 !== $this->peg_FAILED) {
                                $s3 = $this->peg_parse__();
                                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l14) {
                                    $s4 = $this->peg_l14;
                                    $this->peg_currPos++;
                                } else {
                                    $s4 = $this->peg_FAILED;
                                    if ($this->peg_silentFails === 0) {
                                        $this->peg_fail($this->peg_e19);
                                    }
                                }
                                if ($s4 !== $this->peg_FAILED) {
                                    $s5 = $this->peg_parse_generic_func();
                                    if ($s5 !== $this->peg_FAILED) {
                                        $this->peg_reportedPos = $this->peg_currPos;
                                        $s6 = $this->peg_f114($s1, $s5);
                                        if ($s6) {
                                            $s6 = null;
                                        } else {
                                            $s6 = $this->peg_FAILED;
                                        }
                                        if ($s6 !== $this->peg_FAILED) {
                                            $s7 = $this->peg_parse__();
                                            if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                                                $s8 = $this->peg_l2;
                                                $this->peg_currPos++;
                                            } else {
                                                $s8 = $this->peg_FAILED;
                                                if ($this->peg_silentFails === 0) {
                                                    $this->peg_fail($this->peg_e4);
                                                }
                                            }
                                            if ($s8 !== $this->peg_FAILED) {
                                                $s9 = $this->peg_parse__();
                                                $this->peg_reportedPos = $s0;
                                                $s0 = $this->peg_f115($s1, $s5);
                                            } else {
                                                $this->peg_currPos = $s0;
                                                $s0 = $this->peg_FAILED;
                                            }
                                        } else {
                                            $this->peg_currPos = $s0;
                                            $s0 = $this->peg_FAILED;
                                        }
                                    } else {
                                        $this->peg_currPos = $s0;
                                        $s0 = $this->peg_FAILED;
                                    }
                                } else {
                                    $this->peg_currPos = $s0;
                                    $s0 = $this->peg_FAILED;
                                }
                            } else {
                                $this->peg_currPos = $s0;
                                $s0 = $this->peg_FAILED;
                            }
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                        if ($s0 === $this->peg_FAILED) {
                            $s0 = $this->peg_currPos;
                            $s1 = $this->peg_parse_generic_func();
                            if ($s1 !== $this->peg_FAILED) {
                                $this->peg_reportedPos = $this->peg_currPos;
                                $s2 = $this->peg_f116($s1);
                                if ($s2) {
                                    $s2 = null;
                                } else {
                                    $s2 = $this->peg_FAILED;
                                }
                                if ($s2 !== $this->peg_FAILED) {
                                    $s3 = $this->peg_parse__();
                                    $this->peg_reportedPos = $s0;
                                    $s0 = $this->peg_f117($s1);
                                } else {
                                    $this->peg_currPos = $s0;
                                    $s0 = $this->peg_FAILED;
                                }
                            } else {
                                $this->peg_currPos = $s0;
                                $s0 = $this->peg_FAILED;
                            }
                            if ($s0 === $this->peg_FAILED) {
                                $s0 = $this->peg_currPos;
                                $s1 = $this->peg_parse_generic_func();
                                if ($s1 !== $this->peg_FAILED) {
                                    $this->peg_reportedPos = $this->peg_currPos;
                                    $s2 = $this->peg_f118($s1);
                                    if ($s2) {
                                        $s2 = null;
                                    } else {
                                        $s2 = $this->peg_FAILED;
                                    }
                                    if ($s2 !== $this->peg_FAILED) {
                                        $s3 = $this->peg_parse__();
                                        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l14) {
                                            $s4 = $this->peg_l14;
                                            $this->peg_currPos++;
                                        } else {
                                            $s4 = $this->peg_FAILED;
                                            if ($this->peg_silentFails === 0) {
                                                $this->peg_fail($this->peg_e19);
                                            }
                                        }
                                        if ($s4 !== $this->peg_FAILED) {
                                            $s5 = $this->peg_parse_generic_func();
                                            if ($s5 !== $this->peg_FAILED) {
                                                $this->peg_reportedPos = $this->peg_currPos;
                                                $s6 = $this->peg_f119($s1, $s5);
                                                if ($s6) {
                                                    $s6 = null;
                                                } else {
                                                    $s6 = $this->peg_FAILED;
                                                }
                                                if ($s6 !== $this->peg_FAILED) {
                                                    $s7 = $this->peg_parse__();
                                                    if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                                                        $s8 = $this->peg_l2;
                                                        $this->peg_currPos++;
                                                    } else {
                                                        $s8 = $this->peg_FAILED;
                                                        if ($this->peg_silentFails === 0) {
                                                            $this->peg_fail($this->peg_e4);
                                                        }
                                                    }
                                                    if ($s8 !== $this->peg_FAILED) {
                                                        $s9 = $this->peg_parse__();
                                                        $this->peg_reportedPos = $s0;
                                                        $s0 = $this->peg_f120($s1, $s5);
                                                    } else {
                                                        $this->peg_currPos = $s0;
                                                        $s0 = $this->peg_FAILED;
                                                    }
                                                } else {
                                                    $this->peg_currPos = $s0;
                                                    $s0 = $this->peg_FAILED;
                                                }
                                            } else {
                                                $this->peg_currPos = $s0;
                                                $s0 = $this->peg_FAILED;
                                            }
                                        } else {
                                            $this->peg_currPos = $s0;
                                            $s0 = $this->peg_FAILED;
                                        }
                                    } else {
                                        $this->peg_currPos = $s0;
                                        $s0 = $this->peg_FAILED;
                                    }
                                } else {
                                    $this->peg_currPos = $s0;
                                    $s0 = $this->peg_FAILED;
                                }
                                if ($s0 === $this->peg_FAILED) {
                                    $s0 = $this->peg_currPos;
                                    $s1 = $this->peg_parse_COLOR();
                                    if ($s1 === $this->peg_FAILED) {
                                        $s1 = $this->peg_parse_DEFINECOLOR();
                                    }
                                    if ($s1 !== $this->peg_FAILED) {
                                        $this->peg_reportedPos = $s0;
                                        $s1 = $this->peg_f121($s1);
                                    }
                                    $s0 = $s1;
                                    if ($s0 === $this->peg_FAILED) {
                                        $s0 = $this->peg_currPos;
                                        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l16) {
                                            $s1 = $this->peg_l16;
                                            $this->peg_currPos++;
                                        } else {
                                            $s1 = $this->peg_FAILED;
                                            if ($this->peg_silentFails === 0) {
                                                $this->peg_fail($this->peg_e24);
                                            }
                                        }
                                        if ($s1 !== $this->peg_FAILED) {
                                            $s2 = $this->input_substr($this->peg_currPos, 1);
                                            if (\preg_match($this->peg_c8, $s2)) {
                                                $this->peg_currPos++;
                                            } else {
                                                $s2 = $this->peg_FAILED;
                                                if ($this->peg_silentFails === 0) {
                                                    $this->peg_fail($this->peg_e25);
                                                }
                                            }
                                            if ($s2 !== $this->peg_FAILED) {
                                                $s3 = $this->peg_parse__();
                                                $this->peg_reportedPos = $s0;
                                                $s0 = $this->peg_f122($s2);
                                            } else {
                                                $this->peg_currPos = $s0;
                                                $s0 = $this->peg_FAILED;
                                            }
                                        } else {
                                            $this->peg_currPos = $s0;
                                            $s0 = $this->peg_FAILED;
                                        }
                                        if ($s0 === $this->peg_FAILED) {
                                            $s0 = $this->peg_currPos;
                                            $s1 = $this->input_substr($this->peg_currPos, 1);
                                            if (\preg_match($this->peg_c9, $s1)) {
                                                $this->peg_currPos++;
                                            } else {
                                                $s1 = $this->peg_FAILED;
                                                if ($this->peg_silentFails === 0) {
                                                    $this->peg_fail($this->peg_e26);
                                                }
                                            }
                                            if ($s1 !== $this->peg_FAILED) {
                                                $s2 = $this->peg_parse__();
                                                $this->peg_reportedPos = $s0;
                                                $s0 = $this->peg_f123($s1);
                                            } else {
                                                $this->peg_currPos = $s0;
                                                $s0 = $this->peg_FAILED;
                                            }
                                            if ($s0 === $this->peg_FAILED) {
                                                $s0 = $this->peg_currPos;
                                                $s1 = $this->input_substr($this->peg_currPos, 1);
                                                if (\preg_match($this->peg_c10, $s1)) {
                                                    $this->peg_currPos++;
                                                } else {
                                                    $s1 = $this->peg_FAILED;
                                                    if ($this->peg_silentFails === 0) {
                                                        $this->peg_fail($this->peg_e27);
                                                    }
                                                }
                                                if ($s1 !== $this->peg_FAILED) {
                                                    $s2 = $this->peg_parse__();
                                                    $this->peg_reportedPos = $s0;
                                                    $s0 = $this->peg_f124($s1);
                                                } else {
                                                    $this->peg_currPos = $s0;
                                                    $s0 = $this->peg_FAILED;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_DELIMITER(): mixed
    {
        $key = $this->peg_currPos * 124 + 46;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->input_substr($this->peg_currPos, 1);
        if (\preg_match($this->peg_c11, $s1)) {
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e28);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $this->peg_reportedPos = $s0;
            $s0 = $this->peg_f125($s1);
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l16) {
                $s1 = $this->peg_l16;
                $this->peg_currPos++;
            } else {
                $s1 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e24);
                }
            }
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->input_substr($this->peg_currPos, 1);
                if (\preg_match($this->peg_c12, $s2)) {
                    $this->peg_currPos++;
                } else {
                    $s2 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e29);
                    }
                }
                if ($s2 !== $this->peg_FAILED) {
                    $s3 = $this->peg_parse__();
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f126($s2);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
            if ($s0 === $this->peg_FAILED) {
                $s0 = $this->peg_currPos;
                $s1 = $this->peg_parse_generic_func();
                if ($s1 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $this->peg_currPos;
                    $s2 = $this->peg_f127($s1);
                    if ($s2) {
                        $s2 = null;
                    } else {
                        $s2 = $this->peg_FAILED;
                    }
                    if ($s2 !== $this->peg_FAILED) {
                        $s3 = $this->peg_parse__();
                        $this->peg_reportedPos = $s0;
                        $s0 = $this->peg_f128($s1);
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
                if ($s0 === $this->peg_FAILED) {
                    $s0 = $this->peg_currPos;
                    $s1 = $this->peg_parse_generic_func();
                    if ($s1 !== $this->peg_FAILED) {
                        $this->peg_reportedPos = $this->peg_currPos;
                        $s2 = $this->peg_f129($s1);
                        if ($s2) {
                            $s2 = null;
                        } else {
                            $s2 = $this->peg_FAILED;
                        }
                        if ($s2 !== $this->peg_FAILED) {
                            $s3 = $this->peg_parse__();
                            $this->peg_reportedPos = $s0;
                            $s0 = $this->peg_f130($s1);
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_FUN_AR1nb(): mixed
    {
        $key = $this->peg_currPos * 124 + 47;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f131($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f132($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_FUN_AR1opt(): mixed
    {
        $key = $this->peg_currPos * 124 + 48;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f133($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l8) {
                    $s4 = $this->peg_l8;
                    $this->peg_currPos++;
                } else {
                    $s4 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e12);
                    }
                }
                if ($s4 !== $this->peg_FAILED) {
                    $s5 = $this->peg_parse__();
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f134($s1);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_NEXT_CELL(): mixed
    {
        $key = $this->peg_currPos * 124 + 49;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l17) {
            $s1 = $this->peg_l17;
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e30);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s1 = [$s1, $s2];
            $s0 = $s1;
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_LATEX_LENGTH(): mixed
    {
        $key = $this->peg_currPos * 124 + 50;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_LATEX_SIGN();
        if ($s1 === $this->peg_FAILED) {
            $s1 = null;
        }
        $s2 = $this->peg_parse_LATEX_NUMBER();
        if ($s2 !== $this->peg_FAILED) {
            $s3 = $this->peg_parse_LATEX_UNIT();
            if ($s3 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f135($s1, $s2, $s3);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_LATEX_SIGN(): mixed
    {
        $key = $this->peg_currPos * 124 + 51;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->input_substr($this->peg_currPos, 1);
        if (\preg_match($this->peg_c13, $s0)) {
            $this->peg_currPos++;
        } else {
            $s0 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e31);
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_LATEX_NUMBER(): mixed
    {
        $key = $this->peg_currPos * 124 + 52;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = [];
        $s2 = $this->peg_parse_literal_mn();
        if ($s2 !== $this->peg_FAILED) {
            while ($s2 !== $this->peg_FAILED) {
                $s1[] = $s2;
                $s2 = $this->peg_parse_literal_mn();
            }
        } else {
            $s1 = $this->peg_FAILED;
        }
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l18) {
                $s2 = $this->peg_l18;
                $this->peg_currPos++;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e32);
                }
            }
            if ($s2 === $this->peg_FAILED) {
                $s2 = null;
            }
            $s3 = [];
            $s4 = $this->peg_parse_literal_mn();
            while ($s4 !== $this->peg_FAILED) {
                $s3[] = $s4;
                $s4 = $this->peg_parse_literal_mn();
            }
            $s1 = [$s1, $s2, $s3];
            $s0 = $s1;
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l18) {
                $s1 = $this->peg_l18;
                $this->peg_currPos++;
            } else {
                $s1 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e32);
                }
            }
            if ($s1 !== $this->peg_FAILED) {
                $s2 = [];
                $s3 = $this->peg_parse_literal_mn();
                if ($s3 !== $this->peg_FAILED) {
                    while ($s3 !== $this->peg_FAILED) {
                        $s2[] = $s3;
                        $s3 = $this->peg_parse_literal_mn();
                    }
                } else {
                    $s2 = $this->peg_FAILED;
                }
                if ($s2 !== $this->peg_FAILED) {
                    $s1 = [$s1, $s2];
                    $s0 = $s1;
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_LATEX_UNIT(): mixed
    {
        $key = $this->peg_currPos * 124 + 53;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l19) {
            $s0 = $this->peg_l19;
            $this->peg_currPos += 2;
        } else {
            $s0 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e33);
            }
        }
        if ($s0 === $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l20) {
                $s0 = $this->peg_l20;
                $this->peg_currPos += 2;
            } else {
                $s0 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e34);
                }
            }
            if ($s0 === $this->peg_FAILED) {
                if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l21) {
                    $s0 = $this->peg_l21;
                    $this->peg_currPos += 2;
                } else {
                    $s0 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e35);
                    }
                }
                if ($s0 === $this->peg_FAILED) {
                    if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l22) {
                        $s0 = $this->peg_l22;
                        $this->peg_currPos += 2;
                    } else {
                        $s0 = $this->peg_FAILED;
                        if ($this->peg_silentFails === 0) {
                            $this->peg_fail($this->peg_e36);
                        }
                    }
                    if ($s0 === $this->peg_FAILED) {
                        if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l23) {
                            $s0 = $this->peg_l23;
                            $this->peg_currPos += 2;
                        } else {
                            $s0 = $this->peg_FAILED;
                            if ($this->peg_silentFails === 0) {
                                $this->peg_fail($this->peg_e37);
                            }
                        }
                        if ($s0 === $this->peg_FAILED) {
                            if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l24) {
                                $s0 = $this->peg_l24;
                                $this->peg_currPos += 2;
                            } else {
                                $s0 = $this->peg_FAILED;
                                if ($this->peg_silentFails === 0) {
                                    $this->peg_fail($this->peg_e38);
                                }
                            }
                            if ($s0 === $this->peg_FAILED) {
                                if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l25) {
                                    $s0 = $this->peg_l25;
                                    $this->peg_currPos += 2;
                                } else {
                                    $s0 = $this->peg_FAILED;
                                    if ($this->peg_silentFails === 0) {
                                        $this->peg_fail($this->peg_e39);
                                    }
                                }
                                if ($s0 === $this->peg_FAILED) {
                                    if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l26) {
                                        $s0 = $this->peg_l26;
                                        $this->peg_currPos += 2;
                                    } else {
                                        $s0 = $this->peg_FAILED;
                                        if ($this->peg_silentFails === 0) {
                                            $this->peg_fail($this->peg_e40);
                                        }
                                    }
                                    if ($s0 === $this->peg_FAILED) {
                                        if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l27) {
                                            $s0 = $this->peg_l27;
                                            $this->peg_currPos += 2;
                                        } else {
                                            $s0 = $this->peg_FAILED;
                                            if ($this->peg_silentFails === 0) {
                                                $this->peg_fail($this->peg_e41);
                                            }
                                        }
                                        if ($s0 === $this->peg_FAILED) {
                                            if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l28) {
                                                $s0 = $this->peg_l28;
                                                $this->peg_currPos += 2;
                                            } else {
                                                $s0 = $this->peg_FAILED;
                                                if ($this->peg_silentFails === 0) {
                                                    $this->peg_fail($this->peg_e42);
                                                }
                                            }
                                            if ($s0 === $this->peg_FAILED) {
                                                if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l29) {
                                                    $s0 = $this->peg_l29;
                                                    $this->peg_currPos += 2;
                                                } else {
                                                    $s0 = $this->peg_FAILED;
                                                    if ($this->peg_silentFails === 0) {
                                                        $this->peg_fail($this->peg_e43);
                                                    }
                                                }
                                                if ($s0 === $this->peg_FAILED) {
                                                    if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l30) {
                                                        $s0 = $this->peg_l30;
                                                        $this->peg_currPos += 2;
                                                    } else {
                                                        $s0 = $this->peg_FAILED;
                                                        if ($this->peg_silentFails === 0) {
                                                            $this->peg_fail($this->peg_e44);
                                                        }
                                                    }
                                                    if ($s0 === $this->peg_FAILED) {
                                                        if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l31) {
                                                            $s0 = $this->peg_l31;
                                                            $this->peg_currPos += 2;
                                                        } else {
                                                            $s0 = $this->peg_FAILED;
                                                            if ($this->peg_silentFails === 0) {
                                                                $this->peg_fail($this->peg_e45);
                                                            }
                                                        }
                                                        if ($s0 === $this->peg_FAILED) {
                                                            if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l32) {
                                                                $s0 = $this->peg_l32;
                                                                $this->peg_currPos += 2;
                                                            } else {
                                                                $s0 = $this->peg_FAILED;
                                                                if ($this->peg_silentFails === 0) {
                                                                    $this->peg_fail($this->peg_e46);
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_NEXT_ROW(): mixed
    {
        $key = $this->peg_currPos * 124 + 54;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l33) {
            $s1 = $this->peg_l33;
            $this->peg_currPos += 2;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e47);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_currPos;
            if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l8) {
                $s3 = $this->peg_l8;
                $this->peg_currPos++;
            } else {
                $s3 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e12);
                }
            }
            if ($s3 !== $this->peg_FAILED) {
                $s4 = $this->peg_parse_LATEX_LENGTH();
                if ($s4 !== $this->peg_FAILED) {
                    if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l9) {
                        $s5 = $this->peg_l9;
                        $this->peg_currPos++;
                    } else {
                        $s5 = $this->peg_FAILED;
                        if ($this->peg_silentFails === 0) {
                            $this->peg_fail($this->peg_e14);
                        }
                    }
                    if ($s5 !== $this->peg_FAILED) {
                        $this->peg_reportedPos = $s2;
                        $s2 = $this->peg_f136($s4);
                    } else {
                        $this->peg_currPos = $s2;
                        $s2 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s2;
                    $s2 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s2;
                $s2 = $this->peg_FAILED;
            }
            if ($s2 === $this->peg_FAILED) {
                $s2 = null;
            }
            $s3 = $this->peg_parse__();
            $this->peg_reportedPos = $s0;
            $s0 = $this->peg_f137($s2);
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BEGIN(): mixed
    {
        $key = $this->peg_currPos * 124 + 55;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 6) === $this->peg_l34) {
            $s1 = $this->peg_l34;
            $this->peg_currPos += 6;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e48);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s1 = [$s1, $s2];
            $s0 = $s1;
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_END(): mixed
    {
        $key = $this->peg_currPos * 124 + 56;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 4) === $this->peg_l35) {
            $s1 = $this->peg_l35;
            $this->peg_currPos += 4;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e49);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s1 = [$s1, $s2];
            $s0 = $s1;
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BEGIN_MATRIX(): mixed
    {
        $key = $this->peg_currPos * 124 + 57;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_BEGIN();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 8) === $this->peg_l36) {
                $s2 = $this->peg_l36;
                $this->peg_currPos += 8;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e50);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_END_MATRIX(): mixed
    {
        $key = $this->peg_currPos * 124 + 58;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_END();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 8) === $this->peg_l36) {
                $s2 = $this->peg_l36;
                $this->peg_currPos += 8;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e50);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BEGIN_PMATRIX(): mixed
    {
        $key = $this->peg_currPos * 124 + 59;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_BEGIN();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 9) === $this->peg_l37) {
                $s2 = $this->peg_l37;
                $this->peg_currPos += 9;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e51);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_END_PMATRIX(): mixed
    {
        $key = $this->peg_currPos * 124 + 60;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_END();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 9) === $this->peg_l37) {
                $s2 = $this->peg_l37;
                $this->peg_currPos += 9;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e51);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BEGIN_BMATRIX(): mixed
    {
        $key = $this->peg_currPos * 124 + 61;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_BEGIN();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 9) === $this->peg_l38) {
                $s2 = $this->peg_l38;
                $this->peg_currPos += 9;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e52);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_END_BMATRIX(): mixed
    {
        $key = $this->peg_currPos * 124 + 62;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_END();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 9) === $this->peg_l38) {
                $s2 = $this->peg_l38;
                $this->peg_currPos += 9;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e52);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BEGIN_BBMATRIX(): mixed
    {
        $key = $this->peg_currPos * 124 + 63;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_BEGIN();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 9) === $this->peg_l39) {
                $s2 = $this->peg_l39;
                $this->peg_currPos += 9;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e53);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_END_BBMATRIX(): mixed
    {
        $key = $this->peg_currPos * 124 + 64;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_END();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 9) === $this->peg_l39) {
                $s2 = $this->peg_l39;
                $this->peg_currPos += 9;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e53);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BEGIN_VMATRIX(): mixed
    {
        $key = $this->peg_currPos * 124 + 65;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_BEGIN();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 9) === $this->peg_l40) {
                $s2 = $this->peg_l40;
                $this->peg_currPos += 9;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e54);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_END_VMATRIX(): mixed
    {
        $key = $this->peg_currPos * 124 + 66;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_END();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 9) === $this->peg_l40) {
                $s2 = $this->peg_l40;
                $this->peg_currPos += 9;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e54);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BEGIN_VVMATRIX(): mixed
    {
        $key = $this->peg_currPos * 124 + 67;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_BEGIN();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 9) === $this->peg_l41) {
                $s2 = $this->peg_l41;
                $this->peg_currPos += 9;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e55);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_END_VVMATRIX(): mixed
    {
        $key = $this->peg_currPos * 124 + 68;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_END();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 9) === $this->peg_l41) {
                $s2 = $this->peg_l41;
                $this->peg_currPos += 9;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e55);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BEGIN_ARRAY(): mixed
    {
        $key = $this->peg_currPos * 124 + 69;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_BEGIN();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 7) === $this->peg_l42) {
                $s2 = $this->peg_l42;
                $this->peg_currPos += 7;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e56);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_END_ARRAY(): mixed
    {
        $key = $this->peg_currPos * 124 + 70;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_END();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 7) === $this->peg_l42) {
                $s2 = $this->peg_l42;
                $this->peg_currPos += 7;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e56);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BEGIN_ALIGN(): mixed
    {
        $key = $this->peg_currPos * 124 + 71;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_BEGIN();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 7) === $this->peg_l43) {
                $s2 = $this->peg_l43;
                $this->peg_currPos += 7;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e57);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_END_ALIGN(): mixed
    {
        $key = $this->peg_currPos * 124 + 72;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_END();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 7) === $this->peg_l43) {
                $s2 = $this->peg_l43;
                $this->peg_currPos += 7;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e57);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BEGIN_ALIGNED(): mixed
    {
        $key = $this->peg_currPos * 124 + 73;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_BEGIN();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 9) === $this->peg_l44) {
                $s2 = $this->peg_l44;
                $this->peg_currPos += 9;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e58);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_END_ALIGNED(): mixed
    {
        $key = $this->peg_currPos * 124 + 74;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_END();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 9) === $this->peg_l44) {
                $s2 = $this->peg_l44;
                $this->peg_currPos += 9;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e58);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BEGIN_ALIGNAT(): mixed
    {
        $key = $this->peg_currPos * 124 + 75;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_BEGIN();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 9) === $this->peg_l45) {
                $s2 = $this->peg_l45;
                $this->peg_currPos += 9;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e59);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_END_ALIGNAT(): mixed
    {
        $key = $this->peg_currPos * 124 + 76;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_END();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 9) === $this->peg_l45) {
                $s2 = $this->peg_l45;
                $this->peg_currPos += 9;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e59);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BEGIN_ALIGNEDAT(): mixed
    {
        $key = $this->peg_currPos * 124 + 77;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_BEGIN();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 11) === $this->peg_l46) {
                $s2 = $this->peg_l46;
                $this->peg_currPos += 11;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e60);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_END_ALIGNEDAT(): mixed
    {
        $key = $this->peg_currPos * 124 + 78;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_END();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 11) === $this->peg_l46) {
                $s2 = $this->peg_l46;
                $this->peg_currPos += 11;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e60);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BEGIN_SMALLMATRIX(): mixed
    {
        $key = $this->peg_currPos * 124 + 79;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_BEGIN();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 13) === $this->peg_l47) {
                $s2 = $this->peg_l47;
                $this->peg_currPos += 13;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e61);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_END_SMALLMATRIX(): mixed
    {
        $key = $this->peg_currPos * 124 + 80;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_END();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 13) === $this->peg_l47) {
                $s2 = $this->peg_l47;
                $this->peg_currPos += 13;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e61);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BEGIN_CASES(): mixed
    {
        $key = $this->peg_currPos * 124 + 81;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_BEGIN();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 7) === $this->peg_l48) {
                $s2 = $this->peg_l48;
                $this->peg_currPos += 7;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e62);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_END_CASES(): mixed
    {
        $key = $this->peg_currPos * 124 + 82;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_END();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 7) === $this->peg_l48) {
                $s2 = $this->peg_l48;
                $this->peg_currPos += 7;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e62);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_SQ_CLOSE(): mixed
    {
        $key = $this->peg_currPos * 124 + 83;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l9) {
            $s1 = $this->peg_l9;
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e14);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s1 = [$s1, $s2];
            $s0 = $s1;
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CURLY_OPEN(): mixed
    {
        $key = $this->peg_currPos * 124 + 84;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l14) {
            $s1 = $this->peg_l14;
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e19);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s1 = [$s1, $s2];
            $s0 = $s1;
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CURLY_CLOSE(): mixed
    {
        $key = $this->peg_currPos * 124 + 85;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
            $s1 = $this->peg_l2;
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e4);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s1 = [$s1, $s2];
            $s0 = $s1;
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_SUP(): mixed
    {
        $key = $this->peg_currPos * 124 + 86;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l12) {
            $s1 = $this->peg_l12;
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e17);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s1 = [$s1, $s2];
            $s0 = $s1;
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_SUB(): mixed
    {
        $key = $this->peg_currPos * 124 + 87;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l13) {
            $s1 = $this->peg_l13;
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e18);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s1 = [$s1, $s2];
            $s0 = $s1;
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_generic_func(): mixed
    {
        $key = $this->peg_currPos * 124 + 88;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l16) {
            $s1 = $this->peg_l16;
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e24);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = [];
            $s3 = $this->peg_parse_alpha();
            if ($s3 !== $this->peg_FAILED) {
                while ($s3 !== $this->peg_FAILED) {
                    $s2[] = $s3;
                    $s3 = $this->peg_parse_alpha();
                }
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f138();
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BIG(): mixed
    {
        $key = $this->peg_currPos * 124 + 89;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f139($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f140($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_FUN_AR1(): mixed
    {
        $key = $this->peg_currPos * 124 + 90;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f141($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f142($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_parse_generic_func();
            if ($s1 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $this->peg_currPos;
                $s2 = $this->peg_f143($s1);
                if ($s2) {
                    $s2 = null;
                } else {
                    $s2 = $this->peg_FAILED;
                }
                if ($s2 !== $this->peg_FAILED) {
                    $s3 = $this->peg_parse__();
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f144($s1);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
            if ($s0 === $this->peg_FAILED) {
                $s0 = $this->peg_currPos;
                $s1 = $this->peg_parse_generic_func();
                if ($s1 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $this->peg_currPos;
                    $s2 = $this->peg_f145($s1);
                    if ($s2) {
                        $s2 = null;
                    } else {
                        $s2 = $this->peg_FAILED;
                    }
                    if ($s2 !== $this->peg_FAILED) {
                        $s3 = $this->peg_parse__();
                        $this->peg_reportedPos = $s0;
                        $s0 = $this->peg_f146($s1);
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_FUN_MHCHEM(): mixed
    {
        $key = $this->peg_currPos * 124 + 91;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f147($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f148($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_FUN_AR2(): mixed
    {
        $key = $this->peg_currPos * 124 + 92;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f149($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f150($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_FUN_AR4_MHCHEM_TEXIFIED(): mixed
    {
        $key = $this->peg_currPos * 124 + 93;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f151($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f152($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_FUN_INFIX(): mixed
    {
        $key = $this->peg_currPos * 124 + 94;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f153($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f154($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_DECLh(): mixed
    {
        $key = $this->peg_currPos * 124 + 95;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f155($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f156($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_FUN_AR2nb(): mixed
    {
        $key = $this->peg_currPos * 124 + 96;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f157($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f158($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_LEFTI(): mixed
    {
        $key = $this->peg_currPos * 124 + 97;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f159($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_RIGHTI(): mixed
    {
        $key = $this->peg_currPos * 124 + 98;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f160($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_HLINE(): mixed
    {
        $key = $this->peg_currPos * 124 + 99;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f161($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f162($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_COLOR(): mixed
    {
        $key = $this->peg_currPos * 124 + 100;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f163($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s4 = $this->peg_parse_COLOR_SPEC();
                if ($s4 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f164($s1, $s4);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_DEFINECOLOR(): mixed
    {
        $key = $this->peg_currPos * 124 + 101;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f165($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l14) {
                    $s4 = $this->peg_l14;
                    $this->peg_currPos++;
                } else {
                    $s4 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e19);
                    }
                }
                if ($s4 !== $this->peg_FAILED) {
                    $s5 = $this->peg_parse__();
                    $s6 = [];
                    $s7 = $this->peg_parse_alpha();
                    if ($s7 !== $this->peg_FAILED) {
                        while ($s7 !== $this->peg_FAILED) {
                            $s6[] = $s7;
                            $s7 = $this->peg_parse_alpha();
                        }
                    } else {
                        $s6 = $this->peg_FAILED;
                    }
                    if ($s6 !== $this->peg_FAILED) {
                        $s7 = $this->peg_parse__();
                        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                            $s8 = $this->peg_l2;
                            $this->peg_currPos++;
                        } else {
                            $s8 = $this->peg_FAILED;
                            if ($this->peg_silentFails === 0) {
                                $this->peg_fail($this->peg_e4);
                            }
                        }
                        if ($s8 !== $this->peg_FAILED) {
                            $s9 = $this->peg_parse__();
                            if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l14) {
                                $s10 = $this->peg_l14;
                                $this->peg_currPos++;
                            } else {
                                $s10 = $this->peg_FAILED;
                                if ($this->peg_silentFails === 0) {
                                    $this->peg_fail($this->peg_e19);
                                }
                            }
                            if ($s10 !== $this->peg_FAILED) {
                                $s11 = $this->peg_parse__();
                                $s12 = $this->peg_currPos;
                                $s13 = $this->input_substr($this->peg_currPos, 5);
                                if (\mb_strtolower($s13, "UTF-8") === $this->peg_l49) {
                                    $this->peg_currPos += 5;
                                } else {
                                    $s13 = $this->peg_FAILED;
                                    if ($this->peg_silentFails === 0) {
                                        $this->peg_fail($this->peg_e63);
                                    }
                                }
                                if ($s13 !== $this->peg_FAILED) {
                                    $s14 = $this->peg_parse__();
                                    if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                                        $s15 = $this->peg_l2;
                                        $this->peg_currPos++;
                                    } else {
                                        $s15 = $this->peg_FAILED;
                                        if ($this->peg_silentFails === 0) {
                                            $this->peg_fail($this->peg_e4);
                                        }
                                    }
                                    if ($s15 !== $this->peg_FAILED) {
                                        $s16 = $this->peg_parse__();
                                        $s17 = $this->peg_parse_COLOR_SPEC_NAMED();
                                        if ($s17 !== $this->peg_FAILED) {
                                            $this->peg_reportedPos = $s12;
                                            $s12 = $this->peg_f166($s1, $s6, $s17);
                                        } else {
                                            $this->peg_currPos = $s12;
                                            $s12 = $this->peg_FAILED;
                                        }
                                    } else {
                                        $this->peg_currPos = $s12;
                                        $s12 = $this->peg_FAILED;
                                    }
                                } else {
                                    $this->peg_currPos = $s12;
                                    $s12 = $this->peg_FAILED;
                                }
                                if ($s12 === $this->peg_FAILED) {
                                    $s12 = $this->peg_currPos;
                                    $s13 = $this->input_substr($this->peg_currPos, 4);
                                    if (\mb_strtolower($s13, "UTF-8") === $this->peg_l50) {
                                        $this->peg_currPos += 4;
                                    } else {
                                        $s13 = $this->peg_FAILED;
                                        if ($this->peg_silentFails === 0) {
                                            $this->peg_fail($this->peg_e64);
                                        }
                                    }
                                    if ($s13 !== $this->peg_FAILED) {
                                        $s14 = $this->peg_parse__();
                                        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                                            $s15 = $this->peg_l2;
                                            $this->peg_currPos++;
                                        } else {
                                            $s15 = $this->peg_FAILED;
                                            if ($this->peg_silentFails === 0) {
                                                $this->peg_fail($this->peg_e4);
                                            }
                                        }
                                        if ($s15 !== $this->peg_FAILED) {
                                            $s16 = $this->peg_parse__();
                                            $s17 = $this->peg_parse_COLOR_SPEC_GRAY();
                                            if ($s17 !== $this->peg_FAILED) {
                                                $this->peg_reportedPos = $s12;
                                                $s12 = $this->peg_f167($s1, $s6, $s17);
                                            } else {
                                                $this->peg_currPos = $s12;
                                                $s12 = $this->peg_FAILED;
                                            }
                                        } else {
                                            $this->peg_currPos = $s12;
                                            $s12 = $this->peg_FAILED;
                                        }
                                    } else {
                                        $this->peg_currPos = $s12;
                                        $s12 = $this->peg_FAILED;
                                    }
                                    if ($s12 === $this->peg_FAILED) {
                                        $s12 = $this->peg_currPos;
                                        if ($this->input_substr($this->peg_currPos, 3) === $this->peg_l51) {
                                            $s13 = $this->peg_l51;
                                            $this->peg_currPos += 3;
                                        } else {
                                            $s13 = $this->peg_FAILED;
                                            if ($this->peg_silentFails === 0) {
                                                $this->peg_fail($this->peg_e65);
                                            }
                                        }
                                        if ($s13 !== $this->peg_FAILED) {
                                            $s14 = $this->peg_parse__();
                                            if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                                                $s15 = $this->peg_l2;
                                                $this->peg_currPos++;
                                            } else {
                                                $s15 = $this->peg_FAILED;
                                                if ($this->peg_silentFails === 0) {
                                                    $this->peg_fail($this->peg_e4);
                                                }
                                            }
                                            if ($s15 !== $this->peg_FAILED) {
                                                $s16 = $this->peg_parse__();
                                                $s17 = $this->peg_parse_COLOR_SPEC_rgb();
                                                if ($s17 !== $this->peg_FAILED) {
                                                    $this->peg_reportedPos = $s12;
                                                    $s12 = $this->peg_f168($s1, $s6, $s17);
                                                } else {
                                                    $this->peg_currPos = $s12;
                                                    $s12 = $this->peg_FAILED;
                                                }
                                            } else {
                                                $this->peg_currPos = $s12;
                                                $s12 = $this->peg_FAILED;
                                            }
                                        } else {
                                            $this->peg_currPos = $s12;
                                            $s12 = $this->peg_FAILED;
                                        }
                                        if ($s12 === $this->peg_FAILED) {
                                            $s12 = $this->peg_currPos;
                                            if ($this->input_substr($this->peg_currPos, 3) === $this->peg_l52) {
                                                $s13 = $this->peg_l52;
                                                $this->peg_currPos += 3;
                                            } else {
                                                $s13 = $this->peg_FAILED;
                                                if ($this->peg_silentFails === 0) {
                                                    $this->peg_fail($this->peg_e66);
                                                }
                                            }
                                            if ($s13 !== $this->peg_FAILED) {
                                                $s14 = $this->peg_parse__();
                                                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                                                    $s15 = $this->peg_l2;
                                                    $this->peg_currPos++;
                                                } else {
                                                    $s15 = $this->peg_FAILED;
                                                    if ($this->peg_silentFails === 0) {
                                                        $this->peg_fail($this->peg_e4);
                                                    }
                                                }
                                                if ($s15 !== $this->peg_FAILED) {
                                                    $s16 = $this->peg_parse__();
                                                    $s17 = $this->peg_parse_COLOR_SPEC_RGBI();
                                                    if ($s17 !== $this->peg_FAILED) {
                                                        $this->peg_reportedPos = $s12;
                                                        $s12 = $this->peg_f169($s1, $s6, $s17);
                                                    } else {
                                                        $this->peg_currPos = $s12;
                                                        $s12 = $this->peg_FAILED;
                                                    }
                                                } else {
                                                    $this->peg_currPos = $s12;
                                                    $s12 = $this->peg_FAILED;
                                                }
                                            } else {
                                                $this->peg_currPos = $s12;
                                                $s12 = $this->peg_FAILED;
                                            }
                                            if ($s12 === $this->peg_FAILED) {
                                                $s12 = $this->peg_currPos;
                                                $s13 = $this->input_substr($this->peg_currPos, 4);
                                                if (\mb_strtolower($s13, "UTF-8") === $this->peg_l53) {
                                                    $this->peg_currPos += 4;
                                                } else {
                                                    $s13 = $this->peg_FAILED;
                                                    if ($this->peg_silentFails === 0) {
                                                        $this->peg_fail($this->peg_e67);
                                                    }
                                                }
                                                if ($s13 !== $this->peg_FAILED) {
                                                    $s14 = $this->peg_parse__();
                                                    if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                                                        $s15 = $this->peg_l2;
                                                        $this->peg_currPos++;
                                                    } else {
                                                        $s15 = $this->peg_FAILED;
                                                        if ($this->peg_silentFails === 0) {
                                                            $this->peg_fail($this->peg_e4);
                                                        }
                                                    }
                                                    if ($s15 !== $this->peg_FAILED) {
                                                        $s16 = $this->peg_parse__();
                                                        $s17 = $this->peg_parse_COLOR_SPEC_CMYK();
                                                        if ($s17 !== $this->peg_FAILED) {
                                                            $this->peg_reportedPos = $s12;
                                                            $s12 = $this->peg_f170($s1, $s6, $s17);
                                                        } else {
                                                            $this->peg_currPos = $s12;
                                                            $s12 = $this->peg_FAILED;
                                                        }
                                                    } else {
                                                        $this->peg_currPos = $s12;
                                                        $s12 = $this->peg_FAILED;
                                                    }
                                                } else {
                                                    $this->peg_currPos = $s12;
                                                    $s12 = $this->peg_FAILED;
                                                }
                                            }
                                        }
                                    }
                                }
                                if ($s12 !== $this->peg_FAILED) {
                                    $this->peg_reportedPos = $s0;
                                    $s0 = $this->peg_f171($s1, $s6, $s12);
                                } else {
                                    $this->peg_currPos = $s0;
                                    $s0 = $this->peg_FAILED;
                                }
                            } else {
                                $this->peg_currPos = $s0;
                                $s0 = $this->peg_FAILED;
                            }
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_COLOR_SPEC(): mixed
    {
        $key = $this->peg_currPos * 124 + 102;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_parse_COLOR_SPEC_NAMED();
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l8) {
                $s1 = $this->peg_l8;
                $this->peg_currPos++;
            } else {
                $s1 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e12);
                }
            }
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->peg_parse__();
                $s3 = $this->input_substr($this->peg_currPos, 5);
                if (\mb_strtolower($s3, "UTF-8") === $this->peg_l49) {
                    $this->peg_currPos += 5;
                } else {
                    $s3 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e63);
                    }
                }
                if ($s3 !== $this->peg_FAILED) {
                    $s4 = $this->peg_parse__();
                    if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l9) {
                        $s5 = $this->peg_l9;
                        $this->peg_currPos++;
                    } else {
                        $s5 = $this->peg_FAILED;
                        if ($this->peg_silentFails === 0) {
                            $this->peg_fail($this->peg_e14);
                        }
                    }
                    if ($s5 !== $this->peg_FAILED) {
                        $s6 = $this->peg_parse__();
                        $s7 = $this->peg_parse_COLOR_SPEC_NAMED();
                        if ($s7 !== $this->peg_FAILED) {
                            $this->peg_reportedPos = $s0;
                            $s0 = $this->peg_f172($s7);
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
            if ($s0 === $this->peg_FAILED) {
                $s0 = $this->peg_currPos;
                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l8) {
                    $s1 = $this->peg_l8;
                    $this->peg_currPos++;
                } else {
                    $s1 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e12);
                    }
                }
                if ($s1 !== $this->peg_FAILED) {
                    $s2 = $this->peg_parse__();
                    $s3 = $this->input_substr($this->peg_currPos, 4);
                    if (\mb_strtolower($s3, "UTF-8") === $this->peg_l50) {
                        $this->peg_currPos += 4;
                    } else {
                        $s3 = $this->peg_FAILED;
                        if ($this->peg_silentFails === 0) {
                            $this->peg_fail($this->peg_e64);
                        }
                    }
                    if ($s3 !== $this->peg_FAILED) {
                        $s4 = $this->peg_parse__();
                        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l9) {
                            $s5 = $this->peg_l9;
                            $this->peg_currPos++;
                        } else {
                            $s5 = $this->peg_FAILED;
                            if ($this->peg_silentFails === 0) {
                                $this->peg_fail($this->peg_e14);
                            }
                        }
                        if ($s5 !== $this->peg_FAILED) {
                            $s6 = $this->peg_parse__();
                            $s7 = $this->peg_parse_COLOR_SPEC_GRAY();
                            if ($s7 !== $this->peg_FAILED) {
                                $this->peg_reportedPos = $s0;
                                $s0 = $this->peg_f173($s7);
                            } else {
                                $this->peg_currPos = $s0;
                                $s0 = $this->peg_FAILED;
                            }
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
                if ($s0 === $this->peg_FAILED) {
                    $s0 = $this->peg_currPos;
                    if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l8) {
                        $s1 = $this->peg_l8;
                        $this->peg_currPos++;
                    } else {
                        $s1 = $this->peg_FAILED;
                        if ($this->peg_silentFails === 0) {
                            $this->peg_fail($this->peg_e12);
                        }
                    }
                    if ($s1 !== $this->peg_FAILED) {
                        $s2 = $this->peg_parse__();
                        if ($this->input_substr($this->peg_currPos, 3) === $this->peg_l51) {
                            $s3 = $this->peg_l51;
                            $this->peg_currPos += 3;
                        } else {
                            $s3 = $this->peg_FAILED;
                            if ($this->peg_silentFails === 0) {
                                $this->peg_fail($this->peg_e65);
                            }
                        }
                        if ($s3 !== $this->peg_FAILED) {
                            $s4 = $this->peg_parse__();
                            if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l9) {
                                $s5 = $this->peg_l9;
                                $this->peg_currPos++;
                            } else {
                                $s5 = $this->peg_FAILED;
                                if ($this->peg_silentFails === 0) {
                                    $this->peg_fail($this->peg_e14);
                                }
                            }
                            if ($s5 !== $this->peg_FAILED) {
                                $s6 = $this->peg_parse__();
                                $s7 = $this->peg_parse_COLOR_SPEC_rgb();
                                if ($s7 !== $this->peg_FAILED) {
                                    $this->peg_reportedPos = $s0;
                                    $s0 = $this->peg_f174($s7);
                                } else {
                                    $this->peg_currPos = $s0;
                                    $s0 = $this->peg_FAILED;
                                }
                            } else {
                                $this->peg_currPos = $s0;
                                $s0 = $this->peg_FAILED;
                            }
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                    if ($s0 === $this->peg_FAILED) {
                        $s0 = $this->peg_currPos;
                        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l8) {
                            $s1 = $this->peg_l8;
                            $this->peg_currPos++;
                        } else {
                            $s1 = $this->peg_FAILED;
                            if ($this->peg_silentFails === 0) {
                                $this->peg_fail($this->peg_e12);
                            }
                        }
                        if ($s1 !== $this->peg_FAILED) {
                            $s2 = $this->peg_parse__();
                            if ($this->input_substr($this->peg_currPos, 3) === $this->peg_l52) {
                                $s3 = $this->peg_l52;
                                $this->peg_currPos += 3;
                            } else {
                                $s3 = $this->peg_FAILED;
                                if ($this->peg_silentFails === 0) {
                                    $this->peg_fail($this->peg_e66);
                                }
                            }
                            if ($s3 !== $this->peg_FAILED) {
                                $s4 = $this->peg_parse__();
                                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l9) {
                                    $s5 = $this->peg_l9;
                                    $this->peg_currPos++;
                                } else {
                                    $s5 = $this->peg_FAILED;
                                    if ($this->peg_silentFails === 0) {
                                        $this->peg_fail($this->peg_e14);
                                    }
                                }
                                if ($s5 !== $this->peg_FAILED) {
                                    $s6 = $this->peg_parse__();
                                    $s7 = $this->peg_parse_COLOR_SPEC_RGBI();
                                    if ($s7 !== $this->peg_FAILED) {
                                        $this->peg_reportedPos = $s0;
                                        $s0 = $this->peg_f175($s7);
                                    } else {
                                        $this->peg_currPos = $s0;
                                        $s0 = $this->peg_FAILED;
                                    }
                                } else {
                                    $this->peg_currPos = $s0;
                                    $s0 = $this->peg_FAILED;
                                }
                            } else {
                                $this->peg_currPos = $s0;
                                $s0 = $this->peg_FAILED;
                            }
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                        if ($s0 === $this->peg_FAILED) {
                            $s0 = $this->peg_currPos;
                            if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l8) {
                                $s1 = $this->peg_l8;
                                $this->peg_currPos++;
                            } else {
                                $s1 = $this->peg_FAILED;
                                if ($this->peg_silentFails === 0) {
                                    $this->peg_fail($this->peg_e12);
                                }
                            }
                            if ($s1 !== $this->peg_FAILED) {
                                $s2 = $this->peg_parse__();
                                $s3 = $this->input_substr($this->peg_currPos, 4);
                                if (\mb_strtolower($s3, "UTF-8") === $this->peg_l53) {
                                    $this->peg_currPos += 4;
                                } else {
                                    $s3 = $this->peg_FAILED;
                                    if ($this->peg_silentFails === 0) {
                                        $this->peg_fail($this->peg_e67);
                                    }
                                }
                                if ($s3 !== $this->peg_FAILED) {
                                    $s4 = $this->peg_parse__();
                                    if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l9) {
                                        $s5 = $this->peg_l9;
                                        $this->peg_currPos++;
                                    } else {
                                        $s5 = $this->peg_FAILED;
                                        if ($this->peg_silentFails === 0) {
                                            $this->peg_fail($this->peg_e14);
                                        }
                                    }
                                    if ($s5 !== $this->peg_FAILED) {
                                        $s6 = $this->peg_parse__();
                                        $s7 = $this->peg_parse_COLOR_SPEC_CMYK();
                                        if ($s7 !== $this->peg_FAILED) {
                                            $this->peg_reportedPos = $s0;
                                            $s0 = $this->peg_f176($s7);
                                        } else {
                                            $this->peg_currPos = $s0;
                                            $s0 = $this->peg_FAILED;
                                        }
                                    } else {
                                        $this->peg_currPos = $s0;
                                        $s0 = $this->peg_FAILED;
                                    }
                                } else {
                                    $this->peg_currPos = $s0;
                                    $s0 = $this->peg_FAILED;
                                }
                            } else {
                                $this->peg_currPos = $s0;
                                $s0 = $this->peg_FAILED;
                            }
                        }
                    }
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_COLOR_SPEC_NAMED(): mixed
    {
        $key = $this->peg_currPos * 124 + 103;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l14) {
            $s1 = $this->peg_l14;
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e19);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s3 = [];
            $s4 = $this->peg_parse_alpha();
            if ($s4 !== $this->peg_FAILED) {
                while ($s4 !== $this->peg_FAILED) {
                    $s3[] = $s4;
                    $s4 = $this->peg_parse_alpha();
                }
            } else {
                $s3 = $this->peg_FAILED;
            }
            if ($s3 !== $this->peg_FAILED) {
                $s4 = $this->peg_parse__();
                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                    $s5 = $this->peg_l2;
                    $this->peg_currPos++;
                } else {
                    $s5 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e4);
                    }
                }
                if ($s5 !== $this->peg_FAILED) {
                    $s6 = $this->peg_parse__();
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f177($s3);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_COLOR_SPEC_GRAY(): mixed
    {
        $key = $this->peg_currPos * 124 + 104;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l14) {
            $s1 = $this->peg_l14;
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e19);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s3 = [];
            $s4 = $this->peg_parse_CNUM();
            if ($s4 !== $this->peg_FAILED) {
                while ($s4 !== $this->peg_FAILED) {
                    $s3[] = $s4;
                    $s4 = $this->peg_parse_CNUM();
                }
            } else {
                $s3 = $this->peg_FAILED;
            }
            if ($s3 !== $this->peg_FAILED) {
                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                    $s4 = $this->peg_l2;
                    $this->peg_currPos++;
                } else {
                    $s4 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e4);
                    }
                }
                if ($s4 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f178($s3);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_COLOR_SPEC_rgb(): mixed
    {
        $key = $this->peg_currPos * 124 + 105;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l14) {
            $s1 = $this->peg_l14;
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e19);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s3 = $this->peg_parse_CNUM();
            if ($s3 !== $this->peg_FAILED) {
                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l54) {
                    $s4 = $this->peg_l54;
                    $this->peg_currPos++;
                } else {
                    $s4 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e68);
                    }
                }
                if ($s4 !== $this->peg_FAILED) {
                    $s5 = $this->peg_parse__();
                    $s6 = $this->peg_parse_CNUM();
                    if ($s6 !== $this->peg_FAILED) {
                        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l54) {
                            $s7 = $this->peg_l54;
                            $this->peg_currPos++;
                        } else {
                            $s7 = $this->peg_FAILED;
                            if ($this->peg_silentFails === 0) {
                                $this->peg_fail($this->peg_e68);
                            }
                        }
                        if ($s7 !== $this->peg_FAILED) {
                            $s8 = $this->peg_parse__();
                            $s9 = $this->peg_parse_CNUM();
                            if ($s9 !== $this->peg_FAILED) {
                                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                                    $s10 = $this->peg_l2;
                                    $this->peg_currPos++;
                                } else {
                                    $s10 = $this->peg_FAILED;
                                    if ($this->peg_silentFails === 0) {
                                        $this->peg_fail($this->peg_e4);
                                    }
                                }
                                if ($s10 !== $this->peg_FAILED) {
                                    $s11 = $this->peg_parse__();
                                    $this->peg_reportedPos = $s0;
                                    $s0 = $this->peg_f179($s3, $s6, $s9);
                                } else {
                                    $this->peg_currPos = $s0;
                                    $s0 = $this->peg_FAILED;
                                }
                            } else {
                                $this->peg_currPos = $s0;
                                $s0 = $this->peg_FAILED;
                            }
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_COLOR_SPEC_RGBI(): mixed
    {
        $key = $this->peg_currPos * 124 + 106;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l14) {
            $s1 = $this->peg_l14;
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e19);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s3 = $this->peg_parse_CNUM255();
            if ($s3 !== $this->peg_FAILED) {
                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l54) {
                    $s4 = $this->peg_l54;
                    $this->peg_currPos++;
                } else {
                    $s4 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e68);
                    }
                }
                if ($s4 !== $this->peg_FAILED) {
                    $s5 = $this->peg_parse__();
                    $s6 = $this->peg_parse_CNUM255();
                    if ($s6 !== $this->peg_FAILED) {
                        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l54) {
                            $s7 = $this->peg_l54;
                            $this->peg_currPos++;
                        } else {
                            $s7 = $this->peg_FAILED;
                            if ($this->peg_silentFails === 0) {
                                $this->peg_fail($this->peg_e68);
                            }
                        }
                        if ($s7 !== $this->peg_FAILED) {
                            $s8 = $this->peg_parse__();
                            $s9 = $this->peg_parse_CNUM255();
                            if ($s9 !== $this->peg_FAILED) {
                                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                                    $s10 = $this->peg_l2;
                                    $this->peg_currPos++;
                                } else {
                                    $s10 = $this->peg_FAILED;
                                    if ($this->peg_silentFails === 0) {
                                        $this->peg_fail($this->peg_e4);
                                    }
                                }
                                if ($s10 !== $this->peg_FAILED) {
                                    $s11 = $this->peg_parse__();
                                    $this->peg_reportedPos = $s0;
                                    $s0 = $this->peg_f180($s3, $s6, $s9);
                                } else {
                                    $this->peg_currPos = $s0;
                                    $s0 = $this->peg_FAILED;
                                }
                            } else {
                                $this->peg_currPos = $s0;
                                $s0 = $this->peg_FAILED;
                            }
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_COLOR_SPEC_CMYK(): mixed
    {
        $key = $this->peg_currPos * 124 + 107;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l14) {
            $s1 = $this->peg_l14;
            $this->peg_currPos++;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e19);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $s3 = $this->peg_parse_CNUM();
            if ($s3 !== $this->peg_FAILED) {
                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l54) {
                    $s4 = $this->peg_l54;
                    $this->peg_currPos++;
                } else {
                    $s4 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e68);
                    }
                }
                if ($s4 !== $this->peg_FAILED) {
                    $s5 = $this->peg_parse__();
                    $s6 = $this->peg_parse_CNUM();
                    if ($s6 !== $this->peg_FAILED) {
                        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l54) {
                            $s7 = $this->peg_l54;
                            $this->peg_currPos++;
                        } else {
                            $s7 = $this->peg_FAILED;
                            if ($this->peg_silentFails === 0) {
                                $this->peg_fail($this->peg_e68);
                            }
                        }
                        if ($s7 !== $this->peg_FAILED) {
                            $s8 = $this->peg_parse__();
                            $s9 = $this->peg_parse_CNUM();
                            if ($s9 !== $this->peg_FAILED) {
                                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l54) {
                                    $s10 = $this->peg_l54;
                                    $this->peg_currPos++;
                                } else {
                                    $s10 = $this->peg_FAILED;
                                    if ($this->peg_silentFails === 0) {
                                        $this->peg_fail($this->peg_e68);
                                    }
                                }
                                if ($s10 !== $this->peg_FAILED) {
                                    $s11 = $this->peg_parse__();
                                    $s12 = $this->peg_parse_CNUM();
                                    if ($s12 !== $this->peg_FAILED) {
                                        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l2) {
                                            $s13 = $this->peg_l2;
                                            $this->peg_currPos++;
                                        } else {
                                            $s13 = $this->peg_FAILED;
                                            if ($this->peg_silentFails === 0) {
                                                $this->peg_fail($this->peg_e4);
                                            }
                                        }
                                        if ($s13 !== $this->peg_FAILED) {
                                            $s14 = $this->peg_parse__();
                                            $this->peg_reportedPos = $s0;
                                            $s0 = $this->peg_f181($s3, $s6, $s9, $s12);
                                        } else {
                                            $this->peg_currPos = $s0;
                                            $s0 = $this->peg_FAILED;
                                        }
                                    } else {
                                        $this->peg_currPos = $s0;
                                        $s0 = $this->peg_FAILED;
                                    }
                                } else {
                                    $this->peg_currPos = $s0;
                                    $s0 = $this->peg_FAILED;
                                }
                            } else {
                                $this->peg_currPos = $s0;
                                $s0 = $this->peg_FAILED;
                            }
                        } else {
                            $this->peg_currPos = $s0;
                            $s0 = $this->peg_FAILED;
                        }
                    } else {
                        $this->peg_currPos = $s0;
                        $s0 = $this->peg_FAILED;
                    }
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CNUM255(): mixed
    {
        $key = $this->peg_currPos * 124 + 108;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l55) {
            $s2 = $this->peg_l55;
            $this->peg_currPos++;
        } else {
            $s2 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e69);
            }
        }
        if ($s2 === $this->peg_FAILED) {
            $s2 = $this->peg_currPos;
            $s3 = $this->input_substr($this->peg_currPos, 1);
            if (\preg_match($this->peg_c14, $s3)) {
                $this->peg_currPos++;
            } else {
                $s3 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e70);
                }
            }
            if ($s3 !== $this->peg_FAILED) {
                $s4 = $this->peg_currPos;
                $s5 = $this->input_substr($this->peg_currPos, 1);
                if (\preg_match($this->peg_c3, $s5)) {
                    $this->peg_currPos++;
                } else {
                    $s5 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e8);
                    }
                }
                if ($s5 !== $this->peg_FAILED) {
                    $s6 = $this->input_substr($this->peg_currPos, 1);
                    if (\preg_match($this->peg_c3, $s6)) {
                        $this->peg_currPos++;
                    } else {
                        $s6 = $this->peg_FAILED;
                        if ($this->peg_silentFails === 0) {
                            $this->peg_fail($this->peg_e8);
                        }
                    }
                    if ($s6 === $this->peg_FAILED) {
                        $s6 = null;
                    }
                    $s5 = [$s5, $s6];
                    $s4 = $s5;
                } else {
                    $this->peg_currPos = $s4;
                    $s4 = $this->peg_FAILED;
                }
                if ($s4 === $this->peg_FAILED) {
                    $s4 = null;
                }
                $s3 = [$s3, $s4];
                $s2 = $s3;
            } else {
                $this->peg_currPos = $s2;
                $s2 = $this->peg_FAILED;
            }
        }
        if ($s2 !== $this->peg_FAILED) {
            $s1 = $this->input_substr($s1, $this->peg_currPos - $s1);
        } else {
            $s1 = $s2;
        }
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f182($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f183($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CNUM(): mixed
    {
        $key = $this->peg_currPos * 124 + 109;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_currPos;
        $s2 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l55) {
            $s3 = $this->peg_l55;
            $this->peg_currPos++;
        } else {
            $s3 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e69);
            }
        }
        if ($s3 === $this->peg_FAILED) {
            $s3 = null;
        }
        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l18) {
            $s4 = $this->peg_l18;
            $this->peg_currPos++;
        } else {
            $s4 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e32);
            }
        }
        if ($s4 !== $this->peg_FAILED) {
            $s5 = [];
            $s6 = $this->input_substr($this->peg_currPos, 1);
            if (\preg_match($this->peg_c3, $s6)) {
                $this->peg_currPos++;
            } else {
                $s6 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e8);
                }
            }
            if ($s6 !== $this->peg_FAILED) {
                while ($s6 !== $this->peg_FAILED) {
                    $s5[] = $s6;
                    $s6 = $this->input_substr($this->peg_currPos, 1);
                    if (\preg_match($this->peg_c3, $s6)) {
                        $this->peg_currPos++;
                    } else {
                        $s6 = $this->peg_FAILED;
                        if ($this->peg_silentFails === 0) {
                            $this->peg_fail($this->peg_e8);
                        }
                    }
                }
            } else {
                $s5 = $this->peg_FAILED;
            }
            if ($s5 !== $this->peg_FAILED) {
                $s3 = [$s3, $s4, $s5];
                $s2 = $s3;
            } else {
                $this->peg_currPos = $s2;
                $s2 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s2;
            $s2 = $this->peg_FAILED;
        }
        if ($s2 !== $this->peg_FAILED) {
            $s1 = $this->input_substr($s1, $this->peg_currPos - $s1);
        } else {
            $s1 = $s2;
        }
        if ($s1 !== $this->peg_FAILED) {
            $s2 = $this->peg_parse__();
            $this->peg_reportedPos = $s0;
            $s0 = $this->peg_f184($s1);
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            $s1 = $this->peg_currPos;
            $s2 = $this->peg_currPos;
            $s3 = $this->input_substr($this->peg_currPos, 1);
            if (\preg_match($this->peg_c15, $s3)) {
                $this->peg_currPos++;
            } else {
                $s3 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e71);
                }
            }
            if ($s3 !== $this->peg_FAILED) {
                if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l18) {
                    $s4 = $this->peg_l18;
                    $this->peg_currPos++;
                } else {
                    $s4 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e32);
                    }
                }
                if ($s4 === $this->peg_FAILED) {
                    $s4 = null;
                }
                $s3 = [$s3, $s4];
                $s2 = $s3;
            } else {
                $this->peg_currPos = $s2;
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s1 = $this->input_substr($s1, $this->peg_currPos - $s1);
            } else {
                $s1 = $s2;
            }
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f185($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CHEM_SINGLE_MACRO(): mixed
    {
        $key = $this->peg_currPos * 124 + 110;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f186($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f187($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l16) {
                $s1 = $this->peg_l16;
                $this->peg_currPos++;
            } else {
                $s1 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e24);
                }
            }
            if ($s1 !== $this->peg_FAILED) {
                $s2 = $this->input_substr($this->peg_currPos, 1);
                if (\preg_match($this->peg_c8, $s2)) {
                    $this->peg_currPos++;
                } else {
                    $s2 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e25);
                    }
                }
                if ($s2 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s0 = $this->peg_f188($s2);
                } else {
                    $this->peg_currPos = $s0;
                    $s0 = $this->peg_FAILED;
                }
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CHEM_BONDI(): mixed
    {
        $key = $this->peg_currPos * 124 + 111;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f189($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f190($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CHEM_MACRO_1P(): mixed
    {
        $key = $this->peg_currPos * 124 + 112;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f191($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f192($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CHEM_MACRO_2P(): mixed
    {
        $key = $this->peg_currPos * 124 + 113;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f193($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f194($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CHEM_MACRO_2PU(): mixed
    {
        $key = $this->peg_currPos * 124 + 114;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f195($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f196($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CHEM_MACRO_2PC(): mixed
    {
        $key = $this->peg_currPos * 124 + 115;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_generic_func();
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $this->peg_currPos;
            $s2 = $this->peg_f197($s1);
            if ($s2) {
                $s2 = null;
            } else {
                $s2 = $this->peg_FAILED;
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $this->peg_reportedPos = $s0;
                $s0 = $this->peg_f198($s1);
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CHEM_SCRIPT_FOLLOW(): mixed
    {
        $key = $this->peg_currPos * 124 + 116;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->input_substr($this->peg_currPos, 1);
        if (\preg_match($this->peg_c16, $s0)) {
            $this->peg_currPos++;
        } else {
            $s0 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e72);
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CHEM_SUPERSUB(): mixed
    {
        $key = $this->peg_currPos * 124 + 117;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->input_substr($this->peg_currPos, 1);
        if (\preg_match($this->peg_c17, $s0)) {
            $this->peg_currPos++;
        } else {
            $s0 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e73);
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CHEM_BOND_TYPE(): mixed
    {
        $key = $this->peg_currPos * 124 + 118;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->input_substr($this->peg_currPos, 1);
        if (\preg_match($this->peg_c18, $s0)) {
            $this->peg_currPos++;
        } else {
            $s0 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e74);
            }
        }
        if ($s0 === $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 3) === $this->peg_l56) {
                $s0 = $this->peg_l56;
                $this->peg_currPos += 3;
            } else {
                $s0 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e75);
                }
            }
            if ($s0 === $this->peg_FAILED) {
                if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l57) {
                    $s0 = $this->peg_l57;
                    $this->peg_currPos += 2;
                } else {
                    $s0 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e76);
                    }
                }
                if ($s0 === $this->peg_FAILED) {
                    if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l58) {
                        $s0 = $this->peg_l58;
                        $this->peg_currPos += 2;
                    } else {
                        $s0 = $this->peg_FAILED;
                        if ($this->peg_silentFails === 0) {
                            $this->peg_fail($this->peg_e77);
                        }
                    }
                    if ($s0 === $this->peg_FAILED) {
                        if ($this->input_substr($this->peg_currPos, 1) === $this->peg_l59) {
                            $s0 = $this->peg_l59;
                            $this->peg_currPos++;
                        } else {
                            $s0 = $this->peg_FAILED;
                            if ($this->peg_silentFails === 0) {
                                $this->peg_fail($this->peg_e78);
                            }
                        }
                        if ($s0 === $this->peg_FAILED) {
                            if ($this->input_substr($this->peg_currPos, 3) === $this->peg_l60) {
                                $s0 = $this->peg_l60;
                                $this->peg_currPos += 3;
                            } else {
                                $s0 = $this->peg_FAILED;
                                if ($this->peg_silentFails === 0) {
                                    $this->peg_fail($this->peg_e79);
                                }
                            }
                            if ($s0 === $this->peg_FAILED) {
                                if ($this->input_substr($this->peg_currPos, 4) === $this->peg_l61) {
                                    $s0 = $this->peg_l61;
                                    $this->peg_currPos += 4;
                                } else {
                                    $s0 = $this->peg_FAILED;
                                    if ($this->peg_silentFails === 0) {
                                        $this->peg_fail($this->peg_e80);
                                    }
                                }
                                if ($s0 === $this->peg_FAILED) {
                                    if ($this->input_substr($this->peg_currPos, 3) === $this->peg_l62) {
                                        $s0 = $this->peg_l62;
                                        $this->peg_currPos += 3;
                                    } else {
                                        $s0 = $this->peg_FAILED;
                                        if ($this->peg_silentFails === 0) {
                                            $this->peg_fail($this->peg_e81);
                                        }
                                    }
                                    if ($s0 === $this->peg_FAILED) {
                                        if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l63) {
                                            $s0 = $this->peg_l63;
                                            $this->peg_currPos += 2;
                                        } else {
                                            $s0 = $this->peg_FAILED;
                                            if ($this->peg_silentFails === 0) {
                                                $this->peg_fail($this->peg_e82);
                                            }
                                        }
                                        if ($s0 === $this->peg_FAILED) {
                                            if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l64) {
                                                $s0 = $this->peg_l64;
                                                $this->peg_currPos += 2;
                                            } else {
                                                $s0 = $this->peg_FAILED;
                                                if ($this->peg_silentFails === 0) {
                                                    $this->peg_fail($this->peg_e83);
                                                }
                                            }
                                            if ($s0 === $this->peg_FAILED) {
                                                $s0 = $this->input_substr($this->peg_currPos, 1);
                                                if (\preg_match($this->peg_c19, $s0)) {
                                                    $this->peg_currPos++;
                                                } else {
                                                    $s0 = $this->peg_FAILED;
                                                    if ($this->peg_silentFails === 0) {
                                                        $this->peg_fail($this->peg_e84);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_BEGIN_MATH(): mixed
    {
        $key = $this->peg_currPos * 124 + 119;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_BEGIN();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 6) === $this->peg_l65) {
                $s2 = $this->peg_l65;
                $this->peg_currPos += 6;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e85);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_END_MATH(): mixed
    {
        $key = $this->peg_currPos * 124 + 120;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        $s1 = $this->peg_parse_END();
        if ($s1 !== $this->peg_FAILED) {
            if ($this->input_substr($this->peg_currPos, 6) === $this->peg_l65) {
                $s2 = $this->peg_l65;
                $this->peg_currPos += 6;
            } else {
                $s2 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e85);
                }
            }
            if ($s2 !== $this->peg_FAILED) {
                $s3 = $this->peg_parse__();
                $s1 = [$s1, $s2, $s3];
                $s0 = $s1;
            } else {
                $this->peg_currPos = $s0;
                $s0 = $this->peg_FAILED;
            }
        } else {
            $this->peg_currPos = $s0;
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CHEM_LETTER(): mixed
    {
        $key = $this->peg_currPos * 124 + 121;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->input_substr($this->peg_currPos, 1);
        if (\preg_match($this->peg_c5, $s0)) {
            $this->peg_currPos++;
        } else {
            $s0 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e20);
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_CHEM_NONLETTER(): mixed
    {
        $key = $this->peg_currPos * 124 + 122;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $s0 = $this->peg_currPos;
        if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l0) {
            $s1 = $this->peg_l0;
            $this->peg_currPos += 2;
        } else {
            $s1 = $this->peg_FAILED;
            if ($this->peg_silentFails === 0) {
                $this->peg_fail($this->peg_e2);
            }
        }
        if ($s1 !== $this->peg_FAILED) {
            $this->peg_reportedPos = $s0;
            $s1 = $this->peg_f199($s1);
        }
        $s0 = $s1;
        if ($s0 === $this->peg_FAILED) {
            $s0 = $this->peg_currPos;
            if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l66) {
                $s1 = $this->peg_l66;
                $this->peg_currPos += 2;
            } else {
                $s1 = $this->peg_FAILED;
                if ($this->peg_silentFails === 0) {
                    $this->peg_fail($this->peg_e86);
                }
            }
            if ($s1 !== $this->peg_FAILED) {
                $this->peg_reportedPos = $s0;
                $s1 = $this->peg_f200($s1);
            }
            $s0 = $s1;
            if ($s0 === $this->peg_FAILED) {
                $s0 = $this->peg_currPos;
                if ($this->input_substr($this->peg_currPos, 2) === $this->peg_l33) {
                    $s1 = $this->peg_l33;
                    $this->peg_currPos += 2;
                } else {
                    $s1 = $this->peg_FAILED;
                    if ($this->peg_silentFails === 0) {
                        $this->peg_fail($this->peg_e47);
                    }
                }
                if ($s1 !== $this->peg_FAILED) {
                    $this->peg_reportedPos = $s0;
                    $s1 = $this->peg_f201($s1);
                }
                $s0 = $s1;
                if ($s0 === $this->peg_FAILED) {
                    $s0 = $this->peg_currPos;
                    $s1 = $this->input_substr($this->peg_currPos, 1);
                    if (\preg_match($this->peg_c20, $s1)) {
                        $this->peg_currPos++;
                    } else {
                        $s1 = $this->peg_FAILED;
                        if ($this->peg_silentFails === 0) {
                            $this->peg_fail($this->peg_e87);
                        }
                    }
                    if ($s1 !== $this->peg_FAILED) {
                        $this->peg_reportedPos = $s0;
                        $s1 = $this->peg_f202($s1);
                    }
                    $s0 = $s1;
                    if ($s0 === $this->peg_FAILED) {
                        $s0 = $this->peg_currPos;
                        $s1 = $this->peg_parse_literal_mn();
                        if ($s1 !== $this->peg_FAILED) {
                            $this->peg_reportedPos = $s0;
                            $s1 = $this->peg_f203($s1);
                        }
                        $s0 = $s1;
                        if ($s0 === $this->peg_FAILED) {
                            $s0 = $this->peg_currPos;
                            $s1 = $this->peg_parse_CURLY_OPEN();
                            if ($s1 !== $this->peg_FAILED) {
                                $s2 = $this->peg_parse_CURLY_CLOSE();
                                if ($s2 !== $this->peg_FAILED) {
                                    $this->peg_reportedPos = $s0;
                                    $s0 = $this->peg_f204();
                                } else {
                                    $this->peg_currPos = $s0;
                                    $s0 = $this->peg_FAILED;
                                }
                            } else {
                                $this->peg_currPos = $s0;
                                $s0 = $this->peg_FAILED;
                            }
                        }
                    }
                }
            }
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }

    private function peg_parse_EOF(): mixed
    {
        $key = $this->peg_currPos * 124 + 123;
        $cached = $this->peg_cache[$key] ?? false;

        if ($cached) {
            $this->peg_currPos = $cached->nextPos;
            return $cached->result;
        }

        $this->peg_reportedPos = $this->peg_currPos;
        $s0 = $this->peg_f205();
        if ($s0) {
            $s0 = null;
        } else {
            $s0 = $this->peg_FAILED;
        }

        $this->peg_cache[$key] = new pegCacheItem($this->peg_currPos, $s0);

        return $s0;
    }
};
