Module: Bayesnet::Parsers::Bif
Defined Under Namespace
Modules: CompilationUnit0, CompilationUnit1, DECIMALLITERAL0, EXPONENT0, FLOATINGPOINTLITERAL0, FLOATINGPOINTLITERAL1, FLOATINGPOINTLITERAL2, FloatingPointList0, FloatingPointList1, FloatingPointList2, FloatingPointToken0, NetworkContent0, NetworkContent1, NetworkDeclaration0, PROPERTYSTRING0, ProbabilityContent0, ProbabilityContent1, ProbabilityContent2, ProbabilityDeclaration0, ProbabilityDeclaration1, ProbabilityDefaultEntry0, ProbabilityDefaultEntry1, ProbabilityEntry0, ProbabilityEntry1, ProbabilityTable0, ProbabilityTable1, ProbabilityValuesList0, ProbabilityValuesList1, ProbabilityValuesList2, ProbabilityVariableName0, ProbabilityVariableValue0, ProbabilityVariablesList0, ProbabilityVariablesList1, ProbabilityVariablesList2, VariableContent0, VariableContent1, VariableContent2, VariableDeclaration0, VariableDeclaration1, VariableDiscrete0, VariableDiscrete1, VariableValuesList0, VariableValuesList1, VariableValuesList2, WORD0
Instance Method Summary collapse
- #_nt_CompilationUnit ⇒ Object
- #_nt_DECIMAL_LITERAL ⇒ Object
- #_nt_DEFAULTVALUE ⇒ Object
- #_nt_DIGIT ⇒ Object
- #_nt_DISCRETE ⇒ Object
- #_nt_EXPONENT ⇒ Object
- #_nt_FLOATING_POINT_LITERAL ⇒ Object
- #_nt_floatingPointList ⇒ Object
- #_nt_floatingPointToken ⇒ Object
- #_nt_LETTER ⇒ Object
- #_nt_NETWORK ⇒ Object
- #_nt_NetworkContent ⇒ Object
- #_nt_NetworkDeclaration ⇒ Object
- #_nt_PROBABILITY ⇒ Object
- #_nt_probabilityContent ⇒ Object
- #_nt_ProbabilityDeclaration ⇒ Object
- #_nt_ProbabilityDefaultEntry ⇒ Object
- #_nt_ProbabilityEntry ⇒ Object
- #_nt_ProbabilityTable ⇒ Object
- #_nt_probabilityValuesList ⇒ Object
- #_nt_probabilityVariableName ⇒ Object
- #_nt_probabilityVariablesList ⇒ Object
- #_nt_probabilityVariableValue ⇒ Object
- #_nt_PROPERTY ⇒ Object
- #_nt_Property ⇒ Object
- #_nt_PROPERTYSTRING ⇒ Object
- #_nt_SEP ⇒ Object
- #_nt_TABLEVALUE ⇒ Object
- #_nt_VALUE ⇒ Object
- #_nt_VARIABLE ⇒ Object
- #_nt_variableContent ⇒ Object
- #_nt_VariableDeclaration ⇒ Object
- #_nt_variableDiscrete ⇒ Object
- #_nt_VARIABLETYPE ⇒ Object
- #_nt_variableValuesList ⇒ Object
- #_nt_WORD ⇒ Object
- #root ⇒ Object
Methods included from Builder
Instance Method Details
#_nt_CompilationUnit ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 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 |
# File 'lib/bayesnet/parsers/bif.rb', line 45 def _nt_CompilationUnit start_index = index if node_cache[:CompilationUnit].has_key?(index) cached = node_cache[:CompilationUnit][index] if cached node_cache[:CompilationUnit][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_SEP s0 << r1 if r1 r2 = _nt_NetworkDeclaration s0 << r2 if r2 s3, i3 = [], index loop do i4 = index r5 = _nt_VariableDeclaration if r5 r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true r4 = r5 else r6 = _nt_ProbabilityDeclaration if r6 r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true r4 = r6 else @index = i4 r4 = nil end end if r4 s3 << r4 else break end end r3 = instantiate_node(SyntaxNode,input, i3...index, s3) s0 << r3 if r3 r7 = _nt_SEP s0 << r7 end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(CompilationUnit0) r0.extend(CompilationUnit1) else @index = i0 r0 = nil end node_cache[:CompilationUnit][start_index] = r0 r0 end |
#_nt_DECIMAL_LITERAL ⇒ Object
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 |
# File 'lib/bayesnet/parsers/bif.rb', line 2098 def _nt_DECIMAL_LITERAL start_index = index if node_cache[:DECIMAL_LITERAL].has_key?(index) cached = node_cache[:DECIMAL_LITERAL][index] if cached node_cache[:DECIMAL_LITERAL][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_DIGIT s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_DIGIT if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(DECIMALLITERAL0) else @index = i0 r0 = nil end node_cache[:DECIMAL_LITERAL][start_index] = r0 r0 end |
#_nt_DEFAULTVALUE ⇒ Object
1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 |
# File 'lib/bayesnet/parsers/bif.rb', line 1896 def _nt_DEFAULTVALUE start_index = index if node_cache[:DEFAULTVALUE].has_key?(index) cached = node_cache[:DEFAULTVALUE][index] if cached node_cache[:DEFAULTVALUE][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('default', false, index)) r0 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'default\'') r0 = nil end node_cache[:DEFAULTVALUE][start_index] = r0 r0 end |
#_nt_DIGIT ⇒ Object
2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 |
# File 'lib/bayesnet/parsers/bif.rb', line 2067 def _nt_DIGIT start_index = index if node_cache[:DIGIT].has_key?(index) cached = node_cache[:DIGIT][index] if cached node_cache[:DIGIT][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if has_terminal?(@regexps[gr = '\A[0-9]'] ||= Regexp.new(gr), :regexp, index) r0 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('[0-9]') r0 = nil end node_cache[:DIGIT][start_index] = r0 r0 end |
#_nt_DISCRETE ⇒ Object
1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 |
# File 'lib/bayesnet/parsers/bif.rb', line 1872 def _nt_DISCRETE start_index = index if node_cache[:DISCRETE].has_key?(index) cached = node_cache[:DISCRETE][index] if cached node_cache[:DISCRETE][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('discrete', false, index)) r0 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'discrete\'') r0 = nil end node_cache[:DISCRETE][start_index] = r0 r0 end |
#_nt_EXPONENT ⇒ Object
2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 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 |
# File 'lib/bayesnet/parsers/bif.rb', line 2315 def _nt_EXPONENT start_index = index if node_cache[:EXPONENT].has_key?(index) cached = node_cache[:EXPONENT][index] if cached node_cache[:EXPONENT][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[eE]'] ||= Regexp.new(gr), :regexp, index) r1 = true @index += 1 else terminal_parse_failure('[eE]') r1 = nil end s0 << r1 if r1 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 s0 << r2 if r2 s4, i4 = [], index loop do r5 = _nt_DIGIT 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 s0 << r4 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(EXPONENT0) else @index = i0 r0 = nil end node_cache[:EXPONENT][start_index] = r0 r0 end |
#_nt_FLOATING_POINT_LITERAL ⇒ Object
2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 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 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 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 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 |
# File 'lib/bayesnet/parsers/bif.rb', line 2150 def _nt_FLOATING_POINT_LITERAL start_index = index if node_cache[:FLOATING_POINT_LITERAL].has_key?(index) cached = node_cache[:FLOATING_POINT_LITERAL][index] if cached node_cache[:FLOATING_POINT_LITERAL][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index i1, s1 = index, [] s2, i2 = [], index loop do r3 = _nt_DIGIT if r3 s2 << r3 else break end end if s2.empty? @index = i2 r2 = nil else r2 = instantiate_node(SyntaxNode,input, i2...index, s2) end s1 << r2 if r2 if (match_len = has_terminal?('.', false, index)) r4 = true @index += match_len else terminal_parse_failure('\'.\'') r4 = nil end s1 << r4 if r4 s5, i5 = [], index loop do r6 = _nt_DIGIT if r6 s5 << r6 else break end end r5 = instantiate_node(SyntaxNode,input, i5...index, s5) s1 << r5 if r5 r8 = _nt_EXPONENT if r8 r7 = r8 else r7 = instantiate_node(SyntaxNode,input, index...index) end s1 << r7 end end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(FLOATINGPOINTLITERAL0) else @index = i1 r1 = nil end if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else i9, s9 = index, [] if (match_len = has_terminal?('.', false, index)) r10 = true @index += match_len else terminal_parse_failure('\'.\'') r10 = nil end s9 << r10 if r10 s11, i11 = [], index loop do r12 = _nt_DIGIT if r12 s11 << r12 else break end end if s11.empty? @index = i11 r11 = nil else r11 = instantiate_node(SyntaxNode,input, i11...index, s11) end s9 << r11 if r11 r14 = _nt_EXPONENT if r14 r13 = r14 else r13 = instantiate_node(SyntaxNode,input, index...index) end s9 << r13 end end if s9.last r9 = instantiate_node(SyntaxNode,input, i9...index, s9) r9.extend(FLOATINGPOINTLITERAL1) else @index = i9 r9 = nil end if r9 r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true r0 = r9 else i15, s15 = index, [] s16, i16 = [], index loop do r17 = _nt_DIGIT 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 s15 << r16 if r16 r18 = _nt_EXPONENT s15 << r18 end if s15.last r15 = instantiate_node(SyntaxNode,input, i15...index, s15) r15.extend(FLOATINGPOINTLITERAL2) else @index = i15 r15 = nil end if r15 r15 = SyntaxNode.new(input, (index-1)...index) if r15 == true r0 = r15 else @index = i0 r0 = nil end end end node_cache[:FLOATING_POINT_LITERAL][start_index] = r0 r0 end |
#_nt_floatingPointList ⇒ Object
1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 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 |
# File 'lib/bayesnet/parsers/bif.rb', line 1650 def _nt_floatingPointList start_index = index if node_cache[:floatingPointList].has_key?(index) cached = node_cache[:floatingPointList][index] if cached node_cache[:floatingPointList][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_SEP s0 << r1 if r1 r2 = _nt_floatingPointToken s0 << r2 if r2 s3, i3 = [], index loop do i4, s4 = index, [] r5 = _nt_SEP s4 << r5 if r5 r6 = _nt_floatingPointToken s4 << r6 end if s4.last r4 = instantiate_node(SyntaxNode,input, i4...index, s4) r4.extend(FloatingPointList0) 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 end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(FloatingPointList1) r0.extend(FloatingPointList2) else @index = i0 r0 = nil end node_cache[:floatingPointList][start_index] = r0 r0 end |
#_nt_floatingPointToken ⇒ Object
1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 |
# File 'lib/bayesnet/parsers/bif.rb', line 1714 def _nt_floatingPointToken start_index = index if node_cache[:floatingPointToken].has_key?(index) cached = node_cache[:floatingPointToken][index] if cached node_cache[:floatingPointToken][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end r0 = _nt_FLOATING_POINT_LITERAL r0.extend(FloatingPointToken0) r0.extend(FloatingPointToken0) node_cache[:floatingPointToken][start_index] = r0 r0 end |
#_nt_LETTER ⇒ Object
2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 |
# File 'lib/bayesnet/parsers/bif.rb', line 2005 def _nt_LETTER start_index = index if node_cache[:LETTER].has_key?(index) cached = node_cache[:LETTER][index] if cached node_cache[:LETTER][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if has_terminal?(@regexps[gr = '\A[a-zA-Z_-]'] ||= Regexp.new(gr), :regexp, index) r0 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('[a-zA-Z_-]') r0 = nil end node_cache[:LETTER][start_index] = r0 r0 end |
#_nt_NETWORK ⇒ Object
1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 |
# File 'lib/bayesnet/parsers/bif.rb', line 1752 def _nt_NETWORK start_index = index if node_cache[:NETWORK].has_key?(index) cached = node_cache[:NETWORK][index] if cached node_cache[:NETWORK][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('network', false, index)) r0 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'network\'') r0 = nil end node_cache[:NETWORK][start_index] = r0 r0 end |
#_nt_NetworkContent ⇒ Object
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 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
# File 'lib/bayesnet/parsers/bif.rb', line 213 def _nt_NetworkContent start_index = index if node_cache[:NetworkContent].has_key?(index) cached = node_cache[:NetworkContent][index] if cached node_cache[:NetworkContent][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_SEP s0 << r1 if r1 if (match_len = has_terminal?("{", false, index)) r2 = true @index += match_len else terminal_parse_failure('"{"') r2 = nil end s0 << r2 if r2 s3, i3 = [], index loop do i4, s4 = index, [] r5 = _nt_SEP s4 << r5 if r5 r6 = _nt_Property s4 << r6 end if s4.last r4 = instantiate_node(SyntaxNode,input, i4...index, s4) r4.extend(NetworkContent0) else @index = i4 r4 = nil end if r4 s3 << r4 else break end end r3 = instantiate_node(SyntaxNode,input, i3...index, s3) s0 << r3 if r3 r7 = _nt_SEP s0 << r7 if r7 if (match_len = has_terminal?("}", false, index)) r8 = true @index += match_len else terminal_parse_failure('"}"') r8 = nil end s0 << r8 if r8 r9 = _nt_SEP s0 << r9 end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(NetworkContent1) else @index = i0 r0 = nil end node_cache[:NetworkContent][start_index] = r0 r0 end |
#_nt_NetworkDeclaration ⇒ Object
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 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 |
# File 'lib/bayesnet/parsers/bif.rb', line 138 def _nt_NetworkDeclaration start_index = index if node_cache[:NetworkDeclaration].has_key?(index) cached = node_cache[:NetworkDeclaration][index] if cached node_cache[:NetworkDeclaration][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_SEP s0 << r1 if r1 r2 = _nt_NETWORK s0 << r2 if r2 r3 = _nt_SEP s0 << r3 if r3 r4 = _nt_WORD s0 << r4 if r4 r5 = _nt_SEP s0 << r5 if r5 r6 = _nt_NetworkContent s0 << r6 if r6 r7 = _nt_SEP s0 << r7 end end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(NetworkDeclaration0) else @index = i0 r0 = nil end node_cache[:NetworkDeclaration][start_index] = r0 r0 end |
#_nt_PROBABILITY ⇒ Object
1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 |
# File 'lib/bayesnet/parsers/bif.rb', line 1800 def _nt_PROBABILITY start_index = index if node_cache[:PROBABILITY].has_key?(index) cached = node_cache[:PROBABILITY][index] if cached node_cache[:PROBABILITY][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('probability', false, index)) r0 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'probability\'') r0 = nil end node_cache[:PROBABILITY][start_index] = r0 r0 end |
#_nt_probabilityContent ⇒ Object
1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 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 |
# File 'lib/bayesnet/parsers/bif.rb', line 1126 def _nt_probabilityContent start_index = index if node_cache[:probabilityContent].has_key?(index) cached = node_cache[:probabilityContent][index] if cached node_cache[:probabilityContent][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_SEP s0 << r1 if r1 if (match_len = has_terminal?("{", false, index)) r2 = true @index += match_len else terminal_parse_failure('"{"') r2 = nil end s0 << r2 if r2 r3 = _nt_SEP s0 << r3 if r3 s4, i4 = [], index loop do i5 = index i6, s6 = index, [] r7 = _nt_SEP s6 << r7 if r7 r8 = _nt_Property s6 << r8 end if s6.last r6 = instantiate_node(SyntaxNode,input, i6...index, s6) r6.extend(ProbabilityContent0) else @index = i6 r6 = nil end if r6 r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true r5 = r6 else r9 = _nt_ProbabilityDefaultEntry if r9 r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true r5 = r9 else r10 = _nt_ProbabilityEntry if r10 r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true r5 = r10 else r11 = _nt_ProbabilityTable if r11 r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true r5 = r11 else @index = i5 r5 = nil end end end end if r5 s4 << r5 else break end end r4 = instantiate_node(SyntaxNode,input, i4...index, s4) s0 << r4 if r4 r12 = _nt_SEP s0 << r12 if r12 if (match_len = has_terminal?("}", false, index)) r13 = true @index += match_len else terminal_parse_failure('"}"') r13 = nil end s0 << r13 if r13 r14 = _nt_SEP s0 << r14 end end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(ProbabilityContent1) r0.extend(ProbabilityContent2) else @index = i0 r0 = nil end node_cache[:probabilityContent][start_index] = r0 r0 end |
#_nt_ProbabilityDeclaration ⇒ Object
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 |
# File 'lib/bayesnet/parsers/bif.rb', line 859 def _nt_ProbabilityDeclaration start_index = index if node_cache[:ProbabilityDeclaration].has_key?(index) cached = node_cache[:ProbabilityDeclaration][index] if cached node_cache[:ProbabilityDeclaration][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_SEP s0 << r1 if r1 r2 = _nt_PROBABILITY s0 << r2 if r2 r3 = _nt_SEP s0 << r3 if r3 r4 = _nt_probabilityVariablesList s0 << r4 if r4 r5 = _nt_SEP s0 << r5 if r5 r6 = _nt_probabilityContent s0 << r6 if r6 r7 = _nt_SEP s0 << r7 end end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(ProbabilityDeclaration0) r0.extend(ProbabilityDeclaration1) else @index = i0 r0 = nil end node_cache[:ProbabilityDeclaration][start_index] = r0 r0 end |
#_nt_ProbabilityDefaultEntry ⇒ Object
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 1527 1528 |
# File 'lib/bayesnet/parsers/bif.rb', line 1480 def _nt_ProbabilityDefaultEntry start_index = index if node_cache[:ProbabilityDefaultEntry].has_key?(index) cached = node_cache[:ProbabilityDefaultEntry][index] if cached node_cache[:ProbabilityDefaultEntry][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_SEP s0 << r1 if r1 r2 = _nt_floatingPointList s0 << r2 if r2 r3 = _nt_SEP s0 << r3 if r3 if (match_len = has_terminal?(";", false, index)) r4 = true @index += match_len else terminal_parse_failure('";"') r4 = nil end s0 << r4 if r4 r5 = _nt_SEP s0 << r5 end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(ProbabilityDefaultEntry0) r0.extend(ProbabilityDefaultEntry1) else @index = i0 r0 = nil end node_cache[:ProbabilityDefaultEntry][start_index] = r0 r0 end |
#_nt_ProbabilityEntry ⇒ Object
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 |
# File 'lib/bayesnet/parsers/bif.rb', line 1273 def _nt_ProbabilityEntry start_index = index if node_cache[:ProbabilityEntry].has_key?(index) cached = node_cache[:ProbabilityEntry][index] if cached node_cache[:ProbabilityEntry][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_SEP s0 << r1 if r1 r2 = _nt_probabilityValuesList s0 << r2 if r2 r3 = _nt_SEP s0 << r3 if r3 r4 = _nt_floatingPointList s0 << r4 if r4 r5 = _nt_SEP s0 << r5 if r5 if (match_len = has_terminal?(";", false, index)) r6 = true @index += match_len else terminal_parse_failure('";"') r6 = nil end s0 << r6 if r6 r7 = _nt_SEP s0 << r7 end end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(ProbabilityEntry0) r0.extend(ProbabilityEntry1) else @index = i0 r0 = nil end node_cache[:ProbabilityEntry][start_index] = r0 r0 end |
#_nt_ProbabilityTable ⇒ Object
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 |
# File 'lib/bayesnet/parsers/bif.rb', line 1562 def _nt_ProbabilityTable start_index = index if node_cache[:ProbabilityTable].has_key?(index) cached = node_cache[:ProbabilityTable][index] if cached node_cache[:ProbabilityTable][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_SEP s0 << r1 if r1 r2 = _nt_TABLEVALUE s0 << r2 if r2 r3 = _nt_SEP s0 << r3 if r3 r4 = _nt_floatingPointList s0 << r4 if r4 r5 = _nt_SEP s0 << r5 if r5 if (match_len = has_terminal?(";", false, index)) r6 = true @index += match_len else terminal_parse_failure('";"') r6 = nil end s0 << r6 if r6 r7 = _nt_SEP s0 << r7 end end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(ProbabilityTable0) r0.extend(ProbabilityTable1) else @index = i0 r0 = nil end node_cache[:ProbabilityTable][start_index] = r0 r0 end |
#_nt_probabilityValuesList ⇒ Object
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 |
# File 'lib/bayesnet/parsers/bif.rb', line 1370 def _nt_probabilityValuesList start_index = index if node_cache[:probabilityValuesList].has_key?(index) cached = node_cache[:probabilityValuesList][index] if cached node_cache[:probabilityValuesList][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_SEP s0 << r1 if r1 if (match_len = has_terminal?("(", false, index)) r2 = true @index += match_len else terminal_parse_failure('"("') r2 = nil end s0 << r2 if r2 r3 = _nt_SEP s0 << r3 if r3 r4 = _nt_probabilityVariableValue s0 << r4 if r4 s5, i5 = [], index loop do i6, s6 = index, [] r7 = _nt_SEP s6 << r7 if r7 r8 = _nt_probabilityVariableValue s6 << r8 end if s6.last r6 = instantiate_node(SyntaxNode,input, i6...index, s6) r6.extend(ProbabilityValuesList0) else @index = i6 r6 = nil end if r6 s5 << r6 else break end end r5 = instantiate_node(SyntaxNode,input, i5...index, s5) s0 << r5 if r5 r9 = _nt_SEP s0 << r9 if r9 if (match_len = has_terminal?(")", false, index)) r10 = true @index += match_len else terminal_parse_failure('")"') r10 = nil end s0 << r10 end end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(ProbabilityValuesList1) r0.extend(ProbabilityValuesList2) else @index = i0 r0 = nil end node_cache[:probabilityValuesList][start_index] = r0 r0 end |
#_nt_probabilityVariableName ⇒ Object
1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 |
# File 'lib/bayesnet/parsers/bif.rb', line 1053 def _nt_probabilityVariableName start_index = index if node_cache[:probabilityVariableName].has_key?(index) cached = node_cache[:probabilityVariableName][index] if cached node_cache[:probabilityVariableName][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end r0 = _nt_WORD r0.extend(ProbabilityVariableName0) r0.extend(ProbabilityVariableName0) node_cache[:probabilityVariableName][start_index] = r0 r0 end |
#_nt_probabilityVariablesList ⇒ Object
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 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 |
# File 'lib/bayesnet/parsers/bif.rb', line 957 def _nt_probabilityVariablesList start_index = index if node_cache[:probabilityVariablesList].has_key?(index) cached = node_cache[:probabilityVariablesList][index] if cached node_cache[:probabilityVariablesList][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_SEP s0 << r1 if r1 if (match_len = has_terminal?("(", false, index)) r2 = true @index += match_len else terminal_parse_failure('"("') r2 = nil end s0 << r2 if r2 r3 = _nt_SEP s0 << r3 if r3 r4 = _nt_probabilityVariableName s0 << r4 if r4 s5, i5 = [], index loop do i6, s6 = index, [] r7 = _nt_SEP s6 << r7 if r7 r8 = _nt_probabilityVariableName s6 << r8 end if s6.last r6 = instantiate_node(SyntaxNode,input, i6...index, s6) r6.extend(ProbabilityVariablesList0) else @index = i6 r6 = nil end if r6 s5 << r6 else break end end r5 = instantiate_node(SyntaxNode,input, i5...index, s5) s0 << r5 if r5 r9 = _nt_SEP s0 << r9 if r9 if (match_len = has_terminal?(")", false, index)) r10 = true @index += match_len else terminal_parse_failure('")"') r10 = nil end s0 << r10 if r10 r11 = _nt_SEP s0 << r11 end end end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(ProbabilityVariablesList1) r0.extend(ProbabilityVariablesList2) else @index = i0 r0 = nil end node_cache[:probabilityVariablesList][start_index] = r0 r0 end |
#_nt_probabilityVariableValue ⇒ Object
801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 |
# File 'lib/bayesnet/parsers/bif.rb', line 801 def _nt_probabilityVariableValue start_index = index if node_cache[:probabilityVariableValue].has_key?(index) cached = node_cache[:probabilityVariableValue][index] if cached node_cache[:probabilityVariableValue][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end r0 = _nt_VALUE r0.extend(ProbabilityVariableValue0) r0.extend(ProbabilityVariableValue0) node_cache[:probabilityVariableValue][start_index] = r0 r0 end |
#_nt_PROPERTY ⇒ Object
1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 |
# File 'lib/bayesnet/parsers/bif.rb', line 1824 def _nt_PROPERTY start_index = index if node_cache[:PROPERTY].has_key?(index) cached = node_cache[:PROPERTY][index] if cached node_cache[:PROPERTY][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('property', false, index)) r0 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'property\'') r0 = nil end node_cache[:PROPERTY][start_index] = r0 r0 end |
#_nt_Property ⇒ Object
1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 |
# File 'lib/bayesnet/parsers/bif.rb', line 1734 def _nt_Property start_index = index if node_cache[:Property].has_key?(index) cached = node_cache[:Property][index] if cached node_cache[:Property][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end r0 = _nt_PROPERTYSTRING node_cache[:Property][start_index] = r0 r0 end |
#_nt_PROPERTYSTRING ⇒ Object
2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 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 2439 2440 2441 2442 |
# File 'lib/bayesnet/parsers/bif.rb', line 2388 def _nt_PROPERTYSTRING start_index = index if node_cache[:PROPERTYSTRING].has_key?(index) cached = node_cache[:PROPERTYSTRING][index] if cached node_cache[:PROPERTYSTRING][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_PROPERTY s0 << r1 if r1 s2, i2 = [], index loop do if index < input_length r3 = true @index += 1 else terminal_parse_failure("any character") r3 = nil end 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(PROPERTYSTRING0) else @index = i0 r0 = nil end node_cache[:PROPERTYSTRING][start_index] = r0 r0 end |
#_nt_SEP ⇒ Object
2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 |
# File 'lib/bayesnet/parsers/bif.rb', line 2444 def _nt_SEP start_index = index if node_cache[:SEP].has_key?(index) cached = node_cache[:SEP][index] if cached node_cache[:SEP][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end s0, i0 = [], index loop do if has_terminal?(@regexps[gr = '\A[\\r\\n\\t ,|]'] ||= Regexp.new(gr), :regexp, index) r1 = true @index += 1 else terminal_parse_failure('[\\r\\n\\t ,|]') r1 = nil end if r1 s0 << r1 else break end end r0 = instantiate_node(SyntaxNode,input, i0...index, s0) node_cache[:SEP][start_index] = r0 r0 end |
#_nt_TABLEVALUE ⇒ Object
1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 |
# File 'lib/bayesnet/parsers/bif.rb', line 1920 def _nt_TABLEVALUE start_index = index if node_cache[:TABLEVALUE].has_key?(index) cached = node_cache[:TABLEVALUE][index] if cached node_cache[:TABLEVALUE][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('table', false, index)) r0 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'table\'') r0 = nil end node_cache[:TABLEVALUE][start_index] = r0 r0 end |
#_nt_VALUE ⇒ Object
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 |
# File 'lib/bayesnet/parsers/bif.rb', line 2029 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 s0, i0 = [], index loop do if has_terminal?(@regexps[gr = '\A[/<>=.+a-zA-Z_0-9-]'] ||= Regexp.new(gr), :regexp, index) r1 = true @index += 1 else terminal_parse_failure('[/<>=.+a-zA-Z_0-9-]') r1 = nil end if r1 s0 << r1 else break end end if s0.empty? @index = i0 r0 = nil else r0 = instantiate_node(SyntaxNode,input, i0...index, s0) end node_cache[:VALUE][start_index] = r0 r0 end |
#_nt_VARIABLE ⇒ Object
1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 |
# File 'lib/bayesnet/parsers/bif.rb', line 1776 def _nt_VARIABLE start_index = index if node_cache[:VARIABLE].has_key?(index) cached = node_cache[:VARIABLE][index] if cached node_cache[:VARIABLE][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('variable', false, index)) r0 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'variable\'') r0 = nil end node_cache[:VARIABLE][start_index] = r0 r0 end |
#_nt_variableContent ⇒ Object
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 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 |
# File 'lib/bayesnet/parsers/bif.rb', line 417 def _nt_variableContent start_index = index if node_cache[:variableContent].has_key?(index) cached = node_cache[:variableContent][index] if cached node_cache[:variableContent][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_SEP s0 << r1 if r1 if (match_len = has_terminal?("{", false, index)) r2 = true @index += match_len else terminal_parse_failure('"{"') r2 = nil end s0 << r2 if r2 s3, i3 = [], index loop do i4 = index i5, s5 = index, [] r6 = _nt_SEP s5 << r6 if r6 r7 = _nt_Property s5 << r7 end if s5.last r5 = instantiate_node(SyntaxNode,input, i5...index, s5) r5.extend(VariableContent0) else @index = i5 r5 = nil end if r5 r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true r4 = r5 else r8 = _nt_variableDiscrete if r8 r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true r4 = r8 else @index = i4 r4 = nil end end if r4 s3 << r4 else break end end r3 = instantiate_node(SyntaxNode,input, i3...index, s3) s0 << r3 if r3 r9 = _nt_SEP s0 << r9 if r9 if (match_len = has_terminal?("}", false, index)) r10 = true @index += match_len else terminal_parse_failure('"}"') r10 = nil end s0 << r10 if r10 r11 = _nt_SEP s0 << r11 end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(VariableContent1) r0.extend(VariableContent2) else @index = i0 r0 = nil end node_cache[:variableContent][start_index] = r0 r0 end |
#_nt_VariableDeclaration ⇒ Object
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 |
# File 'lib/bayesnet/parsers/bif.rb', line 331 def _nt_VariableDeclaration start_index = index if node_cache[:VariableDeclaration].has_key?(index) cached = node_cache[:VariableDeclaration][index] if cached node_cache[:VariableDeclaration][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_SEP s0 << r1 if r1 r2 = _nt_VARIABLE s0 << r2 if r2 r3 = _nt_SEP s0 << r3 if r3 r4 = _nt_probabilityVariableName s0 << r4 if r4 r5 = _nt_SEP s0 << r5 if r5 r6 = _nt_variableContent s0 << r6 if r6 r7 = _nt_SEP s0 << r7 end end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(VariableDeclaration0) r0.extend(VariableDeclaration1) else @index = i0 r0 = nil end node_cache[:VariableDeclaration][start_index] = r0 r0 end |
#_nt_variableDiscrete ⇒ Object
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 704 705 |
# File 'lib/bayesnet/parsers/bif.rb', line 577 def _nt_variableDiscrete start_index = index if node_cache[:variableDiscrete].has_key?(index) cached = node_cache[:variableDiscrete][index] if cached node_cache[:variableDiscrete][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_SEP s0 << r1 if r1 r2 = _nt_VARIABLETYPE s0 << r2 if r2 r3 = _nt_SEP s0 << r3 if r3 r4 = _nt_DISCRETE s0 << r4 if r4 r5 = _nt_SEP s0 << r5 if r5 if (match_len = has_terminal?("[", false, index)) r6 = true @index += match_len else terminal_parse_failure('"["') r6 = nil end s0 << r6 if r6 r7 = _nt_SEP s0 << r7 if r7 r8 = _nt_DECIMAL_LITERAL s0 << r8 if r8 r9 = _nt_SEP s0 << r9 if r9 if (match_len = has_terminal?("]", false, index)) r10 = true @index += match_len else terminal_parse_failure('"]"') r10 = nil end s0 << r10 if r10 r11 = _nt_SEP s0 << r11 if r11 if (match_len = has_terminal?("{", false, index)) r12 = true @index += match_len else terminal_parse_failure('"{"') r12 = nil end s0 << r12 if r12 r13 = _nt_SEP s0 << r13 if r13 r14 = _nt_variableValuesList s0 << r14 if r14 r15 = _nt_SEP s0 << r15 if r15 if (match_len = has_terminal?("}", false, index)) r16 = true @index += match_len else terminal_parse_failure('"}"') r16 = nil end s0 << r16 if r16 r17 = _nt_SEP s0 << r17 if r17 if (match_len = has_terminal?(";", false, index)) r18 = true @index += match_len else terminal_parse_failure('";"') r18 = nil end s0 << r18 if r18 r19 = _nt_SEP s0 << r19 end end end end end end end end end end end end end end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(VariableDiscrete0) r0.extend(VariableDiscrete1) else @index = i0 r0 = nil end node_cache[:variableDiscrete][start_index] = r0 r0 end |
#_nt_VARIABLETYPE ⇒ Object
1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 |
# File 'lib/bayesnet/parsers/bif.rb', line 1848 def _nt_VARIABLETYPE start_index = index if node_cache[:VARIABLETYPE].has_key?(index) cached = node_cache[:VARIABLETYPE][index] if cached node_cache[:VARIABLETYPE][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('type', false, index)) r0 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'type\'') r0 = nil end node_cache[:VARIABLETYPE][start_index] = r0 r0 end |
#_nt_variableValuesList ⇒ Object
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 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 |
# File 'lib/bayesnet/parsers/bif.rb', line 737 def _nt_variableValuesList start_index = index if node_cache[:variableValuesList].has_key?(index) cached = node_cache[:variableValuesList][index] if cached node_cache[:variableValuesList][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_SEP s0 << r1 if r1 r2 = _nt_probabilityVariableValue s0 << r2 if r2 s3, i3 = [], index loop do i4, s4 = index, [] r5 = _nt_SEP s4 << r5 if r5 r6 = _nt_probabilityVariableValue s4 << r6 end if s4.last r4 = instantiate_node(SyntaxNode,input, i4...index, s4) r4.extend(VariableValuesList0) 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 end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(VariableValuesList1) r0.extend(VariableValuesList2) else @index = i0 r0 = nil end node_cache[:variableValuesList][start_index] = r0 r0 end |
#_nt_WORD ⇒ Object
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 |
# File 'lib/bayesnet/parsers/bif.rb', line 1951 def _nt_WORD start_index = index if node_cache[:WORD].has_key?(index) cached = node_cache[:WORD][index] if cached node_cache[:WORD][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_LETTER s0 << r1 if r1 s2, i2 = [], index loop do i3 = index r4 = _nt_LETTER if r4 r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true r3 = r4 else r5 = _nt_DIGIT if r5 r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true r3 = r5 else @index = i3 r3 = nil end end if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(WORD0) else @index = i0 r0 = nil end node_cache[:WORD][start_index] = r0 r0 end |
#root ⇒ Object
11 12 13 |
# File 'lib/bayesnet/parsers/bif.rb', line 11 def root @root ||= :CompilationUnit end |