MCPcopy
hub / github.com/grafana/tempo / Parse

Method Parse

pkg/traceql/expr.y.go:807–2148  ·  view source on GitHub ↗
(yylex yyLexer)

Source from the content-addressed store, hash-verified

805}
806
807func (yyrcvr *yyParserImpl) Parse(yylex yyLexer) int {
808 var yyn int
809 var yyVAL yySymType
810 var yyDollar []yySymType
811 _ = yyDollar // silence set and not used
812 yyS := yyrcvr.stack[:]
813
814 Nerrs := 0 /* number of errors */
815 Errflag := 0 /* error recovery flag */
816 yystate := 0
817 yyrcvr.char = -1
818 yytoken := -1 // yyrcvr.char translated into internal numbering
819 defer func() {
820 // Make sure we report no lookahead when not parsing.
821 yystate = -1
822 yyrcvr.char = -1
823 yytoken = -1
824 }()
825 yyp := -1
826 goto yystack
827
828ret0:
829 return 0
830
831ret1:
832 return 1
833
834yystack:
835 /* put a state and value onto the stack */
836 if yyDebug >= 4 {
837 __yyfmt__.Printf("char %v in %v\n", yyTokname(yytoken), yyStatname(yystate))
838 }
839
840 yyp++
841 if yyp >= len(yyS) {
842 nyys := make([]yySymType, len(yyS)*2)
843 copy(nyys, yyS)
844 yyS = nyys
845 }
846 yyS[yyp] = yyVAL
847 yyS[yyp].yys = yystate
848
849yynewstate:
850 yyn = int(yyPact[yystate])
851 if yyn <= yyFlag {
852 goto yydefault /* simple state */
853 }
854 if yyrcvr.char < 0 {
855 yyrcvr.char, yytoken = yylex1(yylex, &yyrcvr.lval)
856 }
857 yyn += yytoken
858 if yyn < 0 || yyn >= yyLast {
859 goto yydefault
860 }
861 yyn = int(yyAct[yyn])
862 if int(yyChk[yyn]) == yytoken { /* valid shift */
863 yyrcvr.char = -1
864 yytoken = -1

Callers

nothing calls this directly

Calls 15

yyToknameFunction · 0.85
yyStatnameFunction · 0.85
yylex1Function · 0.85
yyErrorMessageFunction · 0.85
newRootExprFunction · 0.85
newRootExprWithMetricsFunction · 0.85
newSpansetOperationFunction · 0.85
newPipelineFunction · 0.85
newGroupOperationFunction · 0.85
newCoalesceOperationFunction · 0.85
newSelectOperationFunction · 0.85

Tested by

no test coverage detected