mirror of https://github.com/prometheus/prometheus
promql: Implement yyLexer interface (#6370)
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
parent
bd1c66861a
commit
c229ed17e2
Loading…
Reference in new issue