mirror of https://github.com/prometheus/prometheus
Browse Source
This is the first step towards a generated lexer as described in #6256. It adds methods to the parser struct, that make it implement the yyLexer interface required by a yacc generated parser, as described here: https://godoc.org/golang.org/x/tools/cmd/goyacc . The yyLexer interface is implemented by the parser struct instead of the lexer struct for the following reasons: * Both parsers have a lookahead that the lexer does not know about. This solution makes it possible to synchronize these lookaheads when switching parsers. * The routines to handle parser errors are not accessible to the lexer. Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>pull/6381/head
Tobias Guggenmos
5 years ago
committed by
Brian Brazil
1 changed files with 27 additions and 0 deletions
Loading…
Reference in new issue