| 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 astscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/ |
| 16 | |
| 17 | import ( |
| 18 | "fmtscip-go gomod github.com/golang/go/src go1.24 fmt/" |
| 19 | ) |
| 20 | |
| 21 | func walkLexNodescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/walkLexNode().(node LexNodescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNode#, visitor LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#) LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor# { |
| 22 | switch n := node.(type) { |
| 23 | case *LexAltscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexAlt#: |
| 24 | return n.Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexAlt#Walk().(visitor) |
| 25 | case *LexCharLitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexCharLit#: |
| 26 | return n.Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexCharLit#Walk().(visitor) |
| 27 | case *LexCharRangescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexCharRange#: |
| 28 | return n.Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexCharRange#Walk().(visitor) |
| 29 | case *LexDotscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexDot#: |
| 30 | return n.Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexDot#Walk().(visitor) |
| 31 | case *LexGroupPatternscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexGroupPattern#: |
| 32 | return n.Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexGroupPattern#Walk().(visitor) |
| 33 | case *LexIgnoredTokDefscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexIgnoredTokDef#: |
| 34 | return n.Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexIgnoredTokDef#Walk().(visitor) |
| 35 | case *LexImportsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexImports#: |
| 36 | return n.Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexImports#Walk().(visitor) |
| 37 | case *LexOptPatternscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexOptPattern#: |
| 38 | return n.Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexOptPattern#Walk().(visitor) |
| 39 | case *LexPatternscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexPattern#: |
| 40 | return n.Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexPattern#Walk().(visitor) |
| 41 | case *LexProductionsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexProductions#: |
| 42 | return n.Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexProductions#Walk().(visitor) |
| 43 | case *LexRegDefscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexRegDef#: |
| 44 | return n.Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexRegDef#Walk().(visitor) |
| 45 | case *LexRegDefIdscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexRegDefId#: |
| 46 | return n.Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexRegDefId#Walk().(visitor) |
| 47 | case *LexRepPatternscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexRepPattern#: |
| 48 | return n.Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexRepPattern#Walk().(visitor) |
| 49 | case *LexTokDefscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexTokDef#: |
| 50 | return n.Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexTokDef#Walk().(visitor) |
| 51 | } |
| 52 | panic(fmtscip-go gomod github.com/golang/go/src go1.24 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24 fmt/Sprintf().("Unsupported LexNode type %T", node)) |
| 53 | } |
| 54 | |
| 55 | func (this *LexAltscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexAlt#) Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexAlt#Walk().(visitor LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#) LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor# { |
| 56 | for _, term := range this.Termsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexAlt#Terms. { |
| 57 | if v := walkLexNodescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/walkLexNode().(term, visitor); v == nil { |
| 58 | return nil |
| 59 | } |
| 60 | } |
| 61 | return visitor.Visitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#Visit.(this) |
| 62 | } |
| 63 | |
| 64 | func (this *LexCharLitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexCharLit#) Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexCharLit#Walk().(visitor LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#) LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor# { |
| 65 | return visitor.Visitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#Visit.(this) |
| 66 | } |
| 67 | |
| 68 | func (this *LexCharRangescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexCharRange#) Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexCharRange#Walk().(visitor LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#) LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor# { |
| 69 | return visitor.Visitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#Visit.(this) |
| 70 | } |
| 71 | |
| 72 | func (this *LexDotscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexDot#) Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexDot#Walk().(visitor LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#) LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor# { |
| 73 | return visitor.Visitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#Visit.(this) |
| 74 | } |
| 75 | |
| 76 | func (this *LexGroupPatternscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexGroupPattern#) Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexGroupPattern#Walk().(visitor LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#) LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor# { |
| 77 | for _, term := range this.LexPatternscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexGroupPattern#LexPattern..Alternativesscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexPattern#Alternatives. { |
| 78 | if v := walkLexNodescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/walkLexNode().(term, visitor); v == nil { |
| 79 | return nil |
| 80 | } |
| 81 | } |
| 82 | return visitor.Visitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#Visit.(this) |
| 83 | } |
| 84 | |
| 85 | func (this *LexIgnoredTokDefscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexIgnoredTokDef#) Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexIgnoredTokDef#Walk().(visitor LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#) LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor# { |
| 86 | return visitor.Visitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#Visit.(this) |
| 87 | } |
| 88 | |
| 89 | func (this *LexImportsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexImports#) Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexImports#Walk().(visitor LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#) LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor# { |
| 90 | return visitor.Visitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#Visit.(this) |
| 91 | } |
| 92 | |
| 93 | func (this *LexOptPatternscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexOptPattern#) Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexOptPattern#Walk().(visitor LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#) LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor# { |
| 94 | for _, term := range this.LexPatternscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexOptPattern#LexPattern..Alternativesscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexPattern#Alternatives. { |
| 95 | if v := walkLexNodescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/walkLexNode().(term, visitor); v == nil { |
| 96 | return nil |
| 97 | } |
| 98 | } |
| 99 | return visitor.Visitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#Visit.(this) |
| 100 | } |
| 101 | |
| 102 | func (this *LexPatternscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexPattern#) Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexPattern#Walk().(visitor LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#) LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor# { |
| 103 | for _, term := range this.Alternativesscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexPattern#Alternatives. { |
| 104 | if v := walkLexNodescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/walkLexNode().(term, visitor); v == nil { |
| 105 | return nil |
| 106 | } |
| 107 | } |
| 108 | return visitor.Visitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#Visit.(this) |
| 109 | } |
| 110 | |
| 111 | func (this *LexProductionsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexProductions#) Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexProductions#Walk().(visitor LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#) LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor# { |
| 112 | for _, term := range this.Productionsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexProductions#Productions. { |
| 113 | if v := walkLexNodescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/walkLexNode().(term, visitor); v == nil { |
| 114 | return nil |
| 115 | } |
| 116 | } |
| 117 | return visitor.Visitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#Visit.(this) |
| 118 | } |
| 119 | |
| 120 | func (this *LexRegDefscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexRegDef#) Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexRegDef#Walk().(visitor LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#) LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor# { |
| 121 | return visitor.Visitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#Visit.(this) |
| 122 | } |
| 123 | |
| 124 | func (this *LexRegDefIdscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexRegDefId#) Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexRegDefId#Walk().(visitor LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#) LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor# { |
| 125 | return visitor.Visitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#Visit.(this) |
| 126 | } |
| 127 | |
| 128 | func (this *LexRepPatternscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexRepPattern#) Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexRepPattern#Walk().(visitor LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#) LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor# { |
| 129 | for _, term := range this.LexPatternscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexRepPattern#LexPattern..Alternativesscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexPattern#Alternatives. { |
| 130 | if v := walkLexNodescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/walkLexNode().(term, visitor); v == nil { |
| 131 | return nil |
| 132 | } |
| 133 | } |
| 134 | return visitor.Visitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#Visit.(this) |
| 135 | } |
| 136 | |
| 137 | func (this *LexTokDefscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexTokDef#) Walkscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexTokDef#Walk().(visitor LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#) LexNodeVisitorscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor# { |
| 138 | return visitor.Visitscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/internal/ast`/LexNodeVisitor#Visit.(this) |
| 139 | } |