| 1 | package astscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/ |
| 2 | |
| 3 | import ( |
| 4 | "github.com/goccmack/gocc/example/sr/tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/token`/" |
| 5 | ) |
| 6 | |
| 7 | type ( |
| 8 | Attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Attrib# interface{} |
| 9 | |
| 10 | Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt# interface { |
| 11 | Equalsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#Equals.(Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#) bool |
| 12 | MatchIfscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#MatchIf.(cnd string, s Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#) bool |
| 13 | MatchIfElsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#MatchIfElse.(cnd string, s1, s2 Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#) bool |
| 14 | MatchIdscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#MatchId.(s string) bool |
| 15 | Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#String.() string |
| 16 | } |
| 17 | |
| 18 | Ifscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If# struct { |
| 19 | Cscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#C. string |
| 20 | Sscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#S. Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt# |
| 21 | } |
| 22 | |
| 23 | IfElsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse# struct { |
| 24 | Cscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#C. string |
| 25 | S1scip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#S1., S2scip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#S2. Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt# |
| 26 | } |
| 27 | |
| 28 | IdStmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IdStmt# string |
| 29 | ) |
| 30 | |
| 31 | func NewIfscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/NewIf().(cnd, stmt Attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Attrib#) (ifs *Ifscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#) { |
| 32 | ifs = &Ifscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#{ |
| 33 | Cscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#C.: string(cnd.(*tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/token`/.Tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/token`/Token#).Litscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/token`/Token#Lit.), |
| 34 | Sscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#S.: stmt.(Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#), |
| 35 | } |
| 36 | return |
| 37 | } |
| 38 | |
| 39 | func NewIfElsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/NewIfElse().(cnd, stmt1, stmt2 Attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Attrib#) (ies *IfElsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#) { |
| 40 | ies = &IfElsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#{ |
| 41 | Cscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#C.: string(cnd.(*tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/token`/.Tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/token`/Token#).Litscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/token`/Token#Lit.), |
| 42 | S1scip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#S1.: stmt1.(Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#), |
| 43 | S2scip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#S2.: stmt2.(Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#), |
| 44 | } |
| 45 | return |
| 46 | } |
| 47 | |
| 48 | func NewIdStmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/NewIdStmt().(s Attribscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Attrib#) (is IdStmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IdStmt#) { |
| 49 | is = IdStmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IdStmt#(s.(*tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/token`/.Tokenscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/token`/Token#).Litscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/token`/Token#Lit.) |
| 50 | return |
| 51 | } |
| 52 | |
| 53 | func (this *Ifscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#) Equalsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#Equals().(that Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#) bool { |
| 54 | if this == that { |
| 55 | return true |
| 56 | } |
| 57 | that1, ok := that.(*Ifscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#) |
| 58 | if !ok { |
| 59 | return false |
| 60 | } |
| 61 | return this.Cscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#C. == that1.Cscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#C. && this.Sscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#S..Equalsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#Equals.(that1.Sscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#S.) |
| 62 | } |
| 63 | |
| 64 | func (this *IfElsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#) Equalsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#Equals().(that Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#) bool { |
| 65 | if this == that { |
| 66 | return true |
| 67 | } |
| 68 | that1, ok := that.(*IfElsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#) |
| 69 | if !ok { |
| 70 | return false |
| 71 | } |
| 72 | return this.Cscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#C. == that1.Cscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#C. && this.S1scip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#S1..Equalsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#Equals.(that1.S1scip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#S1.) && this.S2scip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#S2..Equalsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#Equals.(that1.S2scip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#S2.) |
| 73 | } |
| 74 | |
| 75 | func (this IdStmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IdStmt#) Equalsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IdStmt#Equals().(that Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#) bool { |
| 76 | if this == "" { |
| 77 | return false |
| 78 | } |
| 79 | that1, ok := that.(IdStmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IdStmt#) |
| 80 | if !ok { |
| 81 | return false |
| 82 | } |
| 83 | return this == that1 |
| 84 | } |
| 85 | |
| 86 | func (this *Ifscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#) MatchIfscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#MatchIf().(cnd string, s Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#) bool { |
| 87 | return this.Cscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#C. == cnd && this.Sscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#S..Equalsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#Equals.(s) |
| 88 | } |
| 89 | |
| 90 | func (this *IfElsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#) MatchIfscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#MatchIf().(cnd string, s Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#) bool { |
| 91 | return false |
| 92 | } |
| 93 | |
| 94 | func (this IdStmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IdStmt#) MatchIfscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IdStmt#MatchIf().(cnd string, s Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#) bool { |
| 95 | return false |
| 96 | } |
| 97 | |
| 98 | func (this *Ifscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#) MatchIfElsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#MatchIfElse().(cnd string, s1, s2 Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#) bool { |
| 99 | return false |
| 100 | } |
| 101 | |
| 102 | func (this *IfElsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#) MatchIfElsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#MatchIfElse().(cnd string, s1, s2 Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#) bool { |
| 103 | return this.Cscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#C. == cnd && this.S1scip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#S1..Equalsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#Equals.(s1) && this.S2scip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#S2..Equalsscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#Equals.(s2) |
| 104 | } |
| 105 | |
| 106 | func (this IdStmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IdStmt#) MatchIfElsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IdStmt#MatchIfElse().(cnd string, s1, s2 Stmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#) bool { |
| 107 | return false |
| 108 | } |
| 109 | |
| 110 | func (this *Ifscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#) MatchIdscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#MatchId().(s string) bool { |
| 111 | return false |
| 112 | } |
| 113 | |
| 114 | func (this *IfElsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#) MatchIdscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#MatchId().(s string) bool { |
| 115 | return false |
| 116 | } |
| 117 | |
| 118 | func (this IdStmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IdStmt#) MatchIdscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IdStmt#MatchId().(s string) bool { |
| 119 | return this == IdStmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IdStmt#(s) |
| 120 | } |
| 121 | |
| 122 | func (this *Ifscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#) Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#String().() string { |
| 123 | return "*If: " + this.Cscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#C. + this.Sscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/If#S..Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#String.() |
| 124 | } |
| 125 | |
| 126 | func (this *IfElsescip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#) Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#String().() string { |
| 127 | return "*IfElse: " + this.Cscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#C. + this.S1scip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#S1..Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#String.() + this.S2scip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IfElse#S2..Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/Stmt#String.() |
| 128 | } |
| 129 | |
| 130 | func (this IdStmtscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IdStmt#) Stringscip-go gomod github.com/goccmack/gocc . `github.com/goccmack/gocc/example/sr/ast`/IdStmt#String().() string { |
| 131 | return "IdStmt: " + string(this) |
| 132 | } |