summaryrefslogtreecommitdiff
path: root/src/cmd/goyacc/doc.go
diff options
context:
space:
mode:
authorRoger Peppe <rogpeppe@gmail.com>2010-05-17 12:23:48 -0700
committerRoger Peppe <rogpeppe@gmail.com>2010-05-17 12:23:48 -0700
commitbb0a7fa32dd9b1a61b926d3ef67e99b43735f06c (patch)
treefb22d8c89d8c6a9f5e94ce6d9e4ceba86c4209e8 /src/cmd/goyacc/doc.go
parent1ed124cc391b61c8cb24263ae4027276c0e24cb3 (diff)
downloadgolang-bb0a7fa32dd9b1a61b926d3ef67e99b43735f06c.tar.gz
Add Error member to yyLexer type (yyError
has no access to yylex) R=ken2, ken3 CC=golang-dev http://codereview.appspot.com/813047 Committer: Ken Thompson <ken@golang.org>
Diffstat (limited to 'src/cmd/goyacc/doc.go')
-rw-r--r--src/cmd/goyacc/doc.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cmd/goyacc/doc.go b/src/cmd/goyacc/doc.go
index eea70adab..686f75745 100644
--- a/src/cmd/goyacc/doc.go
+++ b/src/cmd/goyacc/doc.go
@@ -24,10 +24,12 @@ argument that conforms to the following interface:
type yyLexer interface {
Lex(lval *yySymType) int
+ Error(e string)
}
Lex should return the token identifier, and place other token
information in lval (which replaces the usual yylval).
+Error is equivalent to yyerror in the original yacc.
Code inside the parser may refer to the variable yylex
which holds the yyLexer passed to Parse.