Debian Codegraph @

internal/parser/lr1/action/action.go

raw symbols SCIP
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 actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/
16
17 import (
18 "fmtscip-go gomod github.com/golang/go/src go1.24 fmt/"
19 )
20
21 type Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action# interface {
22 Equalscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action#Equal.(Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action#) bool
23 ResolveConflictscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action#ResolveConflict.(that Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action#) Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action#
24 Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action#String.() string
25 }
26
27 type (
28 Acceptscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Accept# bool
29 Errorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Error# bool
30 Reducescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Reduce# int
31 Shiftscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Shift# int
32 )
33
34 const (
35 ACCEPTscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/ACCEPT. = Acceptscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Accept#(true)
36 ERRORscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/ERROR. = Errorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Error#(true)
37 )
38
39 func (Acceptscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Accept#) Equalscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Accept#Equal().(act Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action#) bool {
40 if _, ok := act.(Acceptscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Accept#); ok {
41 return true
42 }
43 return false
44 }
45
46 func (Errorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Error#) Equalscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Error#Equal().(act Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action#) bool {
47 if _, ok := act.(Errorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Error#); ok {
48 return true
49 }
50 return false
51 }
52
53 func (this Reducescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Reduce#) Equalscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Reduce#Equal().(act Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action#) bool {
54 if that, ok := act.(Reducescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Reduce#); ok {
55 return this == that
56 }
57 return false
58 }
59
60 func (this Shiftscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Shift#) Equalscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Shift#Equal().(act Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action#) bool {
61 if that, ok := act.(Shiftscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Shift#); ok {
62 return this == that
63 }
64 return false
65 }
66
67 func (this Acceptscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Accept#) ResolveConflictscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Accept#ResolveConflict().(that Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action#) Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action# {
68 if _, ok := that.(Errorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Error#); ok {
69 return this
70 }
71 panic("Cannot have LR1 conflict with Accept.")
72 }
73
74 func (Errorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Error#) ResolveConflictscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Error#ResolveConflict().(that Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action#) Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action# {
75 return that
76 }
77
78 func (this Shiftscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Shift#) ResolveConflictscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Shift#ResolveConflict().(that Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action#) Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action# {
79 switch that := that.(type) {
80 case Acceptscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Accept#:
81 panic(fmtscip-go gomod github.com/golang/go/src go1.24 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24 fmt/Sprintf().("Impossible conflict: Shift(%d)/Accept", int(this)))
82 case Shiftscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Shift#:
83 panic(fmtscip-go gomod github.com/golang/go/src go1.24 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24 fmt/Sprintf().("Cannot have Shift(%d)/Shift(%d)", int(this), int(that)))
84 case Errorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Error#:
85 return this
86 case Reducescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Reduce#:
87 return this
88 }
89 panic(fmtscip-go gomod github.com/golang/go/src go1.24 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24 fmt/Sprintf().("Conflict with unknown type of action: %T", that))
90 }
91
92 func (this Reducescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Reduce#) ResolveConflictscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Reduce#ResolveConflict().(that Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action#) Actionscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Action# {
93 switch that := that.(type) {
94 case Acceptscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Accept#:
95 panic(fmtscip-go gomod github.com/golang/go/src go1.24 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24 fmt/Sprintf().("Impossible conflict: Shift(%d)/Accept", int(this)))
96 case Shiftscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Shift#:
97 return that
98 case Errorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Error#:
99 return this
100 case Reducescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Reduce#:
101 if this < that {
102 return this
103 }
104 return that
105 }
106 panic(fmtscip-go gomod github.com/golang/go/src go1.24 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24 fmt/Sprintf().("Conflict with unknown type of action: %T", that))
107 }
108
109 func (this Acceptscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Accept#) Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Accept#String().() string {
110 return "accept"
111 }
112
113 func (this Errorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Error#) Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Error#String().() string {
114 return "error"
115 }
116
117 func (this Reducescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Reduce#) Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Reduce#String().() string {
118 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)", this)
119 }
120
121 func (this Shiftscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Shift#) Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/parser/lr1/action`/Shift#String().() string {
122 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)
123 }