ll1_parser.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921
  1. /*
  2. * ll1_parser.go: Parser for the Grammar grammar.
  3. * Generated by the ll1 tool from ll1.ll1 at 2020-09-07 15:48:11.467763157 +0200 CEST m=+0.001425957.
  4. * Based on template: ll1.parser.go.lined.tpl
  5. * Uses a scanner
  6. *
  7. * Available definition keys at template expansion:
  8. * [Grammar Import InName LexerType OutName Package Parser Prefix Templates]
  9. *
  10. * DO NOT EDIT.
  11. */
  12. package main
  13. import "text/scanner"
  14. import "unicode"
  15. import "io"
  16. import "os"
  17. import "fmt"
  18. // Ll1Value is the lexical value of a lexer token.
  19. // This is based on strings as a default.
  20. //no-line ll1.parser.go.tpl:43
  21. type Ll1Value = string
  22. // Ll1Position is a position within a source file. Since the lexer is based on
  23. // text/scanner, we use that package's Position.
  24. //no-line ll1.parser.go.tpl:51
  25. type Ll1Position = scanner.Position
  26. // Ll1TokenKind is the kind or type of a token.
  27. // This has rune as the underlying type so one-character tokens can be easily
  28. // supported. EOF will be 65535 (I.e, -1 cast to rune). Non-character token
  29. // kinds will start from 65533 down (i.e -3, -4, -5, etc).
  30. //no-line ll1.parser.go.tpl:69
  31. type Ll1TokenKind rune
  32. // NoLl1TokenKind means "no token kind" i.e. no token.
  33. //no-line ll1.parser.go.tpl:74
  34. const NoLl1TokenKind Ll1TokenKind = Ll1TokenKind(0)
  35. // Ll1TokenKindEOF means the end of the input.
  36. //no-line ll1.parser.go.tpl:77
  37. const Ll1TokenKindEOF Ll1TokenKind = Ll1TokenKind(-1)
  38. // Ll1TokenKindError means a parsing or lexing error was encountered.
  39. //no-line ll1.parser.go.tpl:80
  40. const Ll1TokenKindError Ll1TokenKind = Ll1TokenKind(-2)
  41. // Convert token kind to a string representation
  42. //no-line ll1.parser.go.tpl:86
  43. func (tk Ll1TokenKind) String() string {
  44. return scanner.TokenString(rune(tk))
  45. }
  46. // Ll1Token is the result of a single lexical analysis step by the lexer.
  47. //no-line ll1.parser.go.tpl:109
  48. type Ll1Token struct {
  49. Ll1Position // Position in the source where the token was found.
  50. Ll1TokenKind // Type of the token
  51. Ll1Value // Value of the token
  52. }
  53. // MakeLl1Token makes a token with the given position, type and value.
  54. //no-line ll1.parser.go.tpl:118
  55. func MakeLl1Token(pos Ll1Position, typ Ll1TokenKind, val Ll1Value) Ll1Token {
  56. return Ll1Token{ pos, typ, val}
  57. }
  58. // Ll1Lexer performs the lexical analysis of the input.
  59. //no-line ll1.parser.go.tpl:124
  60. type Ll1Lexer struct {
  61. // Embed scanner.Scanner
  62. scanner.Scanner
  63. Filename string
  64. }
  65. // NewLl1LexerFromReader creates a new lexer for the given parser and input.
  66. //no-line ll1.parser.go.tpl:133
  67. func NewLl1LexerFromReader(parser *Ll1Parser, reader io.Reader, filename string) *Ll1Lexer {
  68. lexer := &Ll1Lexer{}
  69. lexer.Filename = filename
  70. lexer.Scanner.Init(reader)
  71. lexer.Scanner.Mode = scanner.GoTokens
  72. lexer.Scanner.Error = func (s *scanner.Scanner, msg string) {
  73. parser.Panicf("%s: scanner error: %s, %s", s.Position, s.TokenText(), msg)
  74. }
  75. // XXX: needs to be generated from the identifier rule in the syntax!
  76. lexer.Scanner.IsIdentRune = func(ch rune, i int) bool {
  77. if i == 0 {
  78. return unicode.IsLetter(ch)
  79. }
  80. return unicode.IsLetter(ch) ||
  81. unicode.IsNumber(ch) ||
  82. ch == '_' ||
  83. ch == '-'
  84. }
  85. return lexer
  86. }
  87. //no-line ll1.parser.go.tpl:155
  88. func (lex *Ll1Lexer) Lex() Ll1Token {
  89. scanned := lex.Scanner.Scan()
  90. pos := lex.Scanner.Position
  91. pos.Filename = lex.Filename
  92. value := lex.Scanner.TokenText()
  93. // Get rid of the quotes
  94. if scanned == scanner.Char ||
  95. scanned == scanner.String ||
  96. scanned == scanner.RawString {
  97. value = value[1:len(value) - 1]
  98. }
  99. token := Ll1Token {
  100. Ll1TokenKind: Ll1TokenKind(scanned),
  101. Ll1Value: value,
  102. Ll1Position: pos,
  103. }
  104. return token
  105. }
  106. // Ll1Parser parses the input and returns a parse tree,
  107. // based on the rules in ll1.ll1
  108. //no-line ll1.parser.go.tpl:188
  109. type Ll1Parser struct {
  110. reader io.Reader
  111. lexer *Ll1Lexer
  112. current Ll1Token
  113. Errors []Ll1ParserError
  114. Filename string
  115. Debug io.Writer
  116. }
  117. //no-line ll1.parser.go.tpl:198
  118. func NewLl1ParserFromReader(reader io.Reader, filename string, debug bool) *Ll1Parser {
  119. parser := &Ll1Parser{}
  120. parser.lexer = NewLl1LexerFromReader(parser, reader, filename)
  121. parser.Filename = filename
  122. parser.current.Ll1TokenKind = NoLl1TokenKind
  123. parser.Debug = nil
  124. if debug {
  125. parser.Debug = os.Stderr
  126. }
  127. return parser
  128. }
  129. // Advances the parser. Returns the current token /after/ advancing.
  130. //no-line ll1.parser.go.tpl:214
  131. func (p *Ll1Parser) Advance() Ll1Token {
  132. token := p.lexer.Lex()
  133. p.Debugf("Lexed token: %v", token)
  134. p.current = token
  135. return token
  136. }
  137. // Ll1ParserError is an error encountered during parsing or lexing.
  138. // The parser may panic with this type on errors that would prevent the parser
  139. // from making progress.
  140. //no-line ll1.parser.go.tpl:225
  141. type Ll1ParserError struct {
  142. *Ll1Parser // Parser that had the error.
  143. *Ll1Token // Token at which the error was found
  144. Chain error // underlying error
  145. }
  146. //no-line ll1.parser.go.tpl:232
  147. func (pe Ll1ParserError) Error() string {
  148. // XXX will need to be improved
  149. return pe.Chain.Error()
  150. }
  151. //no-line ll1.parser.go.tpl:238
  152. func (parser *Ll1Parser) Errorf(message string, args ...interface{}) Ll1ParserError {
  153. err := fmt.Errorf(message, args...)
  154. pe := Ll1ParserError {
  155. Ll1Parser: parser,
  156. Ll1Token: &parser.current,
  157. Chain: err,
  158. }
  159. parser.Errors = append(parser.Errors, pe)
  160. return pe
  161. }
  162. //no-line ll1.parser.go.tpl:250
  163. func (parser *Ll1Parser) Panicf(message string, args ...interface{}) {
  164. pe := parser.Errorf(message, args...)
  165. panic(pe)
  166. }
  167. //no-line ll1.parser.go.tpl:257
  168. func (p *Ll1Parser) Debugf(message string, args ...interface{}) {
  169. if p.Debug != nil {
  170. fmt.Fprintf(p.Debug, message, args)
  171. }
  172. }
  173. /* Looks at the current token and advances the lexer if the token is of any of
  174. the token kinds given in kinds. In this case it will return the accepted
  175. token and advance the parser. Otherwise, it will call parser.Panicf.*/
  176. //no-line ll1.parser.go.tpl:267
  177. func (parser *Ll1Parser) Require(kinds ...Ll1TokenKind) Ll1Token {
  178. parser.Debugf("Require: %v\n", kinds)
  179. if parser.current.Ll1TokenKind == Ll1TokenKind(0) {
  180. parser.Advance()
  181. }
  182. expected := ""
  183. sep := ""
  184. for _, kind := range kinds {
  185. if kind == parser.current.Ll1TokenKind {
  186. accepted := parser.current
  187. parser.Advance()
  188. return accepted
  189. }
  190. expected = fmt.Sprintf("%s%s%s", expected, sep, kind.String())
  191. }
  192. parser.Panicf("error: expected one of the following: %s", expected)
  193. return Ll1Token{}
  194. }
  195. //no-line ll1.parser.go.tpl:288
  196. func (parser Ll1Parser) NextIs(kinds ...Ll1TokenKind) bool {
  197. parser.Debugf("NextIs: %v\n", kinds)
  198. if (parser.current.Ll1TokenKind == 0) {
  199. parser.Advance()
  200. }
  201. for _, kind := range kinds {
  202. if kind == parser.current.Ll1TokenKind {
  203. return true
  204. }
  205. }
  206. return false
  207. }
  208. //no-line ll1.parser.go.tpl:324
  209. type Ll1Grammar struct {
  210. Ll1Token
  211. *Ll1Rules
  212. }
  213. //no-line ll1.parser.go.tpl:335
  214. func (p *Ll1Parser) IsLl1Grammar() (bool) {
  215. return false
  216. // return p.NextIs()
  217. }
  218. //no-line ll1.parser.go.tpl:340
  219. func (p *Ll1Parser) ParseLl1Grammar() (*Ll1Grammar, error) {
  220. var err error
  221. result := &Ll1Grammar { Ll1Token: p.current }
  222. if p.IsLl1Rules() {
  223. result.Ll1Rules, err = p.ParseLl1Rules()
  224. if err != nil {
  225. return result, err
  226. }
  227. }
  228. return result, err
  229. }
  230. //no-line ll1.parser.go.tpl:324
  231. type Ll1Rules struct {
  232. Ll1Token
  233. *Ll1Rule
  234. *Ll1OptRules
  235. }
  236. //no-line ll1.parser.go.tpl:335
  237. func (p *Ll1Parser) IsLl1Rules() (bool) {
  238. return false
  239. // return p.NextIs()
  240. }
  241. //no-line ll1.parser.go.tpl:340
  242. func (p *Ll1Parser) ParseLl1Rules() (*Ll1Rules, error) {
  243. var err error
  244. result := &Ll1Rules { Ll1Token: p.current }
  245. if p.IsLl1Rule() {
  246. result.Ll1Rule, err = p.ParseLl1Rule()
  247. if err != nil {
  248. return result, err
  249. }
  250. }
  251. if p.IsLl1OptRules() {
  252. result.Ll1OptRules, err = p.ParseLl1OptRules()
  253. if err != nil {
  254. return result, err
  255. }
  256. }
  257. return result, err
  258. }
  259. //no-line ll1.parser.go.tpl:324
  260. type Ll1OptRules struct {
  261. Ll1Token
  262. *Ll1Rules
  263. }
  264. //no-line ll1.parser.go.tpl:335
  265. func (p *Ll1Parser) IsLl1OptRules() (bool) {
  266. return false
  267. // return p.NextIs()
  268. }
  269. //no-line ll1.parser.go.tpl:340
  270. func (p *Ll1Parser) ParseLl1OptRules() (*Ll1OptRules, error) {
  271. var err error
  272. result := &Ll1OptRules { Ll1Token: p.current }
  273. if p.IsLl1Rules() {
  274. result.Ll1Rules, err = p.ParseLl1Rules()
  275. if err != nil {
  276. return result, err
  277. }
  278. }
  279. return result, err
  280. }
  281. //no-line ll1.parser.go.tpl:324
  282. type Ll1Rule struct {
  283. Ll1Token
  284. *Ll1Name
  285. *Ll1Definition
  286. *Ll1Template
  287. }
  288. //no-line ll1.parser.go.tpl:335
  289. func (p *Ll1Parser) IsLl1Rule() (bool) {
  290. return false
  291. // return p.NextIs()
  292. }
  293. //no-line ll1.parser.go.tpl:340
  294. func (p *Ll1Parser) ParseLl1Rule() (*Ll1Rule, error) {
  295. var err error
  296. result := &Ll1Rule { Ll1Token: p.current }
  297. if p.IsLl1Name() {
  298. result.Ll1Name, err = p.ParseLl1Name()
  299. if err != nil {
  300. return result, err
  301. }
  302. }
  303. if p.IsLl1Definition() {
  304. result.Ll1Definition, err = p.ParseLl1Definition()
  305. if err != nil {
  306. return result, err
  307. }
  308. }
  309. if p.IsLl1Template() {
  310. result.Ll1Template, err = p.ParseLl1Template()
  311. if err != nil {
  312. return result, err
  313. }
  314. }
  315. return result, err
  316. }
  317. //no-line ll1.parser.go.tpl:324
  318. type Ll1Name struct {
  319. Ll1Token
  320. }
  321. //no-line ll1.parser.go.tpl:335
  322. func (p *Ll1Parser) IsLl1Name() (bool) {
  323. return false
  324. // return p.NextIs()
  325. }
  326. //no-line ll1.parser.go.tpl:340
  327. func (p *Ll1Parser) ParseLl1Name() (*Ll1Name, error) {
  328. var err error
  329. result := &Ll1Name { Ll1Token: p.current }
  330. return result, err
  331. }
  332. //no-line ll1.parser.go.tpl:324
  333. type Ll1Template struct {
  334. Ll1Token
  335. }
  336. //no-line ll1.parser.go.tpl:335
  337. func (p *Ll1Parser) IsLl1Template() (bool) {
  338. return false
  339. // return p.NextIs()
  340. }
  341. //no-line ll1.parser.go.tpl:340
  342. func (p *Ll1Parser) ParseLl1Template() (*Ll1Template, error) {
  343. var err error
  344. result := &Ll1Template { Ll1Token: p.current }
  345. return result, err
  346. }
  347. //no-line ll1.parser.go.tpl:324
  348. type Ll1Definition struct {
  349. Ll1Token
  350. *Ll1Alternates
  351. }
  352. //no-line ll1.parser.go.tpl:335
  353. func (p *Ll1Parser) IsLl1Definition() (bool) {
  354. return false
  355. // return p.NextIs()
  356. }
  357. //no-line ll1.parser.go.tpl:340
  358. func (p *Ll1Parser) ParseLl1Definition() (*Ll1Definition, error) {
  359. var err error
  360. result := &Ll1Definition { Ll1Token: p.current }
  361. if p.IsLl1Alternates() {
  362. result.Ll1Alternates, err = p.ParseLl1Alternates()
  363. if err != nil {
  364. return result, err
  365. }
  366. }
  367. return result, err
  368. }
  369. //no-line ll1.parser.go.tpl:324
  370. type Ll1Alternates struct {
  371. Ll1Token
  372. *Ll1Sequence
  373. *Ll1OptSequences
  374. }
  375. //no-line ll1.parser.go.tpl:335
  376. func (p *Ll1Parser) IsLl1Alternates() (bool) {
  377. return false
  378. // return p.NextIs()
  379. }
  380. //no-line ll1.parser.go.tpl:340
  381. func (p *Ll1Parser) ParseLl1Alternates() (*Ll1Alternates, error) {
  382. var err error
  383. result := &Ll1Alternates { Ll1Token: p.current }
  384. if p.IsLl1Sequence() {
  385. result.Ll1Sequence, err = p.ParseLl1Sequence()
  386. if err != nil {
  387. return result, err
  388. }
  389. }
  390. if p.IsLl1OptSequences() {
  391. result.Ll1OptSequences, err = p.ParseLl1OptSequences()
  392. if err != nil {
  393. return result, err
  394. }
  395. }
  396. return result, err
  397. }
  398. //no-line ll1.parser.go.tpl:324
  399. type Ll1OptSequences struct {
  400. Ll1Token
  401. *Ll1Alternates
  402. }
  403. //no-line ll1.parser.go.tpl:335
  404. func (p *Ll1Parser) IsLl1OptSequences() (bool) {
  405. return false
  406. // return p.NextIs()
  407. }
  408. //no-line ll1.parser.go.tpl:340
  409. func (p *Ll1Parser) ParseLl1OptSequences() (*Ll1OptSequences, error) {
  410. var err error
  411. result := &Ll1OptSequences { Ll1Token: p.current }
  412. if p.IsLl1Alternates() {
  413. result.Ll1Alternates, err = p.ParseLl1Alternates()
  414. if err != nil {
  415. return result, err
  416. }
  417. }
  418. return result, err
  419. }
  420. //no-line ll1.parser.go.tpl:324
  421. type Ll1Sequence struct {
  422. Ll1Token
  423. *Ll1Element
  424. *Ll1OptElements
  425. }
  426. //no-line ll1.parser.go.tpl:335
  427. func (p *Ll1Parser) IsLl1Sequence() (bool) {
  428. return false
  429. // return p.NextIs()
  430. }
  431. //no-line ll1.parser.go.tpl:340
  432. func (p *Ll1Parser) ParseLl1Sequence() (*Ll1Sequence, error) {
  433. var err error
  434. result := &Ll1Sequence { Ll1Token: p.current }
  435. if p.IsLl1Element() {
  436. result.Ll1Element, err = p.ParseLl1Element()
  437. if err != nil {
  438. return result, err
  439. }
  440. }
  441. if p.IsLl1OptElements() {
  442. result.Ll1OptElements, err = p.ParseLl1OptElements()
  443. if err != nil {
  444. return result, err
  445. }
  446. }
  447. return result, err
  448. }
  449. //no-line ll1.parser.go.tpl:324
  450. type Ll1OptElements struct {
  451. Ll1Token
  452. *Ll1Element
  453. *Ll1OptElements
  454. }
  455. //no-line ll1.parser.go.tpl:335
  456. func (p *Ll1Parser) IsLl1OptElements() (bool) {
  457. return false
  458. // return p.NextIs()
  459. }
  460. //no-line ll1.parser.go.tpl:340
  461. func (p *Ll1Parser) ParseLl1OptElements() (*Ll1OptElements, error) {
  462. var err error
  463. result := &Ll1OptElements { Ll1Token: p.current }
  464. if p.IsLl1Element() {
  465. result.Ll1Element, err = p.ParseLl1Element()
  466. if err != nil {
  467. return result, err
  468. }
  469. }
  470. if p.IsLl1OptElements() {
  471. result.Ll1OptElements, err = p.ParseLl1OptElements()
  472. if err != nil {
  473. return result, err
  474. }
  475. }
  476. return result, err
  477. }
  478. //no-line ll1.parser.go.tpl:324
  479. type Ll1Element struct {
  480. Ll1Token
  481. *Ll1Parenthesis
  482. *Ll1Name
  483. }
  484. //no-line ll1.parser.go.tpl:335
  485. func (p *Ll1Parser) IsLl1Element() (bool) {
  486. return false
  487. // return p.NextIs()
  488. }
  489. //no-line ll1.parser.go.tpl:340
  490. func (p *Ll1Parser) ParseLl1Element() (*Ll1Element, error) {
  491. var err error
  492. result := &Ll1Element { Ll1Token: p.current }
  493. if p.IsLl1Parenthesis() {
  494. result.Ll1Parenthesis, err = p.ParseLl1Parenthesis()
  495. if err != nil {
  496. return result, err
  497. }
  498. }
  499. if p.IsLl1Name() {
  500. result.Ll1Name, err = p.ParseLl1Name()
  501. if err != nil {
  502. return result, err
  503. }
  504. }
  505. return result, err
  506. }
  507. //no-line ll1.parser.go.tpl:324
  508. type Ll1Parenthesis struct {
  509. Ll1Token
  510. *Ll1Definition
  511. }
  512. //no-line ll1.parser.go.tpl:335
  513. func (p *Ll1Parser) IsLl1Parenthesis() (bool) {
  514. return false
  515. // return p.NextIs()
  516. }
  517. //no-line ll1.parser.go.tpl:340
  518. func (p *Ll1Parser) ParseLl1Parenthesis() (*Ll1Parenthesis, error) {
  519. var err error
  520. result := &Ll1Parenthesis { Ll1Token: p.current }
  521. if p.IsLl1Definition() {
  522. result.Ll1Definition, err = p.ParseLl1Definition()
  523. if err != nil {
  524. return result, err
  525. }
  526. }
  527. return result, err
  528. }
  529. //no-line ll1.parser.go.tpl:313
  530. const Ll1TokenKinddot Ll1TokenKind = Ll1TokenKind(-2)
  531. //no-line ll1.parser.go.tpl:316
  532. func ( *Ll1Lexer) LexLl1TokenKinddot() (Ll1TokenKind, error) {
  533. result := Ll1TokenKinddot
  534. return result, nil
  535. }
  536. //no-line ll1.parser.go.tpl:313
  537. const Ll1TokenKindor Ll1TokenKind = Ll1TokenKind(-3)
  538. //no-line ll1.parser.go.tpl:316
  539. func ( *Ll1Lexer) LexLl1TokenKindor() (Ll1TokenKind, error) {
  540. result := Ll1TokenKindor
  541. return result, nil
  542. }
  543. //no-line ll1.parser.go.tpl:313
  544. const Ll1TokenKindidentifier Ll1TokenKind = Ll1TokenKind(-4)
  545. //no-line ll1.parser.go.tpl:316
  546. func ( *Ll1Lexer) LexLl1TokenKindidentifier() (Ll1TokenKind, error) {
  547. result := Ll1TokenKindidentifier
  548. return result, nil
  549. }
  550. //no-line ll1.parser.go.tpl:313
  551. const Ll1TokenKindruleName Ll1TokenKind = Ll1TokenKind(-5)
  552. //no-line ll1.parser.go.tpl:316
  553. func ( *Ll1Lexer) LexLl1TokenKindruleName() (Ll1TokenKind, error) {
  554. result := Ll1TokenKindruleName
  555. return result, nil
  556. }
  557. //no-line ll1.parser.go.tpl:313
  558. const Ll1TokenKindterminalName Ll1TokenKind = Ll1TokenKind(-6)
  559. //no-line ll1.parser.go.tpl:316
  560. func ( *Ll1Lexer) LexLl1TokenKindterminalName() (Ll1TokenKind, error) {
  561. result := Ll1TokenKindterminalName
  562. return result, nil
  563. }
  564. //no-line ll1.parser.go.tpl:313
  565. const Ll1TokenKindepsilon Ll1TokenKind = Ll1TokenKind(-7)
  566. //no-line ll1.parser.go.tpl:316
  567. func ( *Ll1Lexer) LexLl1TokenKindepsilon() (Ll1TokenKind, error) {
  568. result := Ll1TokenKindepsilon
  569. return result, nil
  570. }
  571. //no-line ll1.parser.go.tpl:313
  572. const Ll1TokenKindarrow Ll1TokenKind = Ll1TokenKind(-8)
  573. //no-line ll1.parser.go.tpl:316
  574. func ( *Ll1Lexer) LexLl1TokenKindarrow() (Ll1TokenKind, error) {
  575. result := Ll1TokenKindarrow
  576. return result, nil
  577. }
  578. //no-line ll1.parser.go.tpl:313
  579. const Ll1TokenKindliteral Ll1TokenKind = Ll1TokenKind(-9)
  580. //no-line ll1.parser.go.tpl:316
  581. func ( *Ll1Lexer) LexLl1TokenKindliteral() (Ll1TokenKind, error) {
  582. result := Ll1TokenKindliteral
  583. return result, nil
  584. }
  585. //no-line ll1.parser.go.tpl:313
  586. const Ll1TokenKindstringLiteral Ll1TokenKind = Ll1TokenKind(-10)
  587. //no-line ll1.parser.go.tpl:316
  588. func ( *Ll1Lexer) LexLl1TokenKindstringLiteral() (Ll1TokenKind, error) {
  589. result := Ll1TokenKindstringLiteral
  590. return result, nil
  591. }
  592. //no-line ll1.parser.go.tpl:313
  593. const Ll1TokenKindcharLiteral Ll1TokenKind = Ll1TokenKind(-11)
  594. //no-line ll1.parser.go.tpl:316
  595. func ( *Ll1Lexer) LexLl1TokenKindcharLiteral() (Ll1TokenKind, error) {
  596. result := Ll1TokenKindcharLiteral
  597. return result, nil
  598. }
  599. //no-line ll1.parser.go.tpl:313
  600. const Ll1TokenKindrawString Ll1TokenKind = Ll1TokenKind(-12)
  601. //no-line ll1.parser.go.tpl:316
  602. func ( *Ll1Lexer) LexLl1TokenKindrawString() (Ll1TokenKind, error) {
  603. result := Ll1TokenKindrawString
  604. return result, nil
  605. }
  606. //no-line ll1.parser.go.tpl:313
  607. const Ll1TokenKindwhiteSpace Ll1TokenKind = Ll1TokenKind(-13)
  608. //no-line ll1.parser.go.tpl:316
  609. func ( *Ll1Lexer) LexLl1TokenKindwhiteSpace() (Ll1TokenKind, error) {
  610. result := Ll1TokenKindwhiteSpace
  611. return result, nil
  612. }
  613. //no-line ll1.parser.go.tpl:313
  614. const Ll1TokenKindlineComment Ll1TokenKind = Ll1TokenKind(-14)
  615. //no-line ll1.parser.go.tpl:316
  616. func ( *Ll1Lexer) LexLl1TokenKindlineComment() (Ll1TokenKind, error) {
  617. result := Ll1TokenKindlineComment
  618. return result, nil
  619. }
  620. // Expanded from template of rule handCoded
  621. // Not implemented
  622. //no-line ll1.parser.go.tpl:313
  623. const Ll1TokenKindhandCoded Ll1TokenKind = Ll1TokenKind(-15)
  624. //no-line ll1.parser.go.tpl:316
  625. func ( *Ll1Lexer) LexLl1TokenKindhandCoded() (Ll1TokenKind, error) {
  626. result := Ll1TokenKindhandCoded
  627. return result, nil
  628. }