productionstable.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. // Code generated by gocc; DO NOT EDIT.
  2. package parser
  3. import "github.com/awalterschulze/gographviz/ast"
  4. type (
  5. //TODO: change type and variable names to be consistent with other tables
  6. ProdTab [numProductions]ProdTabEntry
  7. ProdTabEntry struct {
  8. String string
  9. Id string
  10. NTType int
  11. Index int
  12. NumSymbols int
  13. ReduceFunc func([]Attrib) (Attrib, error)
  14. }
  15. Attrib interface {
  16. }
  17. )
  18. var productionsTable = ProdTab{
  19. ProdTabEntry{
  20. String: `S' : DotGraph << >>`,
  21. Id: "S'",
  22. NTType: 0,
  23. Index: 0,
  24. NumSymbols: 1,
  25. ReduceFunc: func(X []Attrib) (Attrib, error) {
  26. return X[0], nil
  27. },
  28. },
  29. ProdTabEntry{
  30. String: `DotGraph : graphx "{" "}" << ast.NewGraph(ast.GRAPH, ast.FALSE, nil, nil) >>`,
  31. Id: "DotGraph",
  32. NTType: 1,
  33. Index: 1,
  34. NumSymbols: 3,
  35. ReduceFunc: func(X []Attrib) (Attrib, error) {
  36. return ast.NewGraph(ast.GRAPH, ast.FALSE, nil, nil)
  37. },
  38. },
  39. ProdTabEntry{
  40. String: `DotGraph : strict graphx "{" "}" << ast.NewGraph(ast.GRAPH, ast.TRUE, nil, nil) >>`,
  41. Id: "DotGraph",
  42. NTType: 1,
  43. Index: 2,
  44. NumSymbols: 4,
  45. ReduceFunc: func(X []Attrib) (Attrib, error) {
  46. return ast.NewGraph(ast.GRAPH, ast.TRUE, nil, nil)
  47. },
  48. },
  49. ProdTabEntry{
  50. String: `DotGraph : graphx Id "{" "}" << ast.NewGraph(ast.GRAPH, ast.FALSE, X[1], nil) >>`,
  51. Id: "DotGraph",
  52. NTType: 1,
  53. Index: 3,
  54. NumSymbols: 4,
  55. ReduceFunc: func(X []Attrib) (Attrib, error) {
  56. return ast.NewGraph(ast.GRAPH, ast.FALSE, X[1], nil)
  57. },
  58. },
  59. ProdTabEntry{
  60. String: `DotGraph : strict graphx Id "{" "}" << ast.NewGraph(ast.GRAPH, ast.TRUE, X[2], nil) >>`,
  61. Id: "DotGraph",
  62. NTType: 1,
  63. Index: 4,
  64. NumSymbols: 5,
  65. ReduceFunc: func(X []Attrib) (Attrib, error) {
  66. return ast.NewGraph(ast.GRAPH, ast.TRUE, X[2], nil)
  67. },
  68. },
  69. ProdTabEntry{
  70. String: `DotGraph : graphx "{" StmtList "}" << ast.NewGraph(ast.GRAPH, ast.FALSE, nil, X[2]) >>`,
  71. Id: "DotGraph",
  72. NTType: 1,
  73. Index: 5,
  74. NumSymbols: 4,
  75. ReduceFunc: func(X []Attrib) (Attrib, error) {
  76. return ast.NewGraph(ast.GRAPH, ast.FALSE, nil, X[2])
  77. },
  78. },
  79. ProdTabEntry{
  80. String: `DotGraph : graphx Id "{" StmtList "}" << ast.NewGraph(ast.GRAPH, ast.FALSE, X[1], X[3]) >>`,
  81. Id: "DotGraph",
  82. NTType: 1,
  83. Index: 6,
  84. NumSymbols: 5,
  85. ReduceFunc: func(X []Attrib) (Attrib, error) {
  86. return ast.NewGraph(ast.GRAPH, ast.FALSE, X[1], X[3])
  87. },
  88. },
  89. ProdTabEntry{
  90. String: `DotGraph : strict graphx "{" StmtList "}" << ast.NewGraph(ast.GRAPH, ast.TRUE, nil, X[3]) >>`,
  91. Id: "DotGraph",
  92. NTType: 1,
  93. Index: 7,
  94. NumSymbols: 5,
  95. ReduceFunc: func(X []Attrib) (Attrib, error) {
  96. return ast.NewGraph(ast.GRAPH, ast.TRUE, nil, X[3])
  97. },
  98. },
  99. ProdTabEntry{
  100. String: `DotGraph : strict graphx Id "{" StmtList "}" << ast.NewGraph(ast.GRAPH, ast.TRUE, X[2], X[4]) >>`,
  101. Id: "DotGraph",
  102. NTType: 1,
  103. Index: 8,
  104. NumSymbols: 6,
  105. ReduceFunc: func(X []Attrib) (Attrib, error) {
  106. return ast.NewGraph(ast.GRAPH, ast.TRUE, X[2], X[4])
  107. },
  108. },
  109. ProdTabEntry{
  110. String: `DotGraph : digraph "{" "}" << ast.NewGraph(ast.DIGRAPH, ast.FALSE, nil, nil) >>`,
  111. Id: "DotGraph",
  112. NTType: 1,
  113. Index: 9,
  114. NumSymbols: 3,
  115. ReduceFunc: func(X []Attrib) (Attrib, error) {
  116. return ast.NewGraph(ast.DIGRAPH, ast.FALSE, nil, nil)
  117. },
  118. },
  119. ProdTabEntry{
  120. String: `DotGraph : strict digraph "{" "}" << ast.NewGraph(ast.DIGRAPH, ast.TRUE, nil, nil) >>`,
  121. Id: "DotGraph",
  122. NTType: 1,
  123. Index: 10,
  124. NumSymbols: 4,
  125. ReduceFunc: func(X []Attrib) (Attrib, error) {
  126. return ast.NewGraph(ast.DIGRAPH, ast.TRUE, nil, nil)
  127. },
  128. },
  129. ProdTabEntry{
  130. String: `DotGraph : digraph Id "{" "}" << ast.NewGraph(ast.DIGRAPH, ast.FALSE, X[1], nil) >>`,
  131. Id: "DotGraph",
  132. NTType: 1,
  133. Index: 11,
  134. NumSymbols: 4,
  135. ReduceFunc: func(X []Attrib) (Attrib, error) {
  136. return ast.NewGraph(ast.DIGRAPH, ast.FALSE, X[1], nil)
  137. },
  138. },
  139. ProdTabEntry{
  140. String: `DotGraph : strict digraph Id "{" "}" << ast.NewGraph(ast.DIGRAPH, ast.TRUE, X[2], nil) >>`,
  141. Id: "DotGraph",
  142. NTType: 1,
  143. Index: 12,
  144. NumSymbols: 5,
  145. ReduceFunc: func(X []Attrib) (Attrib, error) {
  146. return ast.NewGraph(ast.DIGRAPH, ast.TRUE, X[2], nil)
  147. },
  148. },
  149. ProdTabEntry{
  150. String: `DotGraph : digraph "{" StmtList "}" << ast.NewGraph(ast.DIGRAPH, ast.FALSE, nil, X[2]) >>`,
  151. Id: "DotGraph",
  152. NTType: 1,
  153. Index: 13,
  154. NumSymbols: 4,
  155. ReduceFunc: func(X []Attrib) (Attrib, error) {
  156. return ast.NewGraph(ast.DIGRAPH, ast.FALSE, nil, X[2])
  157. },
  158. },
  159. ProdTabEntry{
  160. String: `DotGraph : digraph Id "{" StmtList "}" << ast.NewGraph(ast.DIGRAPH, ast.FALSE, X[1], X[3]) >>`,
  161. Id: "DotGraph",
  162. NTType: 1,
  163. Index: 14,
  164. NumSymbols: 5,
  165. ReduceFunc: func(X []Attrib) (Attrib, error) {
  166. return ast.NewGraph(ast.DIGRAPH, ast.FALSE, X[1], X[3])
  167. },
  168. },
  169. ProdTabEntry{
  170. String: `DotGraph : strict digraph "{" StmtList "}" << ast.NewGraph(ast.DIGRAPH, ast.TRUE, nil, X[3]) >>`,
  171. Id: "DotGraph",
  172. NTType: 1,
  173. Index: 15,
  174. NumSymbols: 5,
  175. ReduceFunc: func(X []Attrib) (Attrib, error) {
  176. return ast.NewGraph(ast.DIGRAPH, ast.TRUE, nil, X[3])
  177. },
  178. },
  179. ProdTabEntry{
  180. String: `DotGraph : strict digraph Id "{" StmtList "}" << ast.NewGraph(ast.DIGRAPH, ast.TRUE, X[2], X[4]) >>`,
  181. Id: "DotGraph",
  182. NTType: 1,
  183. Index: 16,
  184. NumSymbols: 6,
  185. ReduceFunc: func(X []Attrib) (Attrib, error) {
  186. return ast.NewGraph(ast.DIGRAPH, ast.TRUE, X[2], X[4])
  187. },
  188. },
  189. ProdTabEntry{
  190. String: `StmtList : Stmt1 << ast.NewStmtList(X[0]) >>`,
  191. Id: "StmtList",
  192. NTType: 2,
  193. Index: 17,
  194. NumSymbols: 1,
  195. ReduceFunc: func(X []Attrib) (Attrib, error) {
  196. return ast.NewStmtList(X[0])
  197. },
  198. },
  199. ProdTabEntry{
  200. String: `StmtList : StmtList Stmt1 << ast.AppendStmtList(X[0], X[1]) >>`,
  201. Id: "StmtList",
  202. NTType: 2,
  203. Index: 18,
  204. NumSymbols: 2,
  205. ReduceFunc: func(X []Attrib) (Attrib, error) {
  206. return ast.AppendStmtList(X[0], X[1])
  207. },
  208. },
  209. ProdTabEntry{
  210. String: `Stmt1 : Stmt << X[0], nil >>`,
  211. Id: "Stmt1",
  212. NTType: 3,
  213. Index: 19,
  214. NumSymbols: 1,
  215. ReduceFunc: func(X []Attrib) (Attrib, error) {
  216. return X[0], nil
  217. },
  218. },
  219. ProdTabEntry{
  220. String: `Stmt1 : Stmt ";" << X[0], nil >>`,
  221. Id: "Stmt1",
  222. NTType: 3,
  223. Index: 20,
  224. NumSymbols: 2,
  225. ReduceFunc: func(X []Attrib) (Attrib, error) {
  226. return X[0], nil
  227. },
  228. },
  229. ProdTabEntry{
  230. String: `Stmt : Id "=" Id << ast.NewAttr(X[0], X[2]) >>`,
  231. Id: "Stmt",
  232. NTType: 4,
  233. Index: 21,
  234. NumSymbols: 3,
  235. ReduceFunc: func(X []Attrib) (Attrib, error) {
  236. return ast.NewAttr(X[0], X[2])
  237. },
  238. },
  239. ProdTabEntry{
  240. String: `Stmt : NodeStmt << X[0], nil >>`,
  241. Id: "Stmt",
  242. NTType: 4,
  243. Index: 22,
  244. NumSymbols: 1,
  245. ReduceFunc: func(X []Attrib) (Attrib, error) {
  246. return X[0], nil
  247. },
  248. },
  249. ProdTabEntry{
  250. String: `Stmt : EdgeStmt << X[0], nil >>`,
  251. Id: "Stmt",
  252. NTType: 4,
  253. Index: 23,
  254. NumSymbols: 1,
  255. ReduceFunc: func(X []Attrib) (Attrib, error) {
  256. return X[0], nil
  257. },
  258. },
  259. ProdTabEntry{
  260. String: `Stmt : AttrStmt << X[0], nil >>`,
  261. Id: "Stmt",
  262. NTType: 4,
  263. Index: 24,
  264. NumSymbols: 1,
  265. ReduceFunc: func(X []Attrib) (Attrib, error) {
  266. return X[0], nil
  267. },
  268. },
  269. ProdTabEntry{
  270. String: `Stmt : SubGraphStmt << X[0], nil >>`,
  271. Id: "Stmt",
  272. NTType: 4,
  273. Index: 25,
  274. NumSymbols: 1,
  275. ReduceFunc: func(X []Attrib) (Attrib, error) {
  276. return X[0], nil
  277. },
  278. },
  279. ProdTabEntry{
  280. String: `AttrStmt : graphx AttrList << ast.NewGraphAttrs(X[1]) >>`,
  281. Id: "AttrStmt",
  282. NTType: 5,
  283. Index: 26,
  284. NumSymbols: 2,
  285. ReduceFunc: func(X []Attrib) (Attrib, error) {
  286. return ast.NewGraphAttrs(X[1])
  287. },
  288. },
  289. ProdTabEntry{
  290. String: `AttrStmt : node AttrList << ast.NewNodeAttrs(X[1]) >>`,
  291. Id: "AttrStmt",
  292. NTType: 5,
  293. Index: 27,
  294. NumSymbols: 2,
  295. ReduceFunc: func(X []Attrib) (Attrib, error) {
  296. return ast.NewNodeAttrs(X[1])
  297. },
  298. },
  299. ProdTabEntry{
  300. String: `AttrStmt : edge AttrList << ast.NewEdgeAttrs(X[1]) >>`,
  301. Id: "AttrStmt",
  302. NTType: 5,
  303. Index: 28,
  304. NumSymbols: 2,
  305. ReduceFunc: func(X []Attrib) (Attrib, error) {
  306. return ast.NewEdgeAttrs(X[1])
  307. },
  308. },
  309. ProdTabEntry{
  310. String: `AttrList : "[" "]" << ast.NewAttrList(nil) >>`,
  311. Id: "AttrList",
  312. NTType: 6,
  313. Index: 29,
  314. NumSymbols: 2,
  315. ReduceFunc: func(X []Attrib) (Attrib, error) {
  316. return ast.NewAttrList(nil)
  317. },
  318. },
  319. ProdTabEntry{
  320. String: `AttrList : "[" AList "]" << ast.NewAttrList(X[1]) >>`,
  321. Id: "AttrList",
  322. NTType: 6,
  323. Index: 30,
  324. NumSymbols: 3,
  325. ReduceFunc: func(X []Attrib) (Attrib, error) {
  326. return ast.NewAttrList(X[1])
  327. },
  328. },
  329. ProdTabEntry{
  330. String: `AttrList : AttrList "[" "]" << ast.AppendAttrList(X[0], nil) >>`,
  331. Id: "AttrList",
  332. NTType: 6,
  333. Index: 31,
  334. NumSymbols: 3,
  335. ReduceFunc: func(X []Attrib) (Attrib, error) {
  336. return ast.AppendAttrList(X[0], nil)
  337. },
  338. },
  339. ProdTabEntry{
  340. String: `AttrList : AttrList "[" AList "]" << ast.AppendAttrList(X[0], X[2]) >>`,
  341. Id: "AttrList",
  342. NTType: 6,
  343. Index: 32,
  344. NumSymbols: 4,
  345. ReduceFunc: func(X []Attrib) (Attrib, error) {
  346. return ast.AppendAttrList(X[0], X[2])
  347. },
  348. },
  349. ProdTabEntry{
  350. String: `AList : Attr << ast.NewAList(X[0]) >>`,
  351. Id: "AList",
  352. NTType: 7,
  353. Index: 33,
  354. NumSymbols: 1,
  355. ReduceFunc: func(X []Attrib) (Attrib, error) {
  356. return ast.NewAList(X[0])
  357. },
  358. },
  359. ProdTabEntry{
  360. String: `AList : AList Attr << ast.AppendAList(X[0], X[1]) >>`,
  361. Id: "AList",
  362. NTType: 7,
  363. Index: 34,
  364. NumSymbols: 2,
  365. ReduceFunc: func(X []Attrib) (Attrib, error) {
  366. return ast.AppendAList(X[0], X[1])
  367. },
  368. },
  369. ProdTabEntry{
  370. String: `AList : AList "," Attr << ast.AppendAList(X[0], X[2]) >>`,
  371. Id: "AList",
  372. NTType: 7,
  373. Index: 35,
  374. NumSymbols: 3,
  375. ReduceFunc: func(X []Attrib) (Attrib, error) {
  376. return ast.AppendAList(X[0], X[2])
  377. },
  378. },
  379. ProdTabEntry{
  380. String: `Attr : Id << ast.NewAttr(X[0], nil) >>`,
  381. Id: "Attr",
  382. NTType: 8,
  383. Index: 36,
  384. NumSymbols: 1,
  385. ReduceFunc: func(X []Attrib) (Attrib, error) {
  386. return ast.NewAttr(X[0], nil)
  387. },
  388. },
  389. ProdTabEntry{
  390. String: `Attr : Id "=" Id << ast.NewAttr(X[0], X[2]) >>`,
  391. Id: "Attr",
  392. NTType: 8,
  393. Index: 37,
  394. NumSymbols: 3,
  395. ReduceFunc: func(X []Attrib) (Attrib, error) {
  396. return ast.NewAttr(X[0], X[2])
  397. },
  398. },
  399. ProdTabEntry{
  400. String: `EdgeStmt : NodeId EdgeRHS << ast.NewEdgeStmt(X[0], X[1], nil) >>`,
  401. Id: "EdgeStmt",
  402. NTType: 9,
  403. Index: 38,
  404. NumSymbols: 2,
  405. ReduceFunc: func(X []Attrib) (Attrib, error) {
  406. return ast.NewEdgeStmt(X[0], X[1], nil)
  407. },
  408. },
  409. ProdTabEntry{
  410. String: `EdgeStmt : NodeId EdgeRHS AttrList << ast.NewEdgeStmt(X[0], X[1], X[2]) >>`,
  411. Id: "EdgeStmt",
  412. NTType: 9,
  413. Index: 39,
  414. NumSymbols: 3,
  415. ReduceFunc: func(X []Attrib) (Attrib, error) {
  416. return ast.NewEdgeStmt(X[0], X[1], X[2])
  417. },
  418. },
  419. ProdTabEntry{
  420. String: `EdgeStmt : SubGraphStmt EdgeRHS << ast.NewEdgeStmt(X[0], X[1], nil) >>`,
  421. Id: "EdgeStmt",
  422. NTType: 9,
  423. Index: 40,
  424. NumSymbols: 2,
  425. ReduceFunc: func(X []Attrib) (Attrib, error) {
  426. return ast.NewEdgeStmt(X[0], X[1], nil)
  427. },
  428. },
  429. ProdTabEntry{
  430. String: `EdgeStmt : SubGraphStmt EdgeRHS AttrList << ast.NewEdgeStmt(X[0], X[1], X[2]) >>`,
  431. Id: "EdgeStmt",
  432. NTType: 9,
  433. Index: 41,
  434. NumSymbols: 3,
  435. ReduceFunc: func(X []Attrib) (Attrib, error) {
  436. return ast.NewEdgeStmt(X[0], X[1], X[2])
  437. },
  438. },
  439. ProdTabEntry{
  440. String: `EdgeRHS : EdgeOp NodeId << ast.NewEdgeRHS(X[0], X[1]) >>`,
  441. Id: "EdgeRHS",
  442. NTType: 10,
  443. Index: 42,
  444. NumSymbols: 2,
  445. ReduceFunc: func(X []Attrib) (Attrib, error) {
  446. return ast.NewEdgeRHS(X[0], X[1])
  447. },
  448. },
  449. ProdTabEntry{
  450. String: `EdgeRHS : EdgeOp SubGraphStmt << ast.NewEdgeRHS(X[0], X[1]) >>`,
  451. Id: "EdgeRHS",
  452. NTType: 10,
  453. Index: 43,
  454. NumSymbols: 2,
  455. ReduceFunc: func(X []Attrib) (Attrib, error) {
  456. return ast.NewEdgeRHS(X[0], X[1])
  457. },
  458. },
  459. ProdTabEntry{
  460. String: `EdgeRHS : EdgeRHS EdgeOp NodeId << ast.AppendEdgeRHS(X[0], X[1], X[2]) >>`,
  461. Id: "EdgeRHS",
  462. NTType: 10,
  463. Index: 44,
  464. NumSymbols: 3,
  465. ReduceFunc: func(X []Attrib) (Attrib, error) {
  466. return ast.AppendEdgeRHS(X[0], X[1], X[2])
  467. },
  468. },
  469. ProdTabEntry{
  470. String: `EdgeRHS : EdgeRHS EdgeOp SubGraphStmt << ast.AppendEdgeRHS(X[0], X[1], X[2]) >>`,
  471. Id: "EdgeRHS",
  472. NTType: 10,
  473. Index: 45,
  474. NumSymbols: 3,
  475. ReduceFunc: func(X []Attrib) (Attrib, error) {
  476. return ast.AppendEdgeRHS(X[0], X[1], X[2])
  477. },
  478. },
  479. ProdTabEntry{
  480. String: `NodeStmt : NodeId << ast.NewNodeStmt(X[0], nil) >>`,
  481. Id: "NodeStmt",
  482. NTType: 11,
  483. Index: 46,
  484. NumSymbols: 1,
  485. ReduceFunc: func(X []Attrib) (Attrib, error) {
  486. return ast.NewNodeStmt(X[0], nil)
  487. },
  488. },
  489. ProdTabEntry{
  490. String: `NodeStmt : NodeId AttrList << ast.NewNodeStmt(X[0], X[1]) >>`,
  491. Id: "NodeStmt",
  492. NTType: 11,
  493. Index: 47,
  494. NumSymbols: 2,
  495. ReduceFunc: func(X []Attrib) (Attrib, error) {
  496. return ast.NewNodeStmt(X[0], X[1])
  497. },
  498. },
  499. ProdTabEntry{
  500. String: `NodeId : Id << ast.NewNodeID(X[0], nil) >>`,
  501. Id: "NodeId",
  502. NTType: 12,
  503. Index: 48,
  504. NumSymbols: 1,
  505. ReduceFunc: func(X []Attrib) (Attrib, error) {
  506. return ast.NewNodeID(X[0], nil)
  507. },
  508. },
  509. ProdTabEntry{
  510. String: `NodeId : Id Port << ast.NewNodeID(X[0], X[1]) >>`,
  511. Id: "NodeId",
  512. NTType: 12,
  513. Index: 49,
  514. NumSymbols: 2,
  515. ReduceFunc: func(X []Attrib) (Attrib, error) {
  516. return ast.NewNodeID(X[0], X[1])
  517. },
  518. },
  519. ProdTabEntry{
  520. String: `Port : ":" Id << ast.NewPort(X[1], nil), nil >>`,
  521. Id: "Port",
  522. NTType: 13,
  523. Index: 50,
  524. NumSymbols: 2,
  525. ReduceFunc: func(X []Attrib) (Attrib, error) {
  526. return ast.NewPort(X[1], nil), nil
  527. },
  528. },
  529. ProdTabEntry{
  530. String: `Port : ":" Id ":" Id << ast.NewPort(X[1], X[3]), nil >>`,
  531. Id: "Port",
  532. NTType: 13,
  533. Index: 51,
  534. NumSymbols: 4,
  535. ReduceFunc: func(X []Attrib) (Attrib, error) {
  536. return ast.NewPort(X[1], X[3]), nil
  537. },
  538. },
  539. ProdTabEntry{
  540. String: `SubGraphStmt : "{" StmtList "}" << ast.NewSubGraph(nil, X[1]) >>`,
  541. Id: "SubGraphStmt",
  542. NTType: 14,
  543. Index: 52,
  544. NumSymbols: 3,
  545. ReduceFunc: func(X []Attrib) (Attrib, error) {
  546. return ast.NewSubGraph(nil, X[1])
  547. },
  548. },
  549. ProdTabEntry{
  550. String: `SubGraphStmt : subgraph "{" StmtList "}" << ast.NewSubGraph(nil, X[2]) >>`,
  551. Id: "SubGraphStmt",
  552. NTType: 14,
  553. Index: 53,
  554. NumSymbols: 4,
  555. ReduceFunc: func(X []Attrib) (Attrib, error) {
  556. return ast.NewSubGraph(nil, X[2])
  557. },
  558. },
  559. ProdTabEntry{
  560. String: `SubGraphStmt : subgraph Id "{" StmtList "}" << ast.NewSubGraph(X[1], X[3]) >>`,
  561. Id: "SubGraphStmt",
  562. NTType: 14,
  563. Index: 54,
  564. NumSymbols: 5,
  565. ReduceFunc: func(X []Attrib) (Attrib, error) {
  566. return ast.NewSubGraph(X[1], X[3])
  567. },
  568. },
  569. ProdTabEntry{
  570. String: `SubGraphStmt : subgraph "{" "}" << ast.NewSubGraph(nil, nil) >>`,
  571. Id: "SubGraphStmt",
  572. NTType: 14,
  573. Index: 55,
  574. NumSymbols: 3,
  575. ReduceFunc: func(X []Attrib) (Attrib, error) {
  576. return ast.NewSubGraph(nil, nil)
  577. },
  578. },
  579. ProdTabEntry{
  580. String: `SubGraphStmt : subgraph Id "{" "}" << ast.NewSubGraph(X[1], nil) >>`,
  581. Id: "SubGraphStmt",
  582. NTType: 14,
  583. Index: 56,
  584. NumSymbols: 4,
  585. ReduceFunc: func(X []Attrib) (Attrib, error) {
  586. return ast.NewSubGraph(X[1], nil)
  587. },
  588. },
  589. ProdTabEntry{
  590. String: `EdgeOp : "->" << ast.DIRECTED, nil >>`,
  591. Id: "EdgeOp",
  592. NTType: 15,
  593. Index: 57,
  594. NumSymbols: 1,
  595. ReduceFunc: func(X []Attrib) (Attrib, error) {
  596. return ast.DIRECTED, nil
  597. },
  598. },
  599. ProdTabEntry{
  600. String: `EdgeOp : "--" << ast.UNDIRECTED, nil >>`,
  601. Id: "EdgeOp",
  602. NTType: 15,
  603. Index: 58,
  604. NumSymbols: 1,
  605. ReduceFunc: func(X []Attrib) (Attrib, error) {
  606. return ast.UNDIRECTED, nil
  607. },
  608. },
  609. ProdTabEntry{
  610. String: `Id : id << ast.NewID(X[0]) >>`,
  611. Id: "Id",
  612. NTType: 16,
  613. Index: 59,
  614. NumSymbols: 1,
  615. ReduceFunc: func(X []Attrib) (Attrib, error) {
  616. return ast.NewID(X[0])
  617. },
  618. },
  619. }