title: Simplest of parsers in go tool yacc
body: <p>Using this command: </p>
  
  <pre><code>go tool yacc -p Verb -o verb.go boilerplate.y
  </code></pre>
  
  <p>Trying to build this yacc file:</p>
  
  <pre><code>// boilerplate.y
  %{
  
  package main
  
  import (
      "bufio"
      "fmt"
      "os"
      "unicode"
  )
  
  %}
  
  %% 
  
  .|\n   ECHO;
  
  %%
  
  func main() {
      fi := bufio.NewReader(os.NewFile(0, "stdin"))
    s, err := fi.ReadString('\n')
    if err != nil {
      fmt.Println('error', err)
    } 
  
    VerbParse(&amp;VerbLex{s: s})
  }
  </code></pre>
  
  <p>Error: <code>bad syntax on first rule: boilerplate.y:16</code></p>
  
  <p>Successfully got this example to work: </p>
  
  <p><a href="https://github.com/golang-samples/yacc/blob/master/simple/calc.y">https://github.com/golang-samples/yacc/blob/master/simple/calc.y</a></p>
  
  <p>Trying to build my own and work through the lex &amp; yacc book.  Resources seem limited to non existent.</p>