2017-01-14 07:39:04 -08:00
|
|
|
// CAUTION: Generated file - DO NOT EDIT.
|
|
|
|
|
2017-04-19 05:43:09 -07:00
|
|
|
// Copyright 2017 The Prometheus Authors
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2017-01-14 07:39:04 -08:00
|
|
|
package textparse
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"math"
|
|
|
|
"strconv"
|
2017-06-16 05:09:50 -07:00
|
|
|
"unicode/utf8"
|
2017-04-13 02:33:08 -07:00
|
|
|
|
|
|
|
"github.com/prometheus/prometheus/pkg/value"
|
2017-01-14 07:39:04 -08:00
|
|
|
)
|
|
|
|
|
2017-07-07 01:29:38 -07:00
|
|
|
const (
|
|
|
|
lstateInit = iota
|
|
|
|
lstateName
|
|
|
|
lstateValue
|
|
|
|
lstateTimestamp
|
|
|
|
lstateLabels
|
|
|
|
lstateLName
|
|
|
|
lstateLValue
|
|
|
|
lstateLValueIn
|
|
|
|
)
|
|
|
|
|
2017-01-14 07:39:04 -08:00
|
|
|
// Lex is called by the parser generated by "go tool yacc" to obtain each
|
|
|
|
// token. The method is opened before the matching rules block and closed at
|
|
|
|
// the end of the file.
|
|
|
|
func (l *lexer) Lex() int {
|
2017-07-07 01:29:38 -07:00
|
|
|
l.state = lstateInit
|
2017-01-14 07:39:04 -08:00
|
|
|
|
|
|
|
if l.i >= len(l.b) {
|
|
|
|
return eof
|
|
|
|
}
|
|
|
|
c := l.b[l.i]
|
|
|
|
|
2017-04-27 08:02:07 -07:00
|
|
|
l.ts = nil
|
|
|
|
l.mstart = l.nextMstart
|
2017-01-14 10:30:19 -08:00
|
|
|
l.offsets = l.offsets[:0]
|
|
|
|
|
2017-01-14 07:39:04 -08:00
|
|
|
yystate0:
|
|
|
|
|
2017-07-07 01:29:38 -07:00
|
|
|
switch yyt := l.state; yyt {
|
2017-01-14 07:39:04 -08:00
|
|
|
default:
|
|
|
|
panic(fmt.Errorf(`invalid start condition %d`, yyt))
|
|
|
|
case 0: // start condition: INITIAL
|
|
|
|
goto yystart1
|
2017-06-22 00:38:55 -07:00
|
|
|
case 1: // start condition: lstateName
|
|
|
|
goto yystart7
|
|
|
|
case 2: // start condition: lstateValue
|
|
|
|
goto yystart10
|
|
|
|
case 3: // start condition: lstateTimestamp
|
|
|
|
goto yystart16
|
|
|
|
case 4: // start condition: lstateLabels
|
|
|
|
goto yystart21
|
|
|
|
case 5: // start condition: lstateLName
|
2017-04-27 08:02:07 -07:00
|
|
|
goto yystart26
|
2017-06-22 00:38:55 -07:00
|
|
|
case 6: // start condition: lstateLValue
|
|
|
|
goto yystart30
|
|
|
|
case 7: // start condition: lstateLValueIn
|
|
|
|
goto yystart33
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
goto yystate0 // silence unused label error
|
|
|
|
goto yystate1 // silence unused label error
|
|
|
|
yystate1:
|
|
|
|
c = l.next()
|
|
|
|
yystart1:
|
|
|
|
switch {
|
|
|
|
default:
|
|
|
|
goto yyabort
|
|
|
|
case c == '#':
|
|
|
|
goto yystate4
|
|
|
|
case c == '\t' || c == '\n' || c == '\r' || c == ' ':
|
|
|
|
goto yystate3
|
|
|
|
case c == '\x00':
|
|
|
|
goto yystate2
|
2017-05-09 03:21:19 -07:00
|
|
|
case c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z':
|
2017-01-14 07:39:04 -08:00
|
|
|
goto yystate6
|
|
|
|
}
|
|
|
|
|
|
|
|
yystate2:
|
|
|
|
c = l.next()
|
|
|
|
goto yyrule1
|
|
|
|
|
|
|
|
yystate3:
|
|
|
|
c = l.next()
|
|
|
|
switch {
|
|
|
|
default:
|
|
|
|
goto yyrule3
|
|
|
|
case c == '\t' || c == '\n' || c == '\r' || c == ' ':
|
|
|
|
goto yystate3
|
|
|
|
}
|
|
|
|
|
|
|
|
yystate4:
|
|
|
|
c = l.next()
|
|
|
|
switch {
|
|
|
|
default:
|
|
|
|
goto yyabort
|
|
|
|
case c == '\n':
|
|
|
|
goto yystate5
|
|
|
|
case c >= '\x01' && c <= '\t' || c == '\v' || c == '\f' || c >= '\x0e' && c <= 'ÿ':
|
|
|
|
goto yystate4
|
|
|
|
}
|
|
|
|
|
|
|
|
yystate5:
|
|
|
|
c = l.next()
|
|
|
|
goto yyrule2
|
|
|
|
|
|
|
|
yystate6:
|
|
|
|
c = l.next()
|
|
|
|
switch {
|
|
|
|
default:
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yyrule4
|
2017-05-09 03:21:19 -07:00
|
|
|
case c >= '0' && c <= ':' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z':
|
2017-01-14 07:39:04 -08:00
|
|
|
goto yystate6
|
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate7 // silence unused label error
|
2017-01-14 07:39:04 -08:00
|
|
|
yystate7:
|
|
|
|
c = l.next()
|
2017-06-22 00:38:55 -07:00
|
|
|
yystart7:
|
|
|
|
switch {
|
|
|
|
default:
|
|
|
|
goto yyabort
|
|
|
|
case c == '\t' || c == ' ':
|
|
|
|
goto yystate8
|
|
|
|
case c == '{':
|
|
|
|
goto yystate9
|
|
|
|
}
|
2017-01-14 07:39:04 -08:00
|
|
|
|
|
|
|
yystate8:
|
|
|
|
c = l.next()
|
2017-06-22 00:38:55 -07:00
|
|
|
switch {
|
|
|
|
default:
|
|
|
|
goto yyrule6
|
|
|
|
case c == '\t' || c == ' ':
|
|
|
|
goto yystate8
|
|
|
|
case c == '{':
|
|
|
|
goto yystate9
|
|
|
|
}
|
|
|
|
|
|
|
|
yystate9:
|
|
|
|
c = l.next()
|
|
|
|
goto yyrule5
|
|
|
|
|
|
|
|
goto yystate10 // silence unused label error
|
|
|
|
yystate10:
|
|
|
|
c = l.next()
|
|
|
|
yystart10:
|
2017-01-14 07:39:04 -08:00
|
|
|
switch {
|
|
|
|
default:
|
|
|
|
goto yyabort
|
|
|
|
case c == 'N':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate13
|
2017-01-14 07:39:04 -08:00
|
|
|
case c == '\t' || c == ' ':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate12
|
2017-01-14 07:39:04 -08:00
|
|
|
case c >= '\x01' && c <= '\b' || c == '\v' || c == '\f' || c >= '\x0e' && c <= '\x1f' || c >= '!' && c <= 'M' || c >= 'O' && c <= 'ÿ':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate11
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate11:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
|
|
|
switch {
|
|
|
|
default:
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yyrule17
|
2017-01-14 07:39:04 -08:00
|
|
|
case c >= '\x01' && c <= '\b' || c == '\v' || c == '\f' || c >= '\x0e' && c <= '\x1f' || c >= '!' && c <= 'ÿ':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate11
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate12:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
|
|
|
switch {
|
|
|
|
default:
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yyrule15
|
2017-01-14 07:39:04 -08:00
|
|
|
case c == '\t' || c == ' ':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate12
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate13:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
|
|
|
switch {
|
|
|
|
default:
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yyrule17
|
2017-01-14 07:39:04 -08:00
|
|
|
case c == 'a':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate14
|
2017-01-14 07:39:04 -08:00
|
|
|
case c >= '\x01' && c <= '\b' || c == '\v' || c == '\f' || c >= '\x0e' && c <= '\x1f' || c >= '!' && c <= '`' || c >= 'b' && c <= 'ÿ':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate11
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate14:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
|
|
|
switch {
|
|
|
|
default:
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yyrule17
|
2017-01-14 07:39:04 -08:00
|
|
|
case c == 'N':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate15
|
2017-01-14 07:39:04 -08:00
|
|
|
case c >= '\x01' && c <= '\b' || c == '\v' || c == '\f' || c >= '\x0e' && c <= '\x1f' || c >= '!' && c <= 'M' || c >= 'O' && c <= 'ÿ':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate11
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate15:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
|
|
|
switch {
|
|
|
|
default:
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yyrule16
|
2017-01-14 07:39:04 -08:00
|
|
|
case c >= '\x01' && c <= '\b' || c == '\v' || c == '\f' || c >= '\x0e' && c <= '\x1f' || c >= '!' && c <= 'ÿ':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate11
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate16 // silence unused label error
|
|
|
|
yystate16:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
2017-06-22 00:38:55 -07:00
|
|
|
yystart16:
|
2017-04-27 08:02:07 -07:00
|
|
|
switch {
|
|
|
|
default:
|
|
|
|
goto yyabort
|
|
|
|
case c == '\n' || c == '\r':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate19
|
2017-04-27 08:02:07 -07:00
|
|
|
case c == '\t' || c == ' ':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate18
|
2017-04-27 08:02:07 -07:00
|
|
|
case c == '\x00':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate17
|
2017-04-27 08:02:07 -07:00
|
|
|
case c >= '0' && c <= '9':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate20
|
2017-04-27 08:02:07 -07:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate17:
|
2017-04-27 08:02:07 -07:00
|
|
|
c = l.next()
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yyrule21
|
2017-04-27 08:02:07 -07:00
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate18:
|
2017-04-27 08:02:07 -07:00
|
|
|
c = l.next()
|
|
|
|
switch {
|
|
|
|
default:
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yyrule18
|
2017-04-27 08:02:07 -07:00
|
|
|
case c == '\t' || c == ' ':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate18
|
2017-04-27 08:02:07 -07:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate19:
|
2017-04-27 08:02:07 -07:00
|
|
|
c = l.next()
|
|
|
|
switch {
|
|
|
|
default:
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yyrule20
|
2017-04-27 08:02:07 -07:00
|
|
|
case c == '\n' || c == '\r':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate19
|
2017-04-27 08:02:07 -07:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate20:
|
2017-04-27 08:02:07 -07:00
|
|
|
c = l.next()
|
|
|
|
switch {
|
|
|
|
default:
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yyrule19
|
2017-04-27 08:02:07 -07:00
|
|
|
case c >= '0' && c <= '9':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate20
|
2017-04-27 08:02:07 -07:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate21 // silence unused label error
|
|
|
|
yystate21:
|
2017-04-27 08:02:07 -07:00
|
|
|
c = l.next()
|
2017-06-22 00:38:55 -07:00
|
|
|
yystart21:
|
2017-01-14 07:39:04 -08:00
|
|
|
switch {
|
|
|
|
default:
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yyrule9
|
2017-01-14 07:39:04 -08:00
|
|
|
case c == ',':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate23
|
2017-01-14 07:39:04 -08:00
|
|
|
case c == '\t' || c == ' ':
|
2017-04-27 08:02:07 -07:00
|
|
|
goto yystate22
|
2017-06-22 00:38:55 -07:00
|
|
|
case c == '}':
|
|
|
|
goto yystate25
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate22:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
|
|
|
switch {
|
|
|
|
default:
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yyrule7
|
2017-01-14 07:39:04 -08:00
|
|
|
case c == '\t' || c == ' ':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate22
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate23:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
2017-05-22 02:15:40 -07:00
|
|
|
switch {
|
|
|
|
default:
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yyrule9
|
|
|
|
case c == '\t' || c == ' ':
|
|
|
|
goto yystate24
|
2017-05-22 02:15:40 -07:00
|
|
|
case c == '}':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate25
|
2017-05-22 02:15:40 -07:00
|
|
|
}
|
2017-01-14 07:39:04 -08:00
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate24:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
2017-06-22 00:38:55 -07:00
|
|
|
switch {
|
|
|
|
default:
|
|
|
|
goto yyrule9
|
|
|
|
case c == '\t' || c == ' ':
|
|
|
|
goto yystate24
|
|
|
|
}
|
2017-01-14 07:39:04 -08:00
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate25:
|
|
|
|
c = l.next()
|
|
|
|
goto yyrule8
|
|
|
|
|
|
|
|
goto yystate26 // silence unused label error
|
|
|
|
yystate26:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
2017-06-22 00:38:55 -07:00
|
|
|
yystart26:
|
2017-01-14 07:39:04 -08:00
|
|
|
switch {
|
|
|
|
default:
|
|
|
|
goto yyabort
|
2017-06-22 00:38:55 -07:00
|
|
|
case c == '=':
|
|
|
|
goto yystate28
|
|
|
|
case c == '\t' || c == ' ':
|
|
|
|
goto yystate27
|
2017-05-09 03:21:19 -07:00
|
|
|
case c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate29
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate27:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
|
|
|
switch {
|
|
|
|
default:
|
|
|
|
goto yyabort
|
|
|
|
case c == '=':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate28
|
|
|
|
case c == '\t' || c == ' ':
|
|
|
|
goto yystate27
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate28:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yyrule11
|
2017-01-14 07:39:04 -08:00
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate29:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
2017-06-22 00:38:55 -07:00
|
|
|
switch {
|
|
|
|
default:
|
|
|
|
goto yyrule10
|
|
|
|
case c >= '0' && c <= '9' || c >= 'A' && c <= 'Z' || c == '_' || c >= 'a' && c <= 'z':
|
|
|
|
goto yystate29
|
|
|
|
}
|
|
|
|
|
|
|
|
goto yystate30 // silence unused label error
|
|
|
|
yystate30:
|
|
|
|
c = l.next()
|
|
|
|
yystart30:
|
2017-01-14 07:39:04 -08:00
|
|
|
switch {
|
|
|
|
default:
|
|
|
|
goto yyabort
|
|
|
|
case c == '"':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate32
|
|
|
|
case c == '\t' || c == ' ':
|
|
|
|
goto yystate31
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate31:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
|
|
|
switch {
|
|
|
|
default:
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yyrule12
|
|
|
|
case c == '\t' || c == ' ':
|
|
|
|
goto yystate31
|
|
|
|
}
|
|
|
|
|
|
|
|
yystate32:
|
|
|
|
c = l.next()
|
|
|
|
goto yyrule13
|
|
|
|
|
|
|
|
goto yystate33 // silence unused label error
|
|
|
|
yystate33:
|
|
|
|
c = l.next()
|
|
|
|
yystart33:
|
|
|
|
switch {
|
|
|
|
default:
|
2017-07-07 01:29:38 -07:00
|
|
|
goto yyabort
|
2017-01-14 07:39:04 -08:00
|
|
|
case c == '"':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate35
|
2017-01-14 07:39:04 -08:00
|
|
|
case c == '\\':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate36
|
2017-07-07 01:29:38 -07:00
|
|
|
case c >= '\x01' && c <= '!' || c >= '#' && c <= '[' || c >= ']' && c <= 'ÿ':
|
|
|
|
goto yystate34
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate34:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
2017-06-22 00:38:55 -07:00
|
|
|
switch {
|
|
|
|
default:
|
2017-07-07 01:29:38 -07:00
|
|
|
goto yyabort
|
2017-06-22 00:38:55 -07:00
|
|
|
case c == '"':
|
|
|
|
goto yystate35
|
|
|
|
case c == '\\':
|
|
|
|
goto yystate36
|
2017-07-07 01:29:38 -07:00
|
|
|
case c >= '\x01' && c <= '!' || c >= '#' && c <= '[' || c >= ']' && c <= 'ÿ':
|
|
|
|
goto yystate34
|
2017-06-22 00:38:55 -07:00
|
|
|
}
|
2017-01-14 07:39:04 -08:00
|
|
|
|
2017-06-22 00:38:55 -07:00
|
|
|
yystate35:
|
|
|
|
c = l.next()
|
|
|
|
goto yyrule14
|
|
|
|
|
|
|
|
yystate36:
|
2017-01-14 07:39:04 -08:00
|
|
|
c = l.next()
|
|
|
|
switch {
|
|
|
|
default:
|
|
|
|
goto yyabort
|
|
|
|
case c >= '\x01' && c <= '\t' || c >= '\v' && c <= 'ÿ':
|
2017-06-22 00:38:55 -07:00
|
|
|
goto yystate34
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
yyrule1: // \0
|
|
|
|
{
|
2017-01-16 11:34:49 -08:00
|
|
|
return eof
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
|
|
|
yyrule2: // #[^\r\n]*\n
|
|
|
|
{
|
|
|
|
l.mstart = l.i
|
|
|
|
goto yystate0
|
|
|
|
}
|
|
|
|
yyrule3: // [\r\n \t]+
|
|
|
|
{
|
|
|
|
l.mstart = l.i
|
|
|
|
goto yystate0
|
|
|
|
}
|
2017-06-22 00:38:55 -07:00
|
|
|
yyrule4: // {S}({M}|{D})*
|
|
|
|
{
|
2017-07-07 01:29:38 -07:00
|
|
|
l.state = lstateName
|
2017-06-22 00:38:55 -07:00
|
|
|
l.offsets = append(l.offsets, l.i)
|
|
|
|
l.mend = l.i
|
|
|
|
goto yystate0
|
|
|
|
}
|
|
|
|
yyrule5: // ([ \t]*)\{
|
2017-01-14 07:39:04 -08:00
|
|
|
{
|
2017-07-07 01:29:38 -07:00
|
|
|
l.state = lstateLabels
|
2017-01-14 07:39:04 -08:00
|
|
|
goto yystate0
|
|
|
|
}
|
2017-06-22 00:38:55 -07:00
|
|
|
yyrule6: // [ \t]+
|
2017-01-14 07:39:04 -08:00
|
|
|
{
|
2017-07-07 01:29:38 -07:00
|
|
|
l.state = lstateValue
|
2017-06-22 00:38:55 -07:00
|
|
|
l.vstart = l.i
|
2017-01-14 07:39:04 -08:00
|
|
|
goto yystate0
|
|
|
|
}
|
2017-06-22 00:38:55 -07:00
|
|
|
yyrule7: // [ \t]+
|
2017-01-14 07:39:04 -08:00
|
|
|
|
|
|
|
goto yystate0
|
2017-06-22 00:38:55 -07:00
|
|
|
yyrule8: // ,?\}
|
2017-01-14 07:39:04 -08:00
|
|
|
{
|
2017-07-07 01:29:38 -07:00
|
|
|
l.state = lstateValue
|
2017-01-14 07:39:04 -08:00
|
|
|
l.mend = l.i
|
|
|
|
goto yystate0
|
|
|
|
}
|
2017-06-22 00:38:55 -07:00
|
|
|
yyrule9: // (,?[ \t]*)
|
2017-01-14 07:39:04 -08:00
|
|
|
{
|
2017-07-07 01:29:38 -07:00
|
|
|
l.state = lstateLName
|
2017-01-14 10:30:19 -08:00
|
|
|
l.offsets = append(l.offsets, l.i)
|
2017-01-14 07:39:04 -08:00
|
|
|
goto yystate0
|
|
|
|
}
|
2017-06-22 00:38:55 -07:00
|
|
|
yyrule10: // {S}({L}|{D})*
|
|
|
|
{
|
|
|
|
l.offsets = append(l.offsets, l.i)
|
|
|
|
goto yystate0
|
|
|
|
}
|
|
|
|
yyrule11: // [ \t]*=
|
2017-01-14 07:39:04 -08:00
|
|
|
{
|
2017-07-07 01:29:38 -07:00
|
|
|
l.state = lstateLValue
|
2017-01-14 07:39:04 -08:00
|
|
|
goto yystate0
|
|
|
|
}
|
2017-06-22 00:38:55 -07:00
|
|
|
yyrule12: // [ \t]+
|
|
|
|
|
|
|
|
goto yystate0
|
|
|
|
yyrule13: // \"
|
|
|
|
{
|
2017-07-07 01:29:38 -07:00
|
|
|
l.state = lstateLValueIn
|
2017-06-22 00:38:55 -07:00
|
|
|
l.offsets = append(l.offsets, l.i)
|
|
|
|
goto yystate0
|
|
|
|
}
|
2017-07-07 01:29:38 -07:00
|
|
|
yyrule14: // (\\.|[^\\"])*\"
|
2017-01-14 07:39:04 -08:00
|
|
|
{
|
2017-07-07 01:29:38 -07:00
|
|
|
l.state = lstateLabels
|
2017-06-22 00:38:55 -07:00
|
|
|
if !utf8.Valid(l.b[l.offsets[len(l.offsets)-1] : l.i-1]) {
|
2017-06-16 05:09:50 -07:00
|
|
|
l.err = fmt.Errorf("Invalid UTF-8 label value.")
|
|
|
|
return -1
|
|
|
|
}
|
2017-01-14 10:30:19 -08:00
|
|
|
l.offsets = append(l.offsets, l.i-1)
|
2017-01-14 07:39:04 -08:00
|
|
|
goto yystate0
|
|
|
|
}
|
2017-06-22 00:38:55 -07:00
|
|
|
yyrule15: // [ \t]+
|
2017-01-14 07:39:04 -08:00
|
|
|
{
|
|
|
|
l.vstart = l.i
|
|
|
|
goto yystate0
|
|
|
|
}
|
2017-06-22 00:38:55 -07:00
|
|
|
yyrule16: // (NaN)
|
2017-01-14 07:39:04 -08:00
|
|
|
{
|
2017-04-13 02:33:08 -07:00
|
|
|
l.val = math.Float64frombits(value.NormalNaN)
|
2017-07-07 01:29:38 -07:00
|
|
|
l.state = lstateTimestamp
|
2017-04-27 08:02:07 -07:00
|
|
|
goto yystate0
|
2017-01-14 07:39:04 -08:00
|
|
|
}
|
2017-06-22 00:38:55 -07:00
|
|
|
yyrule17: // [^\n \t\r]+
|
2017-01-14 07:39:04 -08:00
|
|
|
{
|
|
|
|
// We don't parse strictly correct floats as the conversion
|
|
|
|
// repeats the effort anyway.
|
|
|
|
l.val, l.err = strconv.ParseFloat(yoloString(l.b[l.vstart:l.i]), 64)
|
|
|
|
if l.err != nil {
|
|
|
|
return -1
|
|
|
|
}
|
2017-07-07 01:29:38 -07:00
|
|
|
l.state = lstateTimestamp
|
2017-04-27 08:02:07 -07:00
|
|
|
goto yystate0
|
|
|
|
}
|
2017-06-22 00:38:55 -07:00
|
|
|
yyrule18: // [ \t]+
|
2017-04-27 08:02:07 -07:00
|
|
|
{
|
|
|
|
l.tstart = l.i
|
|
|
|
goto yystate0
|
|
|
|
}
|
2017-06-22 00:38:55 -07:00
|
|
|
yyrule19: // {D}+
|
2017-04-27 08:02:07 -07:00
|
|
|
{
|
|
|
|
ts, err := strconv.ParseInt(yoloString(l.b[l.tstart:l.i]), 10, 64)
|
|
|
|
if err != nil {
|
|
|
|
l.err = err
|
|
|
|
return -1
|
|
|
|
}
|
|
|
|
l.ts = &ts
|
|
|
|
goto yystate0
|
|
|
|
}
|
2017-06-22 00:38:55 -07:00
|
|
|
yyrule20: // [\r\n]+
|
2017-04-27 08:02:07 -07:00
|
|
|
{
|
|
|
|
l.nextMstart = l.i
|
|
|
|
return 1
|
|
|
|
}
|
2017-06-22 00:38:55 -07:00
|
|
|
yyrule21: // \0
|
2017-04-27 08:02:07 -07:00
|
|
|
{
|
2017-01-14 07:39:04 -08:00
|
|
|
return 1
|
|
|
|
|
|
|
|
}
|
|
|
|
panic("unreachable")
|
|
|
|
|
|
|
|
goto yyabort // silence unused label error
|
|
|
|
|
|
|
|
yyabort: // no lexem recognized
|
2017-04-27 08:02:07 -07:00
|
|
|
l.err = fmt.Errorf("no token found")
|
2017-01-14 07:39:04 -08:00
|
|
|
return -1
|
|
|
|
}
|