| 1 | package parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ |
| 2 | |
| 3 | import ( |
| 4 | "errorsscip-go gomod github.com/golang/go/src go1.24 errors/" |
| 5 | "fmtscip-go gomod github.com/golang/go/src go1.24 fmt/" |
| 6 | "strconvscip-go gomod github.com/golang/go/src go1.24 strconv/" |
| 7 | |
| 8 | errsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/ "github.com/goccmack/gocc/internal/frontend/errorsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/" |
| 9 | "github.com/goccmack/gocc/internal/frontend/tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/" |
| 10 | ) |
| 11 | |
| 12 | type ( |
| 13 | ActionTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionTab# []*ActionRowscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow# |
| 14 | ActionRowscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow# struct { |
| 15 | canRecoverscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#canRecover. bool |
| 16 | Actionsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#Actions. Actionsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Actions# |
| 17 | } |
| 18 | Actionsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Actions# map[tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/.Typescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/Type#]Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Action# |
| 19 | ) |
| 20 | |
| 21 | func (R *ActionRowscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#) Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#String().() string { |
| 22 | s := fmtscip-go gomod github.com/golang/go/src go1.24 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24 fmt/Sprintf().("canRecover=%t\n", R.canRecoverscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#canRecover.) |
| 23 | for t, a := range R.Actionsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#Actions. { |
| 24 | s += strconvscip-go gomod github.com/golang/go/src go1.24 strconv/.Itoascip-go gomod github.com/golang/go/src go1.24 strconv/Itoa().(int(t)) + " : " + a.Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Action#String.() + "\n" |
| 25 | } |
| 26 | return s |
| 27 | } |
| 28 | |
| 29 | type ( |
| 30 | Acceptscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Accept# int |
| 31 | Shiftscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Shift# Statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/State# |
| 32 | Reducescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Reduce# int |
| 33 | |
| 34 | Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Action# interface { |
| 35 | Actscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Action#Act.() |
| 36 | Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Action#String.() string |
| 37 | } |
| 38 | ) |
| 39 | |
| 40 | func (this Acceptscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Accept#) Actscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Accept#Act().() {} |
| 41 | func (this Shiftscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Shift#) Actscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Shift#Act().() {} |
| 42 | func (this Reducescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Reduce#) Actscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Reduce#Act().() {} |
| 43 | |
| 44 | func (this Acceptscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Accept#) Equalscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Accept#Equal().(that Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Action#) bool { |
| 45 | if _, ok := that.(Acceptscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Accept#); ok { |
| 46 | return true |
| 47 | } |
| 48 | return false |
| 49 | } |
| 50 | |
| 51 | func (this Reducescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Reduce#) Equalscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Reduce#Equal().(that Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Action#) bool { |
| 52 | that1, ok := that.(Reducescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Reduce#) |
| 53 | if !ok { |
| 54 | return false |
| 55 | } |
| 56 | return this == that1 |
| 57 | } |
| 58 | |
| 59 | func (this Shiftscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Shift#) Equalscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Shift#Equal().(that Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Action#) bool { |
| 60 | that1, ok := that.(Shiftscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Shift#) |
| 61 | if !ok { |
| 62 | return false |
| 63 | } |
| 64 | return this == that1 |
| 65 | } |
| 66 | |
| 67 | func (this Acceptscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Accept#) Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Accept#String().() string { return "Accept(0)" } |
| 68 | func (this Shiftscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Shift#) Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Shift#String().() string { return fmtscip-go gomod github.com/golang/go/src go1.24 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24 fmt/Sprintf().("Shift:%d", this) } |
| 69 | func (this Reducescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Reduce#) Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Reduce#String().() string { |
| 70 | return fmtscip-go gomod github.com/golang/go/src go1.24 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24 fmt/Sprintf().("Reduce:%d(%s)", this, ProductionsTablescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ProductionsTable.[this].Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ProdTabEntry#String.) |
| 71 | } |
| 72 | |
| 73 | type ( |
| 74 | GotoTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/GotoTab# []GotoRowscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/GotoRow# |
| 75 | GotoRowscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/GotoRow# map[NTscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/NT#]Statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/State# |
| 76 | Statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/State# int |
| 77 | NTscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/NT# string |
| 78 | ) |
| 79 | |
| 80 | type ( |
| 81 | ProdTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ProdTab# []ProdTabEntryscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ProdTabEntry# |
| 82 | ProdTabEntryscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ProdTabEntry# struct { |
| 83 | Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ProdTabEntry#String. string |
| 84 | Headscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ProdTabEntry#Head. NTscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/NT# |
| 85 | NumSymbolsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ProdTabEntry#NumSymbols. int |
| 86 | ReduceFuncscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ProdTabEntry#ReduceFunc. func([]Attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Attrib#) (Attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Attrib#, error) |
| 87 | } |
| 88 | Attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Attrib# interface { |
| 89 | } |
| 90 | ) |
| 91 | |
| 92 | // Stack |
| 93 | |
| 94 | type stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack# struct { |
| 95 | statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#state. []Statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/State# |
| 96 | attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#attrib. []Attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Attrib# |
| 97 | } |
| 98 | |
| 99 | const INITIAL_STACK_SIZEscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/INITIAL_STACK_SIZE. = 100 |
| 100 | |
| 101 | func NewStackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/NewStack().() *stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack# { |
| 102 | return &stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#{statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#state.: make([]Statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/State#, 0, INITIAL_STACK_SIZEscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/INITIAL_STACK_SIZE.), |
| 103 | attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#attrib.: make([]Attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Attrib#, 0, INITIAL_STACK_SIZEscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/INITIAL_STACK_SIZE.), |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | func (this *stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#) resetscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#reset().() { |
| 108 | this.statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#state. = this.statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#state.[0:0] |
| 109 | this.attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#attrib. = this.attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#attrib.[0:0] |
| 110 | } |
| 111 | |
| 112 | func (this *stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#) Pushscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Push().(s Statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/State#, a Attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Attrib#) { |
| 113 | this.statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#state. = append(this.statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#state., s) |
| 114 | this.attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#attrib. = append(this.attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#attrib., a) |
| 115 | } |
| 116 | |
| 117 | func (this *stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#) Topscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Top().() Statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/State# { |
| 118 | return this.statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#state.[len(this.statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#state.)-1] |
| 119 | } |
| 120 | |
| 121 | func (this *stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#) Peekscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Peek().(pos int) Statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/State# { |
| 122 | return this.statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#state.[pos] |
| 123 | } |
| 124 | |
| 125 | func (this *stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#) TopIndexscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#TopIndex().() int { |
| 126 | return len(this.statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#state.) - 1 |
| 127 | } |
| 128 | |
| 129 | func (this *stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#) PopNscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#PopN().(items int) []Attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Attrib# { |
| 130 | lo, hi := len(this.statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#state.)-items, len(this.statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#state.) |
| 131 | |
| 132 | attrib := this.attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#attrib.[lo:hi] |
| 133 | |
| 134 | this.statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#state. = this.statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#state.[:lo] |
| 135 | this.attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#attrib. = this.attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#attrib.[:lo] |
| 136 | |
| 137 | return attrib |
| 138 | } |
| 139 | |
| 140 | func (S *stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#) Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#String().() string { |
| 141 | res := "stack:\n" |
| 142 | for i, st := range S.statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#state. { |
| 143 | res += "\t" + strconvscip-go gomod github.com/golang/go/src go1.24 strconv/.Itoascip-go gomod github.com/golang/go/src go1.24 strconv/Itoa().(i) + ": " + strconvscip-go gomod github.com/golang/go/src go1.24 strconv/.Itoascip-go gomod github.com/golang/go/src go1.24 strconv/Itoa().(int(st)) |
| 144 | res += " , " |
| 145 | if S.attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#attrib.[i] == nil { |
| 146 | res += "nil" |
| 147 | } else { |
| 148 | res += fmtscip-go gomod github.com/golang/go/src go1.24 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24 fmt/Sprintf().("%v", S.attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#attrib.[i]) |
| 149 | } |
| 150 | res += "\n" |
| 151 | } |
| 152 | return res |
| 153 | } |
| 154 | |
| 155 | // Parser |
| 156 | |
| 157 | type Parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser# struct { |
| 158 | actTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#actTab. ActionTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionTab# |
| 159 | gotoTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#gotoTab. GotoTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/GotoTab# |
| 160 | prodTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#prodTab. ProdTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ProdTab# |
| 161 | stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack. *stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack# |
| 162 | nextTokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#nextToken. *tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/.Tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/Token# |
| 163 | posscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#pos. tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/.Positionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/Position# |
| 164 | tokenMapscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#tokenMap. *tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/.TokenMapscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/TokenMap# |
| 165 | } |
| 166 | |
| 167 | type Scannerscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Scanner# interface { |
| 168 | Scanscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Scanner#Scan.() (*tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/.Tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/Token#, tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/.Positionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/Position#) |
| 169 | } |
| 170 | |
| 171 | func NewParserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/NewParser().(act ActionTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionTab#, gto GotoTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/GotoTab#, prod ProdTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ProdTab#, tm *tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/.TokenMapscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/TokenMap#) *Parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser# { |
| 172 | p := &Parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#{actTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#actTab.: act, gotoTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#gotoTab.: gto, prodTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#prodTab.: prod, stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack.: NewStackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/NewStack().(), tokenMapscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#tokenMap.: tm} |
| 173 | p.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..Pushscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Push().(0, nil) |
| 174 | return p |
| 175 | } |
| 176 | |
| 177 | func (P *Parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#) Resetscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#Reset().() { |
| 178 | P.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..resetscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#reset().() |
| 179 | P.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..Pushscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Push().(0, nil) |
| 180 | } |
| 181 | |
| 182 | func Accscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Acc().() { |
| 183 | fmtscip-go gomod github.com/golang/go/src go1.24 fmt/.Printlnscip-go gomod github.com/golang/go/src go1.24 fmt/Println().("Accept") |
| 184 | } |
| 185 | |
| 186 | func (P *Parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#) Errorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#Error().(err error, scanner Scannerscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Scanner#) (recovered bool, errorAttrib *errsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/.Errorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/Error#) { |
| 187 | errorAttrib = &errsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/.Errorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/Error#{ |
| 188 | Errscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/Error#Err.: err, |
| 189 | ErrorTokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/Error#ErrorToken.: P.nextTokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#nextToken., |
| 190 | ErrorPosscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/Error#ErrorPos.: P.posscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#pos., |
| 191 | ErrorSymbolsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/Error#ErrorSymbols.: P.popNonRecoveryStatesscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#popNonRecoveryStates().(), |
| 192 | ExpectedTokensscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/Error#ExpectedTokens.: make([]string, 0, 8), |
| 193 | } |
| 194 | for t := range P.actTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#actTab.[P.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..Topscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Top().()].Actionsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#Actions. { |
| 195 | errorAttrib.ExpectedTokensscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/Error#ExpectedTokens. = append(errorAttrib.ExpectedTokensscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/Error#ExpectedTokens., P.tokenMapscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#tokenMap..TokenStringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/TokenMap#TokenString().(t)) |
| 196 | } |
| 197 | |
| 198 | action, ok := P.actTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#actTab.[P.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..Topscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Top().()].Actionsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#Actions.[P.tokenMapscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#tokenMap..Typescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/TokenMap#Type().("error")] |
| 199 | if !ok { |
| 200 | return |
| 201 | } |
| 202 | P.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..Pushscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Push().(Statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/State#(action.(Shiftscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Shift#)), errorAttrib) // action can only be shift |
| 203 | |
| 204 | _, recovered = P.actTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#actTab.[P.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..Topscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Top().()].Actionsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#Actions.[P.nextTokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#nextToken..Typescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/Token#Type.] |
| 205 | for !recovered && P.nextTokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#nextToken..Typescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/Token#Type. != tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/.EOFscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/EOF. { |
| 206 | P.nextTokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#nextToken., P.posscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#pos. = scanner.Scanscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Scanner#Scan.() |
| 207 | _, recovered = P.actTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#actTab.[P.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..Topscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Top().()].Actionsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#Actions.[P.nextTokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#nextToken..Typescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/Token#Type.] |
| 208 | } |
| 209 | |
| 210 | return |
| 211 | } |
| 212 | |
| 213 | func (P *Parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#) popNonRecoveryStatesscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#popNonRecoveryStates().() (removedAttribs []errsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/.ErrorSymbolscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/ErrorSymbol#) { |
| 214 | if rs, ok := P.firstRecoveryStatescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#firstRecoveryState().(); ok { |
| 215 | errorSymbols := P.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..PopNscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#PopN().(P.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..TopIndexscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#TopIndex().() - rs) |
| 216 | removedAttribs = make([]errsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/.ErrorSymbolscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/ErrorSymbol#, len(errorSymbols)) |
| 217 | for i, e := range errorSymbols { |
| 218 | removedAttribs[i] = e |
| 219 | } |
| 220 | } else { |
| 221 | removedAttribs = []errsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/.ErrorSymbolscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/ErrorSymbol#{} |
| 222 | } |
| 223 | return |
| 224 | } |
| 225 | |
| 226 | // recoveryState points to the highest state on the stack, which can recover |
| 227 | func (P *Parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#) firstRecoveryStatescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#firstRecoveryState().() (recoveryState int, canRecover bool) { |
| 228 | recoveryState, canRecover = P.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..TopIndexscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#TopIndex().(), P.actTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#actTab.[P.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..Topscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Top().()].canRecoverscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#canRecover. |
| 229 | for recoveryState > 0 && !canRecover { |
| 230 | recoveryState-- |
| 231 | canRecover = P.actTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#actTab.[P.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..Peekscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Peek().(recoveryState)].canRecoverscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#canRecover. |
| 232 | } |
| 233 | return |
| 234 | } |
| 235 | |
| 236 | func (P *Parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#) newErrorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#newError().(err error) error { |
| 237 | errmsg := "Error: " + P.TokStringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#TokString().(P.nextTokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#nextToken.) + " @ " + P.posscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#pos..Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/Position#String().() |
| 238 | if err != nil { |
| 239 | errmsg += " " + err.Error() |
| 240 | } else { |
| 241 | errmsg += ", expected one of: " |
| 242 | actRow := P.actTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#actTab.[P.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..Topscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Top().()] |
| 243 | i := 0 |
| 244 | for t := range actRow.Actionsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#Actions. { |
| 245 | errmsg += P.tokenMapscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#tokenMap..TokenStringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/TokenMap#TokenString().(t) |
| 246 | if i < len(actRow.Actionsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#Actions.)-1 { |
| 247 | errmsg += " " |
| 248 | } |
| 249 | i++ |
| 250 | } |
| 251 | } |
| 252 | return errorsscip-go gomod github.com/golang/go/src go1.24 errors/.Newscip-go gomod github.com/golang/go/src go1.24 errors/New().(errmsg) |
| 253 | } |
| 254 | |
| 255 | func (P *Parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#) TokStringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#TokString().(tok *tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/.Tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/Token#) string { |
| 256 | msg := P.tokenMapscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#tokenMap..TokenStringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/TokenMap#TokenString().(tok.Typescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/Token#Type.) + "(" + strconvscip-go gomod github.com/golang/go/src go1.24 strconv/.Itoascip-go gomod github.com/golang/go/src go1.24 strconv/Itoa().(int(tok.Typescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/Token#Type.)) + ")" |
| 257 | msg += " " + string(tok.Litscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/Token#Lit.) |
| 258 | return msg |
| 259 | } |
| 260 | |
| 261 | func (this *Parserscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#) Parsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#Parse().(scanner Scannerscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Scanner#) (res interface{}, err error) { |
| 262 | this.Resetscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#Reset().() |
| 263 | this.nextTokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#nextToken., this.posscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#pos. = scanner.Scanscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Scanner#Scan.() |
| 264 | for acc := false; !acc; { |
| 265 | action, ok := this.actTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#actTab.[this.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..Topscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Top().()].Actionsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#Actions.[this.nextTokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#nextToken..Typescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/Token#Type.] |
| 266 | if !ok { |
| 267 | if recovered, errAttrib := this.Errorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#Error().(nil, scanner); !recovered { |
| 268 | this.nextTokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#nextToken., this.posscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#pos. = errAttrib.ErrorTokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/Error#ErrorToken., errAttrib.ErrorPosscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/errors`/Error#ErrorPos. |
| 269 | return nil, this.newErrorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#newError().(nil) |
| 270 | } |
| 271 | if action, ok = this.actTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#actTab.[this.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..Topscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Top().()].Actionsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ActionRow#Actions.[this.nextTokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#nextToken..Typescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/token`/Token#Type.]; !ok { |
| 272 | panic("Error recover led to invalid action") |
| 273 | } |
| 274 | } |
| 275 | // fmt.Printf("S%d %s %s\n", this.stack.Top(), this.nextToken, action) |
| 276 | switch act := action.(type) { |
| 277 | case Acceptscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Accept#: |
| 278 | res = this.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..PopNscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#PopN().(1)[0] |
| 279 | acc = true |
| 280 | case Shiftscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Shift#: |
| 281 | this.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..Pushscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Push().(Statescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/State#(act), this.nextTokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#nextToken.) |
| 282 | this.nextTokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#nextToken., this.posscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#pos. = scanner.Scanscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Scanner#Scan.() |
| 283 | case Reducescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Reduce#: |
| 284 | prod := this.prodTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#prodTab.[int(act)] |
| 285 | attrib, err := prod.ReduceFuncscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ProdTabEntry#ReduceFunc.(this.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..PopNscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#PopN().(prod.NumSymbolsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ProdTabEntry#NumSymbols.)) |
| 286 | if err != nil { |
| 287 | return nil, this.newErrorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#newError().(err) |
| 288 | } else { |
| 289 | this.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..Pushscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Push().(this.gotoTabscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#gotoTab.[this.stackscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Parser#stack..Topscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/stack#Top().()][prod.Headscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/ProdTabEntry#Head.], attrib) |
| 290 | } |
| 291 | default: |
| 292 | panic("unknown action: " + action.Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/frontend/parser`/Action#String.()) |
| 293 | } |
| 294 | } |
| 295 | return res, nil |
| 296 | } |