]> Cypherpunks repositories - gostls13.git/commitdiff
make goyacc and units.y work again (minor tweaks).
authorRob Pike <r@golang.org>
Wed, 4 Nov 2009 06:38:43 +0000 (22:38 -0800)
committerRob Pike <r@golang.org>
Wed, 4 Nov 2009 06:38:43 +0000 (22:38 -0800)
document goyacc a little.

R=rsc
CC=go-dev
http://go/go-review/1017024

src/cmd/goyacc/Makefile
src/cmd/goyacc/doc.go [new file with mode: 0644]
src/cmd/goyacc/goyacc.go
src/cmd/goyacc/units.y

index 0fb6198042419226c9596f3af7781b0f7f279495..80365b86ee7290028a7990ba588893b9dee363d2 100644 (file)
@@ -11,7 +11,7 @@ GOFILES=\
 include $(GOROOT)/src/Make.cmd
 
 units: goyacc units.y
-       goyacc units.y
+       ./goyacc units.y
        $(GC) y.go
        $(LD) -o units y.$O
 
diff --git a/src/cmd/goyacc/doc.go b/src/cmd/goyacc/doc.go
new file mode 100644 (file)
index 0000000..b6a2580
--- /dev/null
@@ -0,0 +1,23 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+/*
+
+The program goyacc is a version of yacc written in Go and generating
+as output a parser also in Go.
+
+It is largely transliterated from the Inferno version written in Limbo
+which in turn was largely transliterated from the Plan 9 version
+written in C and documented at
+
+       http://plan9.bell-labs.com/magic/man2html/1/yacc
+
+Yacc adepts will have no trouble adapting to this form of the tool.
+
+The file units.y in this directory is a yacc grammar for a version of
+the Unix tool units, also written in Go and largely transliterated
+from the Plan 9 C version.  
+
+*/
+package documentation
index 3304f31dede5d63430c026b1eab7a4ce2575244f..763e61cb03b2632b66b56e74cd68cecaf4aa0a01 100644 (file)
@@ -47,7 +47,6 @@ package main
 import
 (
        "flag";
-       "io";
        "fmt";
        "bufio";
        "os";
@@ -1472,8 +1471,6 @@ cpyact(curprod []int, max int)
 func
 openup()
 {
-       var buf string;
-
        infile = flag.Arg(0);
        finput = open(infile);
        if(finput == nil) {
index a3697a53deabb300212e3b604dd912e9f1bdf68e..44d1cc7588ca0807b1e2719d025eb8a99176dd59 100644 (file)
@@ -26,7 +26,6 @@ package main
 import
 (
        "flag";
-       "io";
        "fmt";
        "bufio";
        "os";