github.com/ccccaoqing/test@v0.0.0-20220510085219-3985d23445c0/src/cmd/yacc/testdata/expr/main.go (about)

     1  // Copyright 2014 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // This file holds the go generate command to run yacc on the grammar in expr.y.
     6  // To build expr:
     7  //	% go generate
     8  //	% go build
     9  
    10  //go:generate -command yacc go tool yacc
    11  //go:generate yacc -o expr.go -p "expr" expr.y
    12  
    13  // Expr is a simple expression evaluator that serves as a working example of
    14  // how to use Go's yacc implemenation.
    15  package main