LEFT | RIGHT |
(Both sides are equal) |
1 // Copyright 2013 The Go Authors. All rights reserved. | 1 // Copyright 2013 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // This is an example of a goyacc program. | 5 // This is an example of a goyacc program. |
6 // To build it: | 6 // To build it: |
7 // go tool yacc -p "expr" expr.y (produces y.go) | 7 // go tool yacc -p "expr" expr.y (produces y.go) |
8 // go build -o expr y.go | 8 // go build -o expr y.go |
9 // expr | 9 // expr |
10 // > <type an expression> | 10 // > <type an expression> |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 if err == io.EOF { | 191 if err == io.EOF { |
192 return | 192 return |
193 } | 193 } |
194 if err != nil { | 194 if err != nil { |
195 log.Fatalf("ReadBytes: %s", err) | 195 log.Fatalf("ReadBytes: %s", err) |
196 } | 196 } |
197 | 197 |
198 exprParse(&exprLex{line: line}) | 198 exprParse(&exprLex{line: line}) |
199 } | 199 } |
200 } | 200 } |
LEFT | RIGHT |