| 1 | //Copyright 2013 Vastech SA (PTY) LTD |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package itemsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/items`/ |
| 16 | |
| 17 | import ( |
| 18 | "testingscip-go gomod github.com/golang/go/src go1.24 testing/" |
| 19 | |
| 20 | "github.com/goccmack/gocc/internal/astscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/" |
| 21 | "github.com/goccmack/gocc/internal/frontend/parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/" |
| 22 | "github.com/goccmack/gocc/internal/frontend/scannerscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/scanner`/" |
| 23 | "github.com/goccmack/gocc/internal/frontend/tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/" |
| 24 | ) |
| 25 | |
| 26 | const G1scip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/items`/G1. = ` |
| 27 | A : B a ; |
| 28 | |
| 29 | B : b ; |
| 30 | ` |
| 31 | |
| 32 | var G1S0scip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/items`/G1S0. = []string{ |
| 33 | "A : •B a «$»", |
| 34 | "B : •b «$»", |
| 35 | } |
| 36 | |
| 37 | func parsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/items`/parse().(src string, t *testingscip-go gomod github.com/golang/go/src go1.24 testing/.Tscip-go gomod github.com/golang/go/src go1.24 testing/T#) *astscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/.Grammarscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/Grammar# { |
| 38 | lexer := new(scannerscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/scanner`/.Scannerscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/scanner`/Scanner#) |
| 39 | lexer.Initscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/scanner`/Scanner#Init().([]byte(src), tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/.FRONTENDTokensscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/FRONTENDTokens.) |
| 40 | p := parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/.NewParserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/NewParser().(parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/.ActionTablescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionTable., parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/.GotoTablescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/GotoTable., parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/.ProductionsTablescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ProductionsTable., tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/.FRONTENDTokensscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/FRONTENDTokens.) |
| 41 | res, err := p.Parsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#Parse().(lexer) |
| 42 | if err != nil { |
| 43 | t.Fatalscip-go gomod github.com/golang/go/src go1.24 testing/common#Fatal().(err) |
| 44 | return nil |
| 45 | } |
| 46 | return res.(*astscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/.Grammarscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/Grammar#) |
| 47 | } |