Module: CBOR_DIAG
Defined Under Namespace
Modules: Appstring0, Appstring1, Appstring2, Array0, Array1, Array2, Array3, B64string0, B64string1, B64string2, Bstring0, Bstring1, BstringPart0, BstringPart1, BstringPart10, BstringPart2, BstringPart3, BstringPart4, BstringPart5, BstringPart6, BstringPart7, BstringPart8, BstringPart9, Embedded0, Embedded1, Fnumber0, Fnumber1, Fnumber2, Fnumber3, Fnumber4, Hexdigit0, Hexdigit1, Hnumber0, Hnumber1, Hnumber2, Hnumber3, Hnumber4, Hnumber5, Hstring0, Hstring1, Infin0, Infin1, Infin2, Kp0, Kp1, Map0, Map1, Map2, Map3, Ows0, Ows1, Ows2, Simple0, Simple1, Simple2, Simple3, Simple4, Simple5, Spec0, Spec1, Streamstring0, Streamstring1, Streamstring2, Streamstring3, Streamstring4, Streamstring5, Streamstring6, Streamstring7, String0, String1, StringPart0, StringPart1, StringPart10, StringPart2, StringPart3, StringPart4, StringPart5, StringPart6, StringPart7, StringPart8, StringPart9, Tagged0, Tagged1, Text0, Text1, Text2, Text3, Twohex0, Twohex1 Classes: App_dt, App_nan
Instance Method Summary collapse
- #_nt_appstring ⇒ Object
- #_nt_array ⇒ Object
- #_nt_b64string ⇒ Object
- #_nt_bstring ⇒ Object
- #_nt_bstring_part ⇒ Object
- #_nt_embedded ⇒ Object
- #_nt_fnumber ⇒ Object
- #_nt_hbstring ⇒ Object
- #_nt_hexdigit ⇒ Object
- #_nt_hnumber ⇒ Object
- #_nt_hstring ⇒ Object
- #_nt_infin ⇒ Object
- #_nt_kp ⇒ Object
- #_nt_map ⇒ Object
- #_nt_ows ⇒ Object
- #_nt_simple ⇒ Object
- #_nt_spec ⇒ Object
- #_nt_streamstring ⇒ Object
- #_nt_string ⇒ Object
- #_nt_string_part ⇒ Object
- #_nt_tagged ⇒ Object
- #_nt_text ⇒ Object
- #_nt_twohex ⇒ Object
- #_nt_value ⇒ Object
- #root ⇒ Object
Instance Method Details
#_nt_appstring ⇒ Object
1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 |
# File 'lib/cbor-diag-parser.rb', line 1558 def _nt_appstring start_index = index if node_cache[:appstring].has_key?(index) cached = node_cache[:appstring][index] if cached node_cache[:appstring][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] i1, s1 = index, [] if has_terminal?(@regexps[gr = '\A[a-z]'] ||= Regexp.new(gr), :regexp, index) r2 = true @index += 1 else terminal_parse_failure('[a-z]') r2 = nil end s1 << r2 if r2 s3, i3 = [], index loop do if has_terminal?(@regexps[gr = '\A[a-z0-9]'] ||= Regexp.new(gr), :regexp, index) r4 = true @index += 1 else terminal_parse_failure('[a-z0-9]') r4 = nil end if r4 s3 << r4 else break end end r3 = instantiate_node(SyntaxNode,input, i3...index, s3) s1 << r3 end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(Appstring0) else @index = i1 r1 = nil end s0 << r1 if r1 if (match_len = has_terminal?("'", false, index)) r5 = true @index += match_len else terminal_parse_failure('"\'"') r5 = nil end s0 << r5 if r5 s6, i6 = [], index loop do r7 = _nt_bstring_part if r7 s6 << r7 else break end end r6 = instantiate_node(SyntaxNode,input, i6...index, s6) s0 << r6 if r6 if (match_len = has_terminal?("'", false, index)) r8 = true @index += match_len else terminal_parse_failure('"\'"') r8 = nil end s0 << r8 end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Appstring1) r0.extend(Appstring2) else @index = i0 r0 = nil end node_cache[:appstring][start_index] = r0 r0 end |
#_nt_array ⇒ Object
2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 |
# File 'lib/cbor-diag-parser.rb', line 2613 def _nt_array start_index = index if node_cache[:array].has_key?(index) cached = node_cache[:array][index] if cached node_cache[:array][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?('[', false, index)) r1 = true @index += match_len else terminal_parse_failure('\'[\'') r1 = nil end s0 << r1 if r1 r2 = _nt_spec s0 << r2 if r2 i4, s4 = index, [] r5 = _nt_value s4 << r5 if r5 r6 = _nt_ows s4 << r6 if r6 s7, i7 = [], index loop do i8, s8 = index, [] if (match_len = has_terminal?(',', false, index)) r9 = true @index += match_len else terminal_parse_failure('\',\'') r9 = nil end s8 << r9 if r9 r10 = _nt_ows s8 << r10 if r10 r11 = _nt_value s8 << r11 if r11 r12 = _nt_ows s8 << r12 end end end if s8.last r8 = instantiate_node(SyntaxNode,input, i8...index, s8) r8.extend(Array0) else @index = i8 r8 = nil end if r8 s7 << r8 else break end end r7 = instantiate_node(SyntaxNode,input, i7...index, s7) s4 << r7 end end if s4.last r4 = instantiate_node(SyntaxNode,input, i4...index, s4) r4.extend(Array1) else @index = i4 r4 = nil end if r4 r3 = r4 else r3 = instantiate_node(SyntaxNode,input, index...index) end s0 << r3 if r3 r13 = _nt_ows s0 << r13 if r13 if (match_len = has_terminal?(']', false, index)) r14 = true @index += match_len else terminal_parse_failure('\']\'') r14 = nil end s0 << r14 end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Array2) r0.extend(Array3) else @index = i0 r0 = nil end node_cache[:array][start_index] = r0 r0 end |
#_nt_b64string ⇒ Object
2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 |
# File 'lib/cbor-diag-parser.rb', line 2465 def _nt_b64string start_index = index if node_cache[:b64string].has_key?(index) cached = node_cache[:b64string][index] if cached node_cache[:b64string][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?("b64'", false, index)) r1 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('"b64\'"') r1 = nil end s0 << r1 if r1 i2, s2 = index, [] s3, i3 = [], index loop do if has_terminal?(@regexps[gr = '\A[0-9a-zA-Z_\\-+/\\s]'] ||= Regexp.new(gr), :regexp, index) r4 = true @index += 1 else terminal_parse_failure('[0-9a-zA-Z_\\-+/\\s]') r4 = nil end if r4 s3 << r4 else break end end r3 = instantiate_node(SyntaxNode,input, i3...index, s3) s2 << r3 if r3 s5, i5 = [], index loop do if has_terminal?(@regexps[gr = '\A[=\\s]'] ||= Regexp.new(gr), :regexp, index) r6 = true @index += 1 else terminal_parse_failure('[=\\s]') r6 = nil end if r6 s5 << r6 else break end end r5 = instantiate_node(SyntaxNode,input, i5...index, s5) s2 << r5 end if s2.last r2 = instantiate_node(SyntaxNode,input, i2...index, s2) r2.extend(B64string0) else @index = i2 r2 = nil end s0 << r2 if r2 if (match_len = has_terminal?("'", false, index)) r7 = true @index += match_len else terminal_parse_failure('"\'"') r7 = nil end s0 << r7 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(B64string1) r0.extend(B64string2) else @index = i0 r0 = nil end node_cache[:b64string][start_index] = r0 r0 end |
#_nt_bstring ⇒ Object
1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 |
# File 'lib/cbor-diag-parser.rb', line 1667 def _nt_bstring start_index = index if node_cache[:bstring].has_key?(index) cached = node_cache[:bstring][index] if cached node_cache[:bstring][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?("'", false, index)) r1 = true @index += match_len else terminal_parse_failure('"\'"') r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_bstring_part if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 if r2 if (match_len = has_terminal?("'", false, index)) r4 = true @index += match_len else terminal_parse_failure('"\'"') r4 = nil end s0 << r4 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Bstring0) r0.extend(Bstring1) else @index = i0 r0 = nil end node_cache[:bstring][start_index] = r0 r0 end |
#_nt_bstring_part ⇒ Object
1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 |
# File 'lib/cbor-diag-parser.rb', line 1778 def _nt_bstring_part start_index = index if node_cache[:bstring_part].has_key?(index) cached = node_cache[:bstring_part][index] if cached node_cache[:bstring_part][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index s1, i1 = [], index loop do if has_terminal?(@regexps[gr = '\A[^\\\\\'\\t]'] ||= Regexp.new(gr), :regexp, index) r2 = true @index += 1 else terminal_parse_failure('[^\\\\\'\\t]') r2 = nil end if r2 s1 << r2 else break end end if s1.empty? @index = i1 r1 = nil else r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(BstringPart0) r1.extend(BstringPart0) end if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else i3, s3 = index, [] if (match_len = has_terminal?("\\", false, index)) r4 = true @index += match_len else terminal_parse_failure('"\\\\"') r4 = nil end s3 << r4 if r4 if has_terminal?(@regexps[gr = '\A[\'\\\\/bfnrt]'] ||= Regexp.new(gr), :regexp, index) r5 = true @index += 1 else terminal_parse_failure('[\'\\\\/bfnrt]') r5 = nil end s3 << r5 end if s3.last r3 = instantiate_node(SyntaxNode,input, i3...index, s3) r3.extend(BstringPart1) r3.extend(BstringPart2) else @index = i3 r3 = nil end if r3 r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true r0 = r3 else i6, s6 = index, [] if (match_len = has_terminal?("\\u", false, index)) r7 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('"\\\\u"') r7 = nil end s6 << r7 if r7 i8, s8 = index, [] if has_terminal?(@regexps[gr = '\A[dD]'] ||= Regexp.new(gr), :regexp, index) r9 = true @index += 1 else terminal_parse_failure('[dD]') r9 = nil end s8 << r9 if r9 if has_terminal?(@regexps[gr = '\A[89abAB]'] ||= Regexp.new(gr), :regexp, index) r10 = true @index += 1 else terminal_parse_failure('[89abAB]') r10 = nil end s8 << r10 if r10 s11, i11 = [], index loop do if has_terminal?(@regexps[gr = '\A[0-9a-fA-F]'] ||= Regexp.new(gr), :regexp, index) r12 = true @index += 1 else terminal_parse_failure('[0-9a-fA-F]') r12 = nil end if r12 s11 << r12 else break end if s11.size == 2 break end end if s11.size < 2 @index = i11 r11 = nil else if s11.size < 2 @terminal_failures.pop end r11 = instantiate_node(SyntaxNode,input, i11...index, s11) end s8 << r11 end end if s8.last r8 = instantiate_node(SyntaxNode,input, i8...index, s8) r8.extend(BstringPart3) else @index = i8 r8 = nil end s6 << r8 if r8 if (match_len = has_terminal?("\\u", false, index)) r13 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('"\\\\u"') r13 = nil end s6 << r13 if r13 i14, s14 = index, [] if has_terminal?(@regexps[gr = '\A[dD]'] ||= Regexp.new(gr), :regexp, index) r15 = true @index += 1 else terminal_parse_failure('[dD]') r15 = nil end s14 << r15 if r15 if has_terminal?(@regexps[gr = '\A[cCdDeEfF]'] ||= Regexp.new(gr), :regexp, index) r16 = true @index += 1 else terminal_parse_failure('[cCdDeEfF]') r16 = nil end s14 << r16 if r16 s17, i17 = [], index loop do if has_terminal?(@regexps[gr = '\A[0-9a-fA-F]'] ||= Regexp.new(gr), :regexp, index) r18 = true @index += 1 else terminal_parse_failure('[0-9a-fA-F]') r18 = nil end if r18 s17 << r18 else break end if s17.size == 2 break end end if s17.size < 2 @index = i17 r17 = nil else if s17.size < 2 @terminal_failures.pop end r17 = instantiate_node(SyntaxNode,input, i17...index, s17) end s14 << r17 end end if s14.last r14 = instantiate_node(SyntaxNode,input, i14...index, s14) r14.extend(BstringPart4) else @index = i14 r14 = nil end s6 << r14 end end end if s6.last r6 = instantiate_node(SyntaxNode,input, i6...index, s6) r6.extend(BstringPart5) r6.extend(BstringPart6) else @index = i6 r6 = nil end if r6 r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true r0 = r6 else i19, s19 = index, [] if (match_len = has_terminal?("\\u", false, index)) r20 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('"\\\\u"') r20 = nil end s19 << r20 if r20 i21 = index i22, s22 = index, [] if has_terminal?(@regexps[gr = '\A[0-9abcefABCEF]'] ||= Regexp.new(gr), :regexp, index) r23 = true @index += 1 else terminal_parse_failure('[0-9abcefABCEF]') r23 = nil end s22 << r23 if r23 s24, i24 = [], index loop do if has_terminal?(@regexps[gr = '\A[0-9a-fA-F]'] ||= Regexp.new(gr), :regexp, index) r25 = true @index += 1 else terminal_parse_failure('[0-9a-fA-F]') r25 = nil end if r25 s24 << r25 else break end if s24.size == 3 break end end if s24.size < 3 @index = i24 r24 = nil else if s24.size < 3 @terminal_failures.pop end r24 = instantiate_node(SyntaxNode,input, i24...index, s24) end s22 << r24 end if s22.last r22 = instantiate_node(SyntaxNode,input, i22...index, s22) r22.extend(BstringPart7) else @index = i22 r22 = nil end if r22 r22 = SyntaxNode.new(input, (index-1)...index) if r22 == true r21 = r22 else i26, s26 = index, [] if has_terminal?(@regexps[gr = '\A[dD]'] ||= Regexp.new(gr), :regexp, index) r27 = true @index += 1 else terminal_parse_failure('[dD]') r27 = nil end s26 << r27 if r27 if has_terminal?(@regexps[gr = '\A[0-7]'] ||= Regexp.new(gr), :regexp, index) r28 = true @index += 1 else terminal_parse_failure('[0-7]') r28 = nil end s26 << r28 if r28 s29, i29 = [], index loop do if has_terminal?(@regexps[gr = '\A[0-9a-fA-F]'] ||= Regexp.new(gr), :regexp, index) r30 = true @index += 1 else terminal_parse_failure('[0-9a-fA-F]') r30 = nil end if r30 s29 << r30 else break end if s29.size == 2 break end end if s29.size < 2 @index = i29 r29 = nil else if s29.size < 2 @terminal_failures.pop end r29 = instantiate_node(SyntaxNode,input, i29...index, s29) end s26 << r29 end end if s26.last r26 = instantiate_node(SyntaxNode,input, i26...index, s26) r26.extend(BstringPart8) else @index = i26 r26 = nil end if r26 r26 = SyntaxNode.new(input, (index-1)...index) if r26 == true r21 = r26 else @index = i21 r21 = nil end end s19 << r21 end if s19.last r19 = instantiate_node(SyntaxNode,input, i19...index, s19) r19.extend(BstringPart9) r19.extend(BstringPart10) else @index = i19 r19 = nil end if r19 r19 = SyntaxNode.new(input, (index-1)...index) if r19 == true r0 = r19 else @index = i0 r0 = nil end end end end node_cache[:bstring_part][start_index] = r0 r0 end |
#_nt_embedded ⇒ Object
2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 |
# File 'lib/cbor-diag-parser.rb', line 2170 def start_index = index if node_cache[:embedded].has_key?(index) cached = node_cache[:embedded][index] if cached node_cache[:embedded][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?("<<", false, index)) r1 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('"<<"') r1 = nil end s0 << r1 if r1 r3 = _nt_text if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s0 << r2 if r2 if (match_len = has_terminal?(">>", false, index)) r4 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('">>"') r4 = nil end s0 << r4 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Embedded0) r0.extend(Embedded1) else @index = i0 r0 = nil end node_cache[:embedded][start_index] = r0 r0 end |
#_nt_fnumber ⇒ Object
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 |
# File 'lib/cbor-diag-parser.rb', line 299 def _nt_fnumber start_index = index if node_cache[:fnumber].has_key?(index) cached = node_cache[:fnumber][index] if cached node_cache[:fnumber][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] i1, s1 = index, [] if has_terminal?(@regexps[gr = '\A[-+]'] ||= Regexp.new(gr), :regexp, index) r3 = true @index += 1 else terminal_parse_failure('[-+]') r3 = nil end if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s1 << r2 if r2 s4, i4 = [], index loop do if has_terminal?(@regexps[gr = '\A[0-9]'] ||= Regexp.new(gr), :regexp, index) r5 = true @index += 1 else terminal_parse_failure('[0-9]') r5 = nil end if r5 s4 << r5 else break end end if s4.empty? @index = i4 r4 = nil else r4 = instantiate_node(SyntaxNode,input, i4...index, s4) end s1 << r4 end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(Fnumber0) else @index = i1 r1 = nil end s0 << r1 if r1 i7, s7 = index, [] if (match_len = has_terminal?('.', false, index)) r8 = true @index += match_len else terminal_parse_failure('\'.\'') r8 = nil end s7 << r8 if r8 s9, i9 = [], index loop do if has_terminal?(@regexps[gr = '\A[0-9]'] ||= Regexp.new(gr), :regexp, index) r10 = true @index += 1 else terminal_parse_failure('[0-9]') r10 = nil end if r10 s9 << r10 else break end end if s9.empty? @index = i9 r9 = nil else r9 = instantiate_node(SyntaxNode,input, i9...index, s9) end s7 << r9 end if s7.last r7 = instantiate_node(SyntaxNode,input, i7...index, s7) r7.extend(Fnumber1) else @index = i7 r7 = nil end if r7 r6 = r7 else r6 = instantiate_node(SyntaxNode,input, index...index) end s0 << r6 if r6 i12, s12 = index, [] if has_terminal?(@regexps[gr = '\A[Ee]'] ||= Regexp.new(gr), :regexp, index) r13 = true @index += 1 else terminal_parse_failure('[Ee]') r13 = nil end s12 << r13 if r13 if has_terminal?(@regexps[gr = '\A[-+]'] ||= Regexp.new(gr), :regexp, index) r15 = true @index += 1 else terminal_parse_failure('[-+]') r15 = nil end if r15 r14 = r15 else r14 = instantiate_node(SyntaxNode,input, index...index) end s12 << r14 if r14 s16, i16 = [], index loop do if has_terminal?(@regexps[gr = '\A[0-9]'] ||= Regexp.new(gr), :regexp, index) r17 = true @index += 1 else terminal_parse_failure('[0-9]') r17 = nil end if r17 s16 << r17 else break end end if s16.empty? @index = i16 r16 = nil else r16 = instantiate_node(SyntaxNode,input, i16...index, s16) end s12 << r16 end end if s12.last r12 = instantiate_node(SyntaxNode,input, i12...index, s12) r12.extend(Fnumber2) else @index = i12 r12 = nil end if r12 r11 = r12 else r11 = instantiate_node(SyntaxNode,input, index...index) end s0 << r11 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Fnumber3) r0.extend(Fnumber4) else @index = i0 r0 = nil end node_cache[:fnumber][start_index] = r0 r0 end |
#_nt_hbstring ⇒ Object
2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 |
# File 'lib/cbor-diag-parser.rb', line 2408 def _nt_hbstring start_index = index if node_cache[:hbstring].has_key?(index) cached = node_cache[:hbstring][index] if cached node_cache[:hbstring][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_hstring if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else r2 = _nt_bstring if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else @index = i0 r0 = nil end end node_cache[:hbstring][start_index] = r0 r0 end |
#_nt_hexdigit ⇒ Object
2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 |
# File 'lib/cbor-diag-parser.rb', line 2233 def _nt_hexdigit start_index = index if node_cache[:hexdigit].has_key?(index) cached = node_cache[:hexdigit][index] if cached node_cache[:hexdigit][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if has_terminal?(@regexps[gr = '\A[0-9a-fA-F]'] ||= Regexp.new(gr), :regexp, index) r1 = true @index += 1 else terminal_parse_failure('[0-9a-fA-F]') r1 = nil end s0 << r1 if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Hexdigit0) r0.extend(Hexdigit1) else @index = i0 r0 = nil end node_cache[:hexdigit][start_index] = r0 r0 end |
#_nt_hnumber ⇒ Object
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 |
# File 'lib/cbor-diag-parser.rb', line 506 def _nt_hnumber start_index = index if node_cache[:hnumber].has_key?(index) cached = node_cache[:hnumber][index] if cached node_cache[:hnumber][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] i1, s1 = index, [] if has_terminal?(@regexps[gr = '\A[-+]'] ||= Regexp.new(gr), :regexp, index) r3 = true @index += 1 else terminal_parse_failure('[-+]') r3 = nil end if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s1 << r2 if r2 if (match_len = has_terminal?('0', false, index)) r4 = true @index += match_len else terminal_parse_failure('\'0\'') r4 = nil end s1 << r4 if r4 i5 = index i6, s6 = index, [] if has_terminal?(@regexps[gr = '\A[xX]'] ||= Regexp.new(gr), :regexp, index) r7 = true @index += 1 else terminal_parse_failure('[xX]') r7 = nil end s6 << r7 if r7 s8, i8 = [], index loop do if has_terminal?(@regexps[gr = '\A[0-9a-fA-F]'] ||= Regexp.new(gr), :regexp, index) r9 = true @index += 1 else terminal_parse_failure('[0-9a-fA-F]') r9 = nil end if r9 s8 << r9 else break end end if s8.empty? @index = i8 r8 = nil else r8 = instantiate_node(SyntaxNode,input, i8...index, s8) end s6 << r8 end if s6.last r6 = instantiate_node(SyntaxNode,input, i6...index, s6) r6.extend(Hnumber0) else @index = i6 r6 = nil end if r6 r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true r5 = r6 else i10, s10 = index, [] if has_terminal?(@regexps[gr = '\A[oO]'] ||= Regexp.new(gr), :regexp, index) r11 = true @index += 1 else terminal_parse_failure('[oO]') r11 = nil end s10 << r11 if r11 s12, i12 = [], index loop do if has_terminal?(@regexps[gr = '\A[0-7]'] ||= Regexp.new(gr), :regexp, index) r13 = true @index += 1 else terminal_parse_failure('[0-7]') r13 = nil end if r13 s12 << r13 else break end end if s12.empty? @index = i12 r12 = nil else r12 = instantiate_node(SyntaxNode,input, i12...index, s12) end s10 << r12 end if s10.last r10 = instantiate_node(SyntaxNode,input, i10...index, s10) r10.extend(Hnumber1) else @index = i10 r10 = nil end if r10 r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true r5 = r10 else i14, s14 = index, [] if has_terminal?(@regexps[gr = '\A[bB]'] ||= Regexp.new(gr), :regexp, index) r15 = true @index += 1 else terminal_parse_failure('[bB]') r15 = nil end s14 << r15 if r15 s16, i16 = [], index loop do if has_terminal?(@regexps[gr = '\A[01]'] ||= Regexp.new(gr), :regexp, index) r17 = true @index += 1 else terminal_parse_failure('[01]') r17 = nil end if r17 s16 << r17 else break end end if s16.empty? @index = i16 r16 = nil else r16 = instantiate_node(SyntaxNode,input, i16...index, s16) end s14 << r16 end if s14.last r14 = instantiate_node(SyntaxNode,input, i14...index, s14) r14.extend(Hnumber2) else @index = i14 r14 = nil end if r14 r14 = SyntaxNode.new(input, (index-1)...index) if r14 == true r5 = r14 else @index = i5 r5 = nil end end end s1 << r5 end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(Hnumber3) else @index = i1 r1 = nil end s0 << r1 if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Hnumber4) r0.extend(Hnumber5) else @index = i0 r0 = nil end node_cache[:hnumber][start_index] = r0 r0 end |
#_nt_hstring ⇒ Object
2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 |
# File 'lib/cbor-diag-parser.rb', line 2347 def _nt_hstring start_index = index if node_cache[:hstring].has_key?(index) cached = node_cache[:hstring][index] if cached node_cache[:hstring][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?("h'", false, index)) r1 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('"h\'"') r1 = nil end s0 << r1 if r1 r2 = _nt_ows s0 << r2 if r2 s3, i3 = [], index loop do r4 = _nt_twohex if r4 s3 << r4 else break end end r3 = instantiate_node(SyntaxNode,input, i3...index, s3) s0 << r3 if r3 if (match_len = has_terminal?("'", false, index)) r5 = true @index += match_len else terminal_parse_failure('"\'"') r5 = nil end s0 << r5 end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Hstring0) r0.extend(Hstring1) else @index = i0 r0 = nil end node_cache[:hstring][start_index] = r0 r0 end |
#_nt_infin ⇒ Object
717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 |
# File 'lib/cbor-diag-parser.rb', line 717 def _nt_infin start_index = index if node_cache[:infin].has_key?(index) cached = node_cache[:infin][index] if cached node_cache[:infin][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index if (match_len = has_terminal?('Infinity', false, index)) r1 = instantiate_node(SyntaxNode,input, index...(index + match_len)) r1.extend(Infin0) @index += match_len else terminal_parse_failure('\'Infinity\'') r1 = nil end if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else if (match_len = has_terminal?('-Infinity', false, index)) r2 = instantiate_node(SyntaxNode,input, index...(index + match_len)) r2.extend(Infin1) @index += match_len else terminal_parse_failure('\'-Infinity\'') r2 = nil end if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else if (match_len = has_terminal?('NaN', false, index)) r3 = instantiate_node(SyntaxNode,input, index...(index + match_len)) r3.extend(Infin2) @index += match_len else terminal_parse_failure('\'NaN\'') r3 = nil end if r3 r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true r0 = r3 else @index = i0 r0 = nil end end end node_cache[:infin][start_index] = r0 r0 end |
#_nt_kp ⇒ Object
2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 |
# File 'lib/cbor-diag-parser.rb', line 2922 def _nt_kp start_index = index if node_cache[:kp].has_key?(index) cached = node_cache[:kp][index] if cached node_cache[:kp][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_value s0 << r1 if r1 r2 = _nt_ows s0 << r2 if r2 if (match_len = has_terminal?(":", false, index)) r3 = true @index += match_len else terminal_parse_failure('":"') r3 = nil end s0 << r3 if r3 r4 = _nt_ows s0 << r4 if r4 r5 = _nt_value s0 << r5 end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Kp0) r0.extend(Kp1) else @index = i0 r0 = nil end node_cache[:kp][start_index] = r0 r0 end |
#_nt_map ⇒ Object
2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 |
# File 'lib/cbor-diag-parser.rb', line 2784 def _nt_map start_index = index if node_cache[:map].has_key?(index) cached = node_cache[:map][index] if cached node_cache[:map][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?('{', false, index)) r1 = true @index += match_len else terminal_parse_failure('\'{\'') r1 = nil end s0 << r1 if r1 r2 = _nt_spec s0 << r2 if r2 i4, s4 = index, [] r5 = _nt_kp s4 << r5 if r5 r6 = _nt_ows s4 << r6 if r6 s7, i7 = [], index loop do i8, s8 = index, [] if (match_len = has_terminal?(',', false, index)) r9 = true @index += match_len else terminal_parse_failure('\',\'') r9 = nil end s8 << r9 if r9 r10 = _nt_ows s8 << r10 if r10 r11 = _nt_kp s8 << r11 if r11 r12 = _nt_ows s8 << r12 end end end if s8.last r8 = instantiate_node(SyntaxNode,input, i8...index, s8) r8.extend(Map0) else @index = i8 r8 = nil end if r8 s7 << r8 else break end end r7 = instantiate_node(SyntaxNode,input, i7...index, s7) s4 << r7 end end if s4.last r4 = instantiate_node(SyntaxNode,input, i4...index, s4) r4.extend(Map1) else @index = i4 r4 = nil end if r4 r3 = r4 else r3 = instantiate_node(SyntaxNode,input, index...index) end s0 << r3 if r3 r13 = _nt_ows s0 << r13 if r13 if (match_len = has_terminal?('}', false, index)) r14 = true @index += match_len else terminal_parse_failure('\'}\'') r14 = nil end s0 << r14 end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Map2) r0.extend(Map3) else @index = i0 r0 = nil end node_cache[:map][start_index] = r0 r0 end |
#_nt_ows ⇒ Object
2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 |
# File 'lib/cbor-diag-parser.rb', line 2982 def _nt_ows start_index = index if node_cache[:ows].has_key?(index) cached = node_cache[:ows][index] if cached node_cache[:ows][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] s1, i1 = [], index loop do if has_terminal?(@regexps[gr = '\A[ \\t\\n\\r]'] ||= Regexp.new(gr), :regexp, index) r2 = true @index += 1 else terminal_parse_failure('[ \\t\\n\\r]') r2 = nil end if r2 s1 << r2 else break end end r1 = instantiate_node(SyntaxNode,input, i1...index, s1) s0 << r1 if r1 s3, i3 = [], index loop do i4, s4 = index, [] if (match_len = has_terminal?("/", false, index)) r5 = true @index += match_len else terminal_parse_failure('"/"') r5 = nil end s4 << r5 if r5 s6, i6 = [], index loop do if has_terminal?(@regexps[gr = '\A[^/]'] ||= Regexp.new(gr), :regexp, index) r7 = true @index += 1 else terminal_parse_failure('[^/]') r7 = nil end if r7 s6 << r7 else break end end r6 = instantiate_node(SyntaxNode,input, i6...index, s6) s4 << r6 if r6 if (match_len = has_terminal?("/", false, index)) r8 = true @index += match_len else terminal_parse_failure('"/"') r8 = nil end s4 << r8 if r8 s9, i9 = [], index loop do if has_terminal?(@regexps[gr = '\A[ \\t\\n\\r]'] ||= Regexp.new(gr), :regexp, index) r10 = true @index += 1 else terminal_parse_failure('[ \\t\\n\\r]') r10 = nil end if r10 s9 << r10 else break end end r9 = instantiate_node(SyntaxNode,input, i9...index, s9) s4 << r9 end end end if s4.last r4 = instantiate_node(SyntaxNode,input, i4...index, s4) r4.extend(Ows0) else @index = i4 r4 = nil end if r4 s3 << r4 else break end end r3 = instantiate_node(SyntaxNode,input, i3...index, s3) s0 << r3 end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Ows1) r0.extend(Ows2) else @index = i0 r0 = nil end node_cache[:ows][start_index] = r0 r0 end |
#_nt_simple ⇒ Object
811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 |
# File 'lib/cbor-diag-parser.rb', line 811 def _nt_simple start_index = index if node_cache[:simple].has_key?(index) cached = node_cache[:simple][index] if cached node_cache[:simple][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index if (match_len = has_terminal?('false', false, index)) r1 = instantiate_node(SyntaxNode,input, index...(index + match_len)) r1.extend(Simple0) @index += match_len else terminal_parse_failure('\'false\'') r1 = nil end if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else if (match_len = has_terminal?('true', false, index)) r2 = instantiate_node(SyntaxNode,input, index...(index + match_len)) r2.extend(Simple1) @index += match_len else terminal_parse_failure('\'true\'') r2 = nil end if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else if (match_len = has_terminal?('null', false, index)) r3 = instantiate_node(SyntaxNode,input, index...(index + match_len)) r3.extend(Simple2) @index += match_len else terminal_parse_failure('\'null\'') r3 = nil end if r3 r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true r0 = r3 else if (match_len = has_terminal?('undefined', false, index)) r4 = instantiate_node(SyntaxNode,input, index...(index + match_len)) r4.extend(Simple3) @index += match_len else terminal_parse_failure('\'undefined\'') r4 = nil end if r4 r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true r0 = r4 else i5, s5 = index, [] if (match_len = has_terminal?('simple(', false, index)) r6 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'simple(\'') r6 = nil end s5 << r6 if r6 r7 = _nt_ows s5 << r7 if r7 r8 = _nt_value s5 << r8 if r8 r9 = _nt_ows s5 << r9 if r9 if (match_len = has_terminal?(')', false, index)) r10 = true @index += match_len else terminal_parse_failure('\')\'') r10 = nil end s5 << r10 end end end end if s5.last r5 = instantiate_node(SyntaxNode,input, i5...index, s5) r5.extend(Simple4) r5.extend(Simple5) else @index = i5 r5 = nil end if r5 r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true r0 = r5 else @index = i0 r0 = nil end end end end end node_cache[:simple][start_index] = r0 r0 end |
#_nt_spec ⇒ Object
3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 |
# File 'lib/cbor-diag-parser.rb', line 3463 def _nt_spec start_index = index if node_cache[:spec].has_key?(index) cached = node_cache[:spec][index] if cached node_cache[:spec][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_ows s0 << r1 if r1 if (match_len = has_terminal?("_", false, index)) r3 = true @index += match_len else terminal_parse_failure('"_"') r3 = nil end if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s0 << r2 if r2 r4 = _nt_ows s0 << r4 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Spec0) r0.extend(Spec1) else @index = i0 r0 = nil end node_cache[:spec][start_index] = r0 r0 end |
#_nt_streamstring ⇒ Object
3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 |
# File 'lib/cbor-diag-parser.rb', line 3209 def _nt_streamstring start_index = index if node_cache[:streamstring].has_key?(index) cached = node_cache[:streamstring][index] if cached node_cache[:streamstring][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index i1, s1 = index, [] if (match_len = has_terminal?('(', false, index)) r2 = true @index += match_len else terminal_parse_failure('\'(\'') r2 = nil end s1 << r2 if r2 r3 = _nt_ows s1 << r3 if r3 if (match_len = has_terminal?("_", false, index)) r4 = true @index += match_len else terminal_parse_failure('"_"') r4 = nil end s1 << r4 if r4 r5 = _nt_ows s1 << r5 if r5 i6, s6 = index, [] r7 = _nt_string s6 << r7 if r7 r8 = _nt_ows s6 << r8 if r8 s9, i9 = [], index loop do i10, s10 = index, [] if (match_len = has_terminal?(",", false, index)) r11 = true @index += match_len else terminal_parse_failure('","') r11 = nil end s10 << r11 if r11 r12 = _nt_ows s10 << r12 if r12 r13 = _nt_string s10 << r13 if r13 r14 = _nt_ows s10 << r14 end end end if s10.last r10 = instantiate_node(SyntaxNode,input, i10...index, s10) r10.extend(Streamstring0) else @index = i10 r10 = nil end if r10 s9 << r10 else break end end r9 = instantiate_node(SyntaxNode,input, i9...index, s9) s6 << r9 end end if s6.last r6 = instantiate_node(SyntaxNode,input, i6...index, s6) r6.extend(Streamstring1) else @index = i6 r6 = nil end s1 << r6 if r6 if (match_len = has_terminal?(')', false, index)) r15 = true @index += match_len else terminal_parse_failure('\')\'') r15 = nil end s1 << r15 end end end end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(Streamstring2) r1.extend(Streamstring3) else @index = i1 r1 = nil end if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else i16, s16 = index, [] if (match_len = has_terminal?('(', false, index)) r17 = true @index += match_len else terminal_parse_failure('\'(\'') r17 = nil end s16 << r17 if r17 r18 = _nt_ows s16 << r18 if r18 if (match_len = has_terminal?("_", false, index)) r19 = true @index += match_len else terminal_parse_failure('"_"') r19 = nil end s16 << r19 if r19 r20 = _nt_ows s16 << r20 if r20 i21, s21 = index, [] r22 = _nt_hbstring s21 << r22 if r22 r23 = _nt_ows s21 << r23 if r23 s24, i24 = [], index loop do i25, s25 = index, [] if (match_len = has_terminal?(",", false, index)) r26 = true @index += match_len else terminal_parse_failure('","') r26 = nil end s25 << r26 if r26 r27 = _nt_ows s25 << r27 if r27 r28 = _nt_hbstring s25 << r28 if r28 r29 = _nt_ows s25 << r29 end end end if s25.last r25 = instantiate_node(SyntaxNode,input, i25...index, s25) r25.extend(Streamstring4) else @index = i25 r25 = nil end if r25 s24 << r25 else break end end r24 = instantiate_node(SyntaxNode,input, i24...index, s24) s21 << r24 end end if s21.last r21 = instantiate_node(SyntaxNode,input, i21...index, s21) r21.extend(Streamstring5) else @index = i21 r21 = nil end s16 << r21 if r21 if (match_len = has_terminal?(')', false, index)) r30 = true @index += match_len else terminal_parse_failure('\')\'') r30 = nil end s16 << r30 end end end end end if s16.last r16 = instantiate_node(SyntaxNode,input, i16...index, s16) r16.extend(Streamstring6) r16.extend(Streamstring7) else @index = i16 r16 = nil end if r16 r16 = SyntaxNode.new(input, (index-1)...index) if r16 == true r0 = r16 else @index = i0 r0 = nil end end node_cache[:streamstring][start_index] = r0 r0 end |
#_nt_string ⇒ Object
1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 |
# File 'lib/cbor-diag-parser.rb', line 1046 def _nt_string start_index = index if node_cache[:string].has_key?(index) cached = node_cache[:string][index] if cached node_cache[:string][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?('"', false, index)) r1 = true @index += match_len else terminal_parse_failure('\'"\'') r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_string_part if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 if r2 if (match_len = has_terminal?('"', false, index)) r4 = true @index += match_len else terminal_parse_failure('\'"\'') r4 = nil end s0 << r4 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(String0) r0.extend(String1) else @index = i0 r0 = nil end node_cache[:string][start_index] = r0 r0 end |
#_nt_string_part ⇒ Object
1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 |
# File 'lib/cbor-diag-parser.rb', line 1158 def _nt_string_part start_index = index if node_cache[:string_part].has_key?(index) cached = node_cache[:string_part][index] if cached node_cache[:string_part][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index s1, i1 = [], index loop do if has_terminal?(@regexps[gr = '\A[^\\\\"\\t]'] ||= Regexp.new(gr), :regexp, index) r2 = true @index += 1 else terminal_parse_failure('[^\\\\"\\t]') r2 = nil end if r2 s1 << r2 else break end end if s1.empty? @index = i1 r1 = nil else r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(StringPart0) r1.extend(StringPart0) end if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else i3, s3 = index, [] if (match_len = has_terminal?("\\", false, index)) r4 = true @index += match_len else terminal_parse_failure('"\\\\"') r4 = nil end s3 << r4 if r4 if has_terminal?(@regexps[gr = '\A["\\\\/bfnrt]'] ||= Regexp.new(gr), :regexp, index) r5 = true @index += 1 else terminal_parse_failure('["\\\\/bfnrt]') r5 = nil end s3 << r5 end if s3.last r3 = instantiate_node(SyntaxNode,input, i3...index, s3) r3.extend(StringPart1) r3.extend(StringPart2) else @index = i3 r3 = nil end if r3 r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true r0 = r3 else i6, s6 = index, [] if (match_len = has_terminal?("\\u", false, index)) r7 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('"\\\\u"') r7 = nil end s6 << r7 if r7 i8, s8 = index, [] if has_terminal?(@regexps[gr = '\A[dD]'] ||= Regexp.new(gr), :regexp, index) r9 = true @index += 1 else terminal_parse_failure('[dD]') r9 = nil end s8 << r9 if r9 if has_terminal?(@regexps[gr = '\A[89abAB]'] ||= Regexp.new(gr), :regexp, index) r10 = true @index += 1 else terminal_parse_failure('[89abAB]') r10 = nil end s8 << r10 if r10 s11, i11 = [], index loop do if has_terminal?(@regexps[gr = '\A[0-9a-fA-F]'] ||= Regexp.new(gr), :regexp, index) r12 = true @index += 1 else terminal_parse_failure('[0-9a-fA-F]') r12 = nil end if r12 s11 << r12 else break end if s11.size == 2 break end end if s11.size < 2 @index = i11 r11 = nil else if s11.size < 2 @terminal_failures.pop end r11 = instantiate_node(SyntaxNode,input, i11...index, s11) end s8 << r11 end end if s8.last r8 = instantiate_node(SyntaxNode,input, i8...index, s8) r8.extend(StringPart3) else @index = i8 r8 = nil end s6 << r8 if r8 if (match_len = has_terminal?("\\u", false, index)) r13 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('"\\\\u"') r13 = nil end s6 << r13 if r13 i14, s14 = index, [] if has_terminal?(@regexps[gr = '\A[dD]'] ||= Regexp.new(gr), :regexp, index) r15 = true @index += 1 else terminal_parse_failure('[dD]') r15 = nil end s14 << r15 if r15 if has_terminal?(@regexps[gr = '\A[cCdDeEfF]'] ||= Regexp.new(gr), :regexp, index) r16 = true @index += 1 else terminal_parse_failure('[cCdDeEfF]') r16 = nil end s14 << r16 if r16 s17, i17 = [], index loop do if has_terminal?(@regexps[gr = '\A[0-9a-fA-F]'] ||= Regexp.new(gr), :regexp, index) r18 = true @index += 1 else terminal_parse_failure('[0-9a-fA-F]') r18 = nil end if r18 s17 << r18 else break end if s17.size == 2 break end end if s17.size < 2 @index = i17 r17 = nil else if s17.size < 2 @terminal_failures.pop end r17 = instantiate_node(SyntaxNode,input, i17...index, s17) end s14 << r17 end end if s14.last r14 = instantiate_node(SyntaxNode,input, i14...index, s14) r14.extend(StringPart4) else @index = i14 r14 = nil end s6 << r14 end end end if s6.last r6 = instantiate_node(SyntaxNode,input, i6...index, s6) r6.extend(StringPart5) r6.extend(StringPart6) else @index = i6 r6 = nil end if r6 r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true r0 = r6 else i19, s19 = index, [] if (match_len = has_terminal?("\\u", false, index)) r20 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('"\\\\u"') r20 = nil end s19 << r20 if r20 i21 = index i22, s22 = index, [] if has_terminal?(@regexps[gr = '\A[0-9abcefABCEF]'] ||= Regexp.new(gr), :regexp, index) r23 = true @index += 1 else terminal_parse_failure('[0-9abcefABCEF]') r23 = nil end s22 << r23 if r23 s24, i24 = [], index loop do if has_terminal?(@regexps[gr = '\A[0-9a-fA-F]'] ||= Regexp.new(gr), :regexp, index) r25 = true @index += 1 else terminal_parse_failure('[0-9a-fA-F]') r25 = nil end if r25 s24 << r25 else break end if s24.size == 3 break end end if s24.size < 3 @index = i24 r24 = nil else if s24.size < 3 @terminal_failures.pop end r24 = instantiate_node(SyntaxNode,input, i24...index, s24) end s22 << r24 end if s22.last r22 = instantiate_node(SyntaxNode,input, i22...index, s22) r22.extend(StringPart7) else @index = i22 r22 = nil end if r22 r22 = SyntaxNode.new(input, (index-1)...index) if r22 == true r21 = r22 else i26, s26 = index, [] if has_terminal?(@regexps[gr = '\A[dD]'] ||= Regexp.new(gr), :regexp, index) r27 = true @index += 1 else terminal_parse_failure('[dD]') r27 = nil end s26 << r27 if r27 if has_terminal?(@regexps[gr = '\A[0-7]'] ||= Regexp.new(gr), :regexp, index) r28 = true @index += 1 else terminal_parse_failure('[0-7]') r28 = nil end s26 << r28 if r28 s29, i29 = [], index loop do if has_terminal?(@regexps[gr = '\A[0-9a-fA-F]'] ||= Regexp.new(gr), :regexp, index) r30 = true @index += 1 else terminal_parse_failure('[0-9a-fA-F]') r30 = nil end if r30 s29 << r30 else break end if s29.size == 2 break end end if s29.size < 2 @index = i29 r29 = nil else if s29.size < 2 @terminal_failures.pop end r29 = instantiate_node(SyntaxNode,input, i29...index, s29) end s26 << r29 end end if s26.last r26 = instantiate_node(SyntaxNode,input, i26...index, s26) r26.extend(StringPart8) else @index = i26 r26 = nil end if r26 r26 = SyntaxNode.new(input, (index-1)...index) if r26 == true r21 = r26 else @index = i21 r21 = nil end end s19 << r21 end if s19.last r19 = instantiate_node(SyntaxNode,input, i19...index, s19) r19.extend(StringPart9) r19.extend(StringPart10) else @index = i19 r19 = nil end if r19 r19 = SyntaxNode.new(input, (index-1)...index) if r19 == true r0 = r19 else @index = i0 r0 = nil end end end end node_cache[:string_part][start_index] = r0 r0 end |
#_nt_tagged ⇒ Object
952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 |
# File 'lib/cbor-diag-parser.rb', line 952 def _nt_tagged start_index = index if node_cache[:tagged].has_key?(index) cached = node_cache[:tagged][index] if cached node_cache[:tagged][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] s1, i1 = [], index loop do if has_terminal?(@regexps[gr = '\A[0-9]'] ||= Regexp.new(gr), :regexp, index) r2 = true @index += 1 else terminal_parse_failure('[0-9]') r2 = nil end if r2 s1 << r2 else break end end if s1.empty? @index = i1 r1 = nil else r1 = instantiate_node(SyntaxNode,input, i1...index, s1) end s0 << r1 if r1 if (match_len = has_terminal?('(', false, index)) r3 = true @index += match_len else terminal_parse_failure('\'(\'') r3 = nil end s0 << r3 if r3 r4 = _nt_ows s0 << r4 if r4 r5 = _nt_value s0 << r5 if r5 r6 = _nt_ows s0 << r6 if r6 if (match_len = has_terminal?(')', false, index)) r7 = true @index += match_len else terminal_parse_failure('\')\'') r7 = nil end s0 << r7 end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Tagged0) r0.extend(Tagged1) else @index = i0 r0 = nil end node_cache[:tagged][start_index] = r0 r0 end |
#_nt_text ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/cbor-diag-parser.rb', line 68 def _nt_text start_index = index if node_cache[:text].has_key?(index) cached = node_cache[:text][index] if cached node_cache[:text][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_ows s0 << r1 if r1 i3, s3 = index, [] r4 = _nt_value s3 << r4 if r4 r5 = _nt_ows s3 << r5 if r5 s6, i6 = [], index loop do i7, s7 = index, [] if (match_len = has_terminal?(',', false, index)) r8 = true @index += match_len else terminal_parse_failure('\',\'') r8 = nil end s7 << r8 if r8 r9 = _nt_ows s7 << r9 if r9 r10 = _nt_value s7 << r10 if r10 r11 = _nt_ows s7 << r11 end end end if s7.last r7 = instantiate_node(SyntaxNode,input, i7...index, s7) r7.extend(Text0) else @index = i7 r7 = nil end if r7 s6 << r7 else break end end r6 = instantiate_node(SyntaxNode,input, i6...index, s6) s3 << r6 end end if s3.last r3 = instantiate_node(SyntaxNode,input, i3...index, s3) r3.extend(Text1) else @index = i3 r3 = nil end if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s0 << r2 if r2 r12 = _nt_ows s0 << r12 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Text2) r0.extend(Text3) else @index = i0 r0 = nil end node_cache[:text][start_index] = r0 r0 end |
#_nt_twohex ⇒ Object
2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 |
# File 'lib/cbor-diag-parser.rb', line 2289 def _nt_twohex start_index = index if node_cache[:twohex].has_key?(index) cached = node_cache[:twohex][index] if cached node_cache[:twohex][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_hexdigit s0 << r1 if r1 r2 = _nt_ows s0 << r2 if r2 r3 = _nt_hexdigit s0 << r3 if r3 r4 = _nt_ows s0 << r4 end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Twohex0) r0.extend(Twohex1) else @index = i0 r0 = nil end node_cache[:twohex][start_index] = r0 r0 end |
#_nt_value ⇒ Object
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/cbor-diag-parser.rb', line 162 def _nt_value start_index = index if node_cache[:value].has_key?(index) cached = node_cache[:value][index] if cached node_cache[:value][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_string if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else r2 = _nt_map if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else r3 = _nt_array if r3 r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true r0 = r3 else r4 = _nt_tagged if r4 r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true r0 = r4 else r5 = _nt_hnumber if r5 r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true r0 = r5 else r6 = _nt_fnumber if r6 r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true r0 = r6 else r7 = _nt_infin if r7 r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true r0 = r7 else r8 = _nt_simple if r8 r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true r0 = r8 else r9 = _nt_hstring if r9 r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true r0 = r9 else r10 = _nt_bstring if r10 r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true r0 = r10 else r11 = _nt_b64string if r11 r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true r0 = r11 else r12 = _nt_appstring if r12 r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true r0 = r12 else r13 = if r13 r13 = SyntaxNode.new(input, (index-1)...index) if r13 == true r0 = r13 else r14 = _nt_streamstring if r14 r14 = SyntaxNode.new(input, (index-1)...index) if r14 == true r0 = r14 else @index = i0 r0 = nil end end end end end end end end end end end end end end node_cache[:value][start_index] = r0 r0 end |