1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-02-09 13:38:35 +02:00

Feature/variables optimization (#673)

* Added optimization to FOR loops by disabling allocation if RETURN statement returns NONE

* Added support of ignoring expression results in variable declaration using '_' as a variable name
This commit is contained in:
Tim Voronov 2021-09-20 12:01:47 -04:00 committed by GitHub
parent 0c4a18cb76
commit b3c19bff82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 1297 additions and 987 deletions

View File

@ -45,6 +45,23 @@ func TestFor(t *testing.T) {
So(string(out), ShouldEqual, "[1,2,3]")
})
Convey("Should not allocate memory if NONE is a return statement", t, func() {
c := compiler.New()
p, err := c.Compile(`
FOR i IN 0..100
RETURN NONE
`)
So(err, ShouldBeNil)
So(p, ShouldHaveSameTypeAs, &runtime.Program{})
out, err := p.Run(context.Background())
So(err, ShouldBeNil)
So(string(out), ShouldEqual, "[]")
})
Convey("Should compile FOR i, k IN [1, 2, 3] RETURN k", t, func() {
c := compiler.New()

View File

@ -337,4 +337,41 @@ func TestLet(t *testing.T) {
So(err, ShouldBeNil)
So(string(out), ShouldEqual, `false`)
})
Convey("Should use ignorable variable name", t, func() {
out, err := newCompilerWithObservable().MustCompile(`
LET _ = (FOR i IN 1..100 RETURN NONE)
RETURN TRUE
`).Run(context.Background())
So(err, ShouldBeNil)
So(string(out), ShouldEqual, `true`)
})
Convey("Should allow to declare a variable name using _", t, func() {
c := compiler.New()
out, err := c.MustCompile(`
LET _ = (FOR i IN 1..100 RETURN NONE)
LET _ = (FOR i IN 1..100 RETURN NONE)
RETURN TRUE
`).Run(context.Background())
So(err, ShouldBeNil)
So(string(out), ShouldEqual, `true`)
})
Convey("Should not allow to use ignorable variable name", t, func() {
c := compiler.New()
_, err := c.Compile(`
LET _ = (FOR i IN 1..100 RETURN NONE)
RETURN _
`)
So(err, ShouldNotBeNil)
})
}

View File

@ -55,6 +55,10 @@ func (s *scope) HasVariable(name string) bool {
}
func (s *scope) SetVariable(name string) error {
if name == core.IgnorableVariable {
return nil
}
_, exists := s.vars[name]
if exists {

View File

@ -249,6 +249,7 @@ func (v *visitor) doVisitForExpression(ctx *fql.ForExpressionContext, scope *sco
if !isWhileLoop {
srcCtx := ctx.ForExpressionSource().(*fql.ForExpressionSourceContext)
srcExp, err := v.doVisitForExpressionSource(srcCtx, scope)
if err != nil {
return nil, err
}
@ -266,6 +267,7 @@ func (v *visitor) doVisitForExpression(ctx *fql.ForExpressionContext, scope *sco
} else {
whileExpCtx := ctx.Expression().(*fql.ExpressionContext)
conditionExp, err := v.doVisitExpression(whileExpCtx, scope)
if err != nil {
return nil, err
}
@ -315,6 +317,7 @@ func (v *visitor) doVisitForExpression(ctx *fql.ForExpressionContext, scope *sco
valVarName,
keyVarName,
)
if err != nil {
return nil, err
}
@ -325,6 +328,7 @@ func (v *visitor) doVisitForExpression(ctx *fql.ForExpressionContext, scope *sco
statementCtx.(*fql.ForExpressionStatementContext),
forInScope,
)
if err != nil {
return nil, err
}
@ -336,12 +340,14 @@ func (v *visitor) doVisitForExpression(ctx *fql.ForExpressionContext, scope *sco
var spread bool
var distinct bool
var predicate core.Expression
var passThrough bool
forRetCtx := ctx.ForExpressionReturn().(*fql.ForExpressionReturnContext)
returnCtx := forRetCtx.ReturnExpression()
if returnCtx != nil {
returnCtx := returnCtx.(*fql.ReturnExpressionContext)
returnExp, err := v.doVisitReturnExpression(returnCtx, forInScope)
if err != nil {
return nil, err
}
@ -353,9 +359,13 @@ func (v *visitor) doVisitForExpression(ctx *fql.ForExpressionContext, scope *sco
}
predicate = returnExp
ret := returnExp.(*expressions.ReturnExpression)
passThrough = literals.IsNone(ret.Predicate())
} else {
forInCtx := forRetCtx.ForExpression().(*fql.ForExpressionContext)
forInExp, err := v.doVisitForExpression(forInCtx, forInScope)
if err != nil {
return nil, err
}
@ -371,7 +381,9 @@ func (v *visitor) doVisitForExpression(ctx *fql.ForExpressionContext, scope *sco
predicate,
distinct,
spread,
passThrough,
)
if err != nil {
return nil, err
}
@ -1130,8 +1142,12 @@ func (v *visitor) doVisitVariable(ctx *fql.VariableContext, scope *scope) (core.
func (v *visitor) doVisitVariableDeclaration(ctx *fql.VariableDeclarationContext, scope *scope) (core.Expression, error) {
var init core.Expression
var err error
name := core.IgnorableVariable
if id := ctx.Identifier(); id != nil {
name = id.GetText()
}
name := ctx.Identifier().GetText()
err = scope.SetVariable(name)
if err != nil {

View File

@ -86,6 +86,7 @@ While: 'WHILE';
// Literals
Param: '@';
Identifier: Letter+ (Symbols (Identifier)*)* (Digit (Identifier)*)*;
IgnoreIdentifier: Underscore;
StringLiteral: SQString | DQSring | BacktickString | TickString;
IntegerLiteral: [0-9]+;
FloatLiteral
@ -111,7 +112,8 @@ fragment ExponentPart
fragment Letter
: 'A'..'Z' | 'a'..'z'
;
fragment Symbols: '_';
fragment Symbols: Underscore;
fragment Underscore: '_';
fragment Digit
: '0'..'9'
;

View File

@ -62,11 +62,12 @@ Do=61
While=62
Param=63
Identifier=64
StringLiteral=65
IntegerLiteral=66
FloatLiteral=67
NamespaceSegment=68
UnknownIdentifier=69
IgnoreIdentifier=65
StringLiteral=66
IntegerLiteral=67
FloatLiteral=68
NamespaceSegment=69
UnknownIdentifier=70
':'=5
';'=6
'.'=7

View File

@ -41,6 +41,7 @@ bodyExpression
variableDeclaration
: Let Identifier Assign expression
| Let IgnoreIdentifier Assign expression
;
returnExpression

File diff suppressed because one or more lines are too long

View File

@ -62,11 +62,12 @@ Do=61
While=62
Param=63
Identifier=64
StringLiteral=65
IntegerLiteral=66
FloatLiteral=67
NamespaceSegment=68
UnknownIdentifier=69
IgnoreIdentifier=65
StringLiteral=66
IntegerLiteral=67
FloatLiteral=68
NamespaceSegment=69
UnknownIdentifier=70
':'=5
';'=6
'.'=7

File diff suppressed because one or more lines are too long

View File

@ -62,11 +62,12 @@ Do=61
While=62
Param=63
Identifier=64
StringLiteral=65
IntegerLiteral=66
FloatLiteral=67
NamespaceSegment=68
UnknownIdentifier=69
IgnoreIdentifier=65
StringLiteral=66
IntegerLiteral=67
FloatLiteral=68
NamespaceSegment=69
UnknownIdentifier=70
':'=5
';'=6
'.'=7

View File

@ -14,7 +14,7 @@ var _ = fmt.Printf
var _ = unicode.IsLetter
var serializedLexerAtn = []uint16{
3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 71, 595,
3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 72, 603,
8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7,
9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12,
4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4,
@ -30,255 +30,258 @@ var serializedLexerAtn = []uint16{
9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9,
70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75,
4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4,
81, 9, 81, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 168, 10, 2, 12, 2, 14, 2, 171,
11, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 182,
10, 3, 12, 3, 14, 3, 185, 11, 3, 3, 3, 3, 3, 3, 4, 6, 4, 190, 10, 4, 13,
4, 14, 4, 191, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3,
7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3,
13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18,
3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3,
21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26,
3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3,
29, 5, 29, 257, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 263, 10, 30,
3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3,
35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37,
3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3,
38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40,
3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3,
41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43,
3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3,
45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46,
3, 46, 3, 46, 5, 46, 351, 10, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3,
48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49,
81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 172,
10, 2, 12, 2, 14, 2, 175, 11, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3,
3, 3, 3, 3, 3, 7, 3, 186, 10, 3, 12, 3, 14, 3, 189, 11, 3, 3, 3, 3, 3,
3, 4, 6, 4, 194, 10, 4, 13, 4, 14, 4, 195, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5,
3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3,
11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16,
3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 20, 3,
20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24,
3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3,
29, 3, 29, 3, 29, 3, 29, 3, 29, 5, 29, 261, 10, 29, 3, 30, 3, 30, 3, 30,
3, 30, 5, 30, 267, 10, 30, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3,
33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36,
3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3,
38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39,
3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3,
40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42,
3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3,
44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46,
3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 5, 46, 355, 10, 46, 3, 47, 3,
47, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49,
3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3,
49, 3, 49, 5, 49, 381, 10, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51,
3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3,
53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55,
3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 57, 3,
57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58,
3, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 60, 5,
60, 441, 10, 60, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 3, 63, 3, 63,
3, 63, 3, 63, 3, 63, 3, 63, 3, 64, 3, 64, 3, 65, 6, 65, 458, 10, 65, 13,
65, 14, 65, 459, 3, 65, 3, 65, 7, 65, 464, 10, 65, 12, 65, 14, 65, 467,
11, 65, 7, 65, 469, 10, 65, 12, 65, 14, 65, 472, 11, 65, 3, 65, 3, 65,
7, 65, 476, 10, 65, 12, 65, 14, 65, 479, 11, 65, 7, 65, 481, 10, 65, 12,
65, 14, 65, 484, 11, 65, 3, 66, 3, 66, 3, 66, 3, 66, 5, 66, 490, 10, 66,
3, 67, 6, 67, 493, 10, 67, 13, 67, 14, 67, 494, 3, 68, 3, 68, 3, 68, 6,
68, 500, 10, 68, 13, 68, 14, 68, 501, 3, 68, 5, 68, 505, 10, 68, 3, 68,
3, 68, 5, 68, 509, 10, 68, 5, 68, 511, 10, 68, 3, 69, 3, 69, 3, 69, 3,
70, 3, 70, 3, 71, 3, 71, 3, 72, 3, 72, 3, 72, 7, 72, 523, 10, 72, 12, 72,
14, 72, 526, 11, 72, 5, 72, 528, 10, 72, 3, 73, 3, 73, 5, 73, 532, 10,
73, 3, 73, 6, 73, 535, 10, 73, 13, 73, 14, 73, 536, 3, 74, 3, 74, 3, 75,
3, 75, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 7, 77, 551,
10, 77, 12, 77, 14, 77, 554, 11, 77, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78,
3, 78, 3, 78, 3, 78, 7, 78, 564, 10, 78, 12, 78, 14, 78, 567, 11, 78, 3,
78, 3, 78, 3, 79, 3, 79, 3, 79, 3, 79, 7, 79, 575, 10, 79, 12, 79, 14,
79, 578, 11, 79, 3, 79, 3, 79, 3, 80, 3, 80, 3, 80, 3, 80, 7, 80, 586,
10, 80, 12, 80, 14, 80, 589, 11, 80, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81,
3, 169, 2, 82, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19,
11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37,
20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55,
29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73,
38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91,
47, 93, 48, 95, 49, 97, 50, 99, 51, 101, 52, 103, 53, 105, 54, 107, 55,
109, 56, 111, 57, 113, 58, 115, 59, 117, 60, 119, 61, 121, 62, 123, 63,
125, 64, 127, 65, 129, 66, 131, 67, 133, 68, 135, 69, 137, 70, 139, 71,
141, 2, 143, 2, 145, 2, 147, 2, 149, 2, 151, 2, 153, 2, 155, 2, 157, 2,
159, 2, 161, 2, 3, 2, 14, 5, 2, 12, 12, 15, 15, 8234, 8235, 6, 2, 11, 11,
13, 14, 34, 34, 162, 162, 3, 2, 50, 59, 5, 2, 50, 59, 67, 72, 99, 104,
3, 2, 51, 59, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 4, 2, 67, 92,
99, 124, 4, 2, 36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 3, 2, 98, 98, 3, 2,
182, 182, 2, 620, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2,
2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2,
2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2,
2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3,
2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39,
3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2,
47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2,
2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2,
2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2,
2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3,
2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85,
3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2,
93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2,
2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3,
2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2,
115, 3, 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2,
2, 2, 2, 123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129,
3, 2, 2, 2, 2, 131, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3, 2, 2, 2,
2, 137, 3, 2, 2, 2, 2, 139, 3, 2, 2, 2, 3, 163, 3, 2, 2, 2, 5, 177, 3,
2, 2, 2, 7, 189, 3, 2, 2, 2, 9, 195, 3, 2, 2, 2, 11, 199, 3, 2, 2, 2, 13,
201, 3, 2, 2, 2, 15, 203, 3, 2, 2, 2, 17, 205, 3, 2, 2, 2, 19, 207, 3,
2, 2, 2, 21, 209, 3, 2, 2, 2, 23, 211, 3, 2, 2, 2, 25, 213, 3, 2, 2, 2,
27, 215, 3, 2, 2, 2, 29, 217, 3, 2, 2, 2, 31, 219, 3, 2, 2, 2, 33, 221,
3, 2, 2, 2, 35, 223, 3, 2, 2, 2, 37, 226, 3, 2, 2, 2, 39, 229, 3, 2, 2,
2, 41, 232, 3, 2, 2, 2, 43, 235, 3, 2, 2, 2, 45, 237, 3, 2, 2, 2, 47, 239,
3, 2, 2, 2, 49, 241, 3, 2, 2, 2, 51, 243, 3, 2, 2, 2, 53, 245, 3, 2, 2,
2, 55, 248, 3, 2, 2, 2, 57, 256, 3, 2, 2, 2, 59, 262, 3, 2, 2, 2, 61, 264,
3, 2, 2, 2, 63, 267, 3, 2, 2, 2, 65, 269, 3, 2, 2, 2, 67, 271, 3, 2, 2,
2, 69, 274, 3, 2, 2, 2, 71, 277, 3, 2, 2, 2, 73, 281, 3, 2, 2, 2, 75, 288,
3, 2, 2, 2, 77, 296, 3, 2, 2, 2, 79, 304, 3, 2, 2, 2, 81, 313, 3, 2, 2,
2, 83, 320, 3, 2, 2, 2, 85, 325, 3, 2, 2, 2, 87, 331, 3, 2, 2, 2, 89, 335,
3, 2, 2, 2, 91, 350, 3, 2, 2, 2, 93, 352, 3, 2, 2, 2, 95, 357, 3, 2, 2,
2, 97, 380, 3, 2, 2, 2, 99, 382, 3, 2, 2, 2, 101, 386, 3, 2, 2, 2, 103,
391, 3, 2, 2, 2, 105, 396, 3, 2, 2, 2, 107, 401, 3, 2, 2, 2, 109, 407,
3, 2, 2, 2, 111, 411, 3, 2, 2, 2, 113, 415, 3, 2, 2, 2, 115, 425, 3, 2,
2, 2, 117, 431, 3, 2, 2, 2, 119, 440, 3, 2, 2, 2, 121, 442, 3, 2, 2, 2,
123, 445, 3, 2, 2, 2, 125, 448, 3, 2, 2, 2, 127, 454, 3, 2, 2, 2, 129,
457, 3, 2, 2, 2, 131, 489, 3, 2, 2, 2, 133, 492, 3, 2, 2, 2, 135, 510,
3, 2, 2, 2, 137, 512, 3, 2, 2, 2, 139, 515, 3, 2, 2, 2, 141, 517, 3, 2,
2, 2, 143, 527, 3, 2, 2, 2, 145, 529, 3, 2, 2, 2, 147, 538, 3, 2, 2, 2,
149, 540, 3, 2, 2, 2, 151, 542, 3, 2, 2, 2, 153, 544, 3, 2, 2, 2, 155,
557, 3, 2, 2, 2, 157, 570, 3, 2, 2, 2, 159, 581, 3, 2, 2, 2, 161, 592,
3, 2, 2, 2, 163, 164, 7, 49, 2, 2, 164, 165, 7, 44, 2, 2, 165, 169, 3,
2, 2, 2, 166, 168, 11, 2, 2, 2, 167, 166, 3, 2, 2, 2, 168, 171, 3, 2, 2,
2, 169, 170, 3, 2, 2, 2, 169, 167, 3, 2, 2, 2, 170, 172, 3, 2, 2, 2, 171,
169, 3, 2, 2, 2, 172, 173, 7, 44, 2, 2, 173, 174, 7, 49, 2, 2, 174, 175,
3, 2, 2, 2, 175, 176, 8, 2, 2, 2, 176, 4, 3, 2, 2, 2, 177, 178, 7, 49,
2, 2, 178, 179, 7, 49, 2, 2, 179, 183, 3, 2, 2, 2, 180, 182, 10, 2, 2,
2, 181, 180, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183,
184, 3, 2, 2, 2, 184, 186, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 187,
8, 3, 2, 2, 187, 6, 3, 2, 2, 2, 188, 190, 9, 3, 2, 2, 189, 188, 3, 2, 2,
2, 190, 191, 3, 2, 2, 2, 191, 189, 3, 2, 2, 2, 191, 192, 3, 2, 2, 2, 192,
193, 3, 2, 2, 2, 193, 194, 8, 4, 2, 2, 194, 8, 3, 2, 2, 2, 195, 196, 9,
2, 2, 2, 196, 197, 3, 2, 2, 2, 197, 198, 8, 5, 2, 2, 198, 10, 3, 2, 2,
2, 199, 200, 7, 60, 2, 2, 200, 12, 3, 2, 2, 2, 201, 202, 7, 61, 2, 2, 202,
14, 3, 2, 2, 2, 203, 204, 7, 48, 2, 2, 204, 16, 3, 2, 2, 2, 205, 206, 7,
46, 2, 2, 206, 18, 3, 2, 2, 2, 207, 208, 7, 93, 2, 2, 208, 20, 3, 2, 2,
2, 209, 210, 7, 95, 2, 2, 210, 22, 3, 2, 2, 2, 211, 212, 7, 42, 2, 2, 212,
24, 3, 2, 2, 2, 213, 214, 7, 43, 2, 2, 214, 26, 3, 2, 2, 2, 215, 216, 7,
125, 2, 2, 216, 28, 3, 2, 2, 2, 217, 218, 7, 127, 2, 2, 218, 30, 3, 2,
2, 2, 219, 220, 7, 64, 2, 2, 220, 32, 3, 2, 2, 2, 221, 222, 7, 62, 2, 2,
222, 34, 3, 2, 2, 2, 223, 224, 7, 63, 2, 2, 224, 225, 7, 63, 2, 2, 225,
36, 3, 2, 2, 2, 226, 227, 7, 64, 2, 2, 227, 228, 7, 63, 2, 2, 228, 38,
3, 2, 2, 2, 229, 230, 7, 62, 2, 2, 230, 231, 7, 63, 2, 2, 231, 40, 3, 2,
2, 2, 232, 233, 7, 35, 2, 2, 233, 234, 7, 63, 2, 2, 234, 42, 3, 2, 2, 2,
235, 236, 7, 44, 2, 2, 236, 44, 3, 2, 2, 2, 237, 238, 7, 49, 2, 2, 238,
46, 3, 2, 2, 2, 239, 240, 7, 39, 2, 2, 240, 48, 3, 2, 2, 2, 241, 242, 7,
45, 2, 2, 242, 50, 3, 2, 2, 2, 243, 244, 7, 47, 2, 2, 244, 52, 3, 2, 2,
2, 245, 246, 7, 47, 2, 2, 246, 247, 7, 47, 2, 2, 247, 54, 3, 2, 2, 2, 248,
249, 7, 45, 2, 2, 249, 250, 7, 45, 2, 2, 250, 56, 3, 2, 2, 2, 251, 252,
7, 67, 2, 2, 252, 253, 7, 80, 2, 2, 253, 257, 7, 70, 2, 2, 254, 255, 7,
40, 2, 2, 255, 257, 7, 40, 2, 2, 256, 251, 3, 2, 2, 2, 256, 254, 3, 2,
2, 2, 257, 58, 3, 2, 2, 2, 258, 259, 7, 81, 2, 2, 259, 263, 7, 84, 2, 2,
260, 261, 7, 126, 2, 2, 261, 263, 7, 126, 2, 2, 262, 258, 3, 2, 2, 2, 262,
260, 3, 2, 2, 2, 263, 60, 3, 2, 2, 2, 264, 265, 5, 15, 8, 2, 265, 266,
5, 15, 8, 2, 266, 62, 3, 2, 2, 2, 267, 268, 7, 63, 2, 2, 268, 64, 3, 2,
2, 2, 269, 270, 7, 65, 2, 2, 270, 66, 3, 2, 2, 2, 271, 272, 7, 35, 2, 2,
272, 273, 7, 128, 2, 2, 273, 68, 3, 2, 2, 2, 274, 275, 7, 63, 2, 2, 275,
276, 7, 128, 2, 2, 276, 70, 3, 2, 2, 2, 277, 278, 7, 72, 2, 2, 278, 279,
7, 81, 2, 2, 279, 280, 7, 84, 2, 2, 280, 72, 3, 2, 2, 2, 281, 282, 7, 84,
2, 2, 282, 283, 7, 71, 2, 2, 283, 284, 7, 86, 2, 2, 284, 285, 7, 87, 2,
2, 285, 286, 7, 84, 2, 2, 286, 287, 7, 80, 2, 2, 287, 74, 3, 2, 2, 2, 288,
289, 7, 89, 2, 2, 289, 290, 7, 67, 2, 2, 290, 291, 7, 75, 2, 2, 291, 292,
7, 86, 2, 2, 292, 293, 7, 72, 2, 2, 293, 294, 7, 81, 2, 2, 294, 295, 7,
84, 2, 2, 295, 76, 3, 2, 2, 2, 296, 297, 7, 81, 2, 2, 297, 298, 7, 82,
2, 2, 298, 299, 7, 86, 2, 2, 299, 300, 7, 75, 2, 2, 300, 301, 7, 81, 2,
2, 301, 302, 7, 80, 2, 2, 302, 303, 7, 85, 2, 2, 303, 78, 3, 2, 2, 2, 304,
305, 7, 70, 2, 2, 305, 306, 7, 75, 2, 2, 306, 307, 7, 85, 2, 2, 307, 308,
7, 86, 2, 2, 308, 309, 7, 75, 2, 2, 309, 310, 7, 80, 2, 2, 310, 311, 7,
69, 2, 2, 311, 312, 7, 86, 2, 2, 312, 80, 3, 2, 2, 2, 313, 314, 7, 72,
2, 2, 314, 315, 7, 75, 2, 2, 315, 316, 7, 78, 2, 2, 316, 317, 7, 86, 2,
2, 317, 318, 7, 71, 2, 2, 318, 319, 7, 84, 2, 2, 319, 82, 3, 2, 2, 2, 320,
321, 7, 85, 2, 2, 321, 322, 7, 81, 2, 2, 322, 323, 7, 84, 2, 2, 323, 324,
7, 86, 2, 2, 324, 84, 3, 2, 2, 2, 325, 326, 7, 78, 2, 2, 326, 327, 7, 75,
2, 2, 327, 328, 7, 79, 2, 2, 328, 329, 7, 75, 2, 2, 329, 330, 7, 86, 2,
2, 330, 86, 3, 2, 2, 2, 331, 332, 7, 78, 2, 2, 332, 333, 7, 71, 2, 2, 333,
334, 7, 86, 2, 2, 334, 88, 3, 2, 2, 2, 335, 336, 7, 69, 2, 2, 336, 337,
7, 81, 2, 2, 337, 338, 7, 78, 2, 2, 338, 339, 7, 78, 2, 2, 339, 340, 7,
71, 2, 2, 340, 341, 7, 69, 2, 2, 341, 342, 7, 86, 2, 2, 342, 90, 3, 2,
2, 2, 343, 344, 7, 67, 2, 2, 344, 345, 7, 85, 2, 2, 345, 351, 7, 69, 2,
2, 346, 347, 7, 70, 2, 2, 347, 348, 7, 71, 2, 2, 348, 349, 7, 85, 2, 2,
349, 351, 7, 69, 2, 2, 350, 343, 3, 2, 2, 2, 350, 346, 3, 2, 2, 2, 351,
92, 3, 2, 2, 2, 352, 353, 7, 80, 2, 2, 353, 354, 7, 81, 2, 2, 354, 355,
7, 80, 2, 2, 355, 356, 7, 71, 2, 2, 356, 94, 3, 2, 2, 2, 357, 358, 7, 80,
2, 2, 358, 359, 7, 87, 2, 2, 359, 360, 7, 78, 2, 2, 360, 361, 7, 78, 2,
2, 361, 96, 3, 2, 2, 2, 362, 363, 7, 86, 2, 2, 363, 364, 7, 84, 2, 2, 364,
365, 7, 87, 2, 2, 365, 381, 7, 71, 2, 2, 366, 367, 7, 118, 2, 2, 367, 368,
7, 116, 2, 2, 368, 369, 7, 119, 2, 2, 369, 381, 7, 103, 2, 2, 370, 371,
7, 72, 2, 2, 371, 372, 7, 67, 2, 2, 372, 373, 7, 78, 2, 2, 373, 374, 7,
85, 2, 2, 374, 381, 7, 71, 2, 2, 375, 376, 7, 104, 2, 2, 376, 377, 7, 99,
2, 2, 377, 378, 7, 110, 2, 2, 378, 379, 7, 117, 2, 2, 379, 381, 7, 103,
2, 2, 380, 362, 3, 2, 2, 2, 380, 366, 3, 2, 2, 2, 380, 370, 3, 2, 2, 2,
380, 375, 3, 2, 2, 2, 381, 98, 3, 2, 2, 2, 382, 383, 7, 87, 2, 2, 383,
384, 7, 85, 2, 2, 384, 385, 7, 71, 2, 2, 385, 100, 3, 2, 2, 2, 386, 387,
7, 75, 2, 2, 387, 388, 7, 80, 2, 2, 388, 389, 7, 86, 2, 2, 389, 390, 7,
81, 2, 2, 390, 102, 3, 2, 2, 2, 391, 392, 7, 77, 2, 2, 392, 393, 7, 71,
2, 2, 393, 394, 7, 71, 2, 2, 394, 395, 7, 82, 2, 2, 395, 104, 3, 2, 2,
2, 396, 397, 7, 89, 2, 2, 397, 398, 7, 75, 2, 2, 398, 399, 7, 86, 2, 2,
399, 400, 7, 74, 2, 2, 400, 106, 3, 2, 2, 2, 401, 402, 7, 69, 2, 2, 402,
403, 7, 81, 2, 2, 403, 404, 7, 87, 2, 2, 404, 405, 7, 80, 2, 2, 405, 406,
7, 86, 2, 2, 406, 108, 3, 2, 2, 2, 407, 408, 7, 67, 2, 2, 408, 409, 7,
78, 2, 2, 409, 410, 7, 78, 2, 2, 410, 110, 3, 2, 2, 2, 411, 412, 7, 67,
2, 2, 412, 413, 7, 80, 2, 2, 413, 414, 7, 91, 2, 2, 414, 112, 3, 2, 2,
2, 415, 416, 7, 67, 2, 2, 416, 417, 7, 73, 2, 2, 417, 418, 7, 73, 2, 2,
418, 419, 7, 84, 2, 2, 419, 420, 7, 71, 2, 2, 420, 421, 7, 73, 2, 2, 421,
422, 7, 67, 2, 2, 422, 423, 7, 86, 2, 2, 423, 424, 7, 71, 2, 2, 424, 114,
3, 2, 2, 2, 425, 426, 7, 71, 2, 2, 426, 427, 7, 88, 2, 2, 427, 428, 7,
71, 2, 2, 428, 429, 7, 80, 2, 2, 429, 430, 7, 86, 2, 2, 430, 116, 3, 2,
2, 2, 431, 432, 7, 78, 2, 2, 432, 433, 7, 75, 2, 2, 433, 434, 7, 77, 2,
2, 434, 435, 7, 71, 2, 2, 435, 118, 3, 2, 2, 2, 436, 437, 7, 80, 2, 2,
437, 438, 7, 81, 2, 2, 438, 441, 7, 86, 2, 2, 439, 441, 7, 35, 2, 2, 440,
436, 3, 2, 2, 2, 440, 439, 3, 2, 2, 2, 441, 120, 3, 2, 2, 2, 442, 443,
7, 75, 2, 2, 443, 444, 7, 80, 2, 2, 444, 122, 3, 2, 2, 2, 445, 446, 7,
70, 2, 2, 446, 447, 7, 81, 2, 2, 447, 124, 3, 2, 2, 2, 448, 449, 7, 89,
2, 2, 449, 450, 7, 74, 2, 2, 450, 451, 7, 75, 2, 2, 451, 452, 7, 78, 2,
2, 452, 453, 7, 71, 2, 2, 453, 126, 3, 2, 2, 2, 454, 455, 7, 66, 2, 2,
455, 128, 3, 2, 2, 2, 456, 458, 5, 147, 74, 2, 457, 456, 3, 2, 2, 2, 458,
459, 3, 2, 2, 2, 459, 457, 3, 2, 2, 2, 459, 460, 3, 2, 2, 2, 460, 470,
3, 2, 2, 2, 461, 465, 5, 149, 75, 2, 462, 464, 5, 129, 65, 2, 463, 462,
3, 2, 2, 2, 464, 467, 3, 2, 2, 2, 465, 463, 3, 2, 2, 2, 465, 466, 3, 2,
2, 2, 466, 469, 3, 2, 2, 2, 467, 465, 3, 2, 2, 2, 468, 461, 3, 2, 2, 2,
469, 472, 3, 2, 2, 2, 470, 468, 3, 2, 2, 2, 470, 471, 3, 2, 2, 2, 471,
482, 3, 2, 2, 2, 472, 470, 3, 2, 2, 2, 473, 477, 5, 151, 76, 2, 474, 476,
5, 129, 65, 2, 475, 474, 3, 2, 2, 2, 476, 479, 3, 2, 2, 2, 477, 475, 3,
2, 2, 2, 477, 478, 3, 2, 2, 2, 478, 481, 3, 2, 2, 2, 479, 477, 3, 2, 2,
2, 480, 473, 3, 2, 2, 2, 481, 484, 3, 2, 2, 2, 482, 480, 3, 2, 2, 2, 482,
483, 3, 2, 2, 2, 483, 130, 3, 2, 2, 2, 484, 482, 3, 2, 2, 2, 485, 490,
5, 155, 78, 2, 486, 490, 5, 153, 77, 2, 487, 490, 5, 157, 79, 2, 488, 490,
5, 159, 80, 2, 489, 485, 3, 2, 2, 2, 489, 486, 3, 2, 2, 2, 489, 487, 3,
2, 2, 2, 489, 488, 3, 2, 2, 2, 490, 132, 3, 2, 2, 2, 491, 493, 9, 4, 2,
2, 492, 491, 3, 2, 2, 2, 493, 494, 3, 2, 2, 2, 494, 492, 3, 2, 2, 2, 494,
495, 3, 2, 2, 2, 495, 134, 3, 2, 2, 2, 496, 497, 5, 143, 72, 2, 497, 499,
5, 15, 8, 2, 498, 500, 9, 4, 2, 2, 499, 498, 3, 2, 2, 2, 500, 501, 3, 2,
2, 2, 501, 499, 3, 2, 2, 2, 501, 502, 3, 2, 2, 2, 502, 504, 3, 2, 2, 2,
503, 505, 5, 145, 73, 2, 504, 503, 3, 2, 2, 2, 504, 505, 3, 2, 2, 2, 505,
511, 3, 2, 2, 2, 506, 508, 5, 143, 72, 2, 507, 509, 5, 145, 73, 2, 508,
507, 3, 2, 2, 2, 508, 509, 3, 2, 2, 2, 509, 511, 3, 2, 2, 2, 510, 496,
3, 2, 2, 2, 510, 506, 3, 2, 2, 2, 511, 136, 3, 2, 2, 2, 512, 513, 5, 129,
65, 2, 513, 514, 5, 161, 81, 2, 514, 138, 3, 2, 2, 2, 515, 516, 11, 2,
2, 2, 516, 140, 3, 2, 2, 2, 517, 518, 9, 5, 2, 2, 518, 142, 3, 2, 2, 2,
519, 528, 7, 50, 2, 2, 520, 524, 9, 6, 2, 2, 521, 523, 9, 4, 2, 2, 522,
521, 3, 2, 2, 2, 523, 526, 3, 2, 2, 2, 524, 522, 3, 2, 2, 2, 524, 525,
3, 2, 2, 2, 525, 528, 3, 2, 2, 2, 526, 524, 3, 2, 2, 2, 527, 519, 3, 2,
2, 2, 527, 520, 3, 2, 2, 2, 528, 144, 3, 2, 2, 2, 529, 531, 9, 7, 2, 2,
530, 532, 9, 8, 2, 2, 531, 530, 3, 2, 2, 2, 531, 532, 3, 2, 2, 2, 532,
534, 3, 2, 2, 2, 533, 535, 9, 4, 2, 2, 534, 533, 3, 2, 2, 2, 535, 536,
3, 2, 2, 2, 536, 534, 3, 2, 2, 2, 536, 537, 3, 2, 2, 2, 537, 146, 3, 2,
2, 2, 538, 539, 9, 9, 2, 2, 539, 148, 3, 2, 2, 2, 540, 541, 7, 97, 2, 2,
541, 150, 3, 2, 2, 2, 542, 543, 4, 50, 59, 2, 543, 152, 3, 2, 2, 2, 544,
552, 7, 36, 2, 2, 545, 546, 7, 94, 2, 2, 546, 551, 11, 2, 2, 2, 547, 548,
7, 36, 2, 2, 548, 551, 7, 36, 2, 2, 549, 551, 10, 10, 2, 2, 550, 545, 3,
2, 2, 2, 550, 547, 3, 2, 2, 2, 550, 549, 3, 2, 2, 2, 551, 554, 3, 2, 2,
2, 552, 550, 3, 2, 2, 2, 552, 553, 3, 2, 2, 2, 553, 555, 3, 2, 2, 2, 554,
552, 3, 2, 2, 2, 555, 556, 7, 36, 2, 2, 556, 154, 3, 2, 2, 2, 557, 565,
7, 41, 2, 2, 558, 559, 7, 94, 2, 2, 559, 564, 11, 2, 2, 2, 560, 561, 7,
41, 2, 2, 561, 564, 7, 41, 2, 2, 562, 564, 10, 11, 2, 2, 563, 558, 3, 2,
2, 2, 563, 560, 3, 2, 2, 2, 563, 562, 3, 2, 2, 2, 564, 567, 3, 2, 2, 2,
565, 563, 3, 2, 2, 2, 565, 566, 3, 2, 2, 2, 566, 568, 3, 2, 2, 2, 567,
565, 3, 2, 2, 2, 568, 569, 7, 41, 2, 2, 569, 156, 3, 2, 2, 2, 570, 576,
7, 98, 2, 2, 571, 572, 7, 94, 2, 2, 572, 575, 7, 98, 2, 2, 573, 575, 10,
12, 2, 2, 574, 571, 3, 2, 2, 2, 574, 573, 3, 2, 2, 2, 575, 578, 3, 2, 2,
2, 576, 574, 3, 2, 2, 2, 576, 577, 3, 2, 2, 2, 577, 579, 3, 2, 2, 2, 578,
576, 3, 2, 2, 2, 579, 580, 7, 98, 2, 2, 580, 158, 3, 2, 2, 2, 581, 587,
7, 182, 2, 2, 582, 583, 7, 94, 2, 2, 583, 586, 7, 182, 2, 2, 584, 586,
10, 13, 2, 2, 585, 582, 3, 2, 2, 2, 585, 584, 3, 2, 2, 2, 586, 589, 3,
2, 2, 2, 587, 585, 3, 2, 2, 2, 587, 588, 3, 2, 2, 2, 588, 590, 3, 2, 2,
2, 589, 587, 3, 2, 2, 2, 590, 591, 7, 182, 2, 2, 591, 160, 3, 2, 2, 2,
592, 593, 7, 60, 2, 2, 593, 594, 7, 60, 2, 2, 594, 162, 3, 2, 2, 2, 34,
2, 169, 183, 191, 256, 262, 350, 380, 440, 459, 465, 470, 477, 482, 489,
494, 501, 504, 508, 510, 524, 527, 531, 536, 550, 552, 563, 565, 574, 576,
585, 587, 3, 2, 3, 2,
49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 5, 49, 385, 10, 49, 3, 50, 3, 50,
3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 3,
52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54,
3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 56, 3,
57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 58,
3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3,
60, 3, 60, 3, 60, 3, 60, 5, 60, 445, 10, 60, 3, 61, 3, 61, 3, 61, 3, 62,
3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 64, 3, 64, 3,
65, 6, 65, 462, 10, 65, 13, 65, 14, 65, 463, 3, 65, 3, 65, 7, 65, 468,
10, 65, 12, 65, 14, 65, 471, 11, 65, 7, 65, 473, 10, 65, 12, 65, 14, 65,
476, 11, 65, 3, 65, 3, 65, 7, 65, 480, 10, 65, 12, 65, 14, 65, 483, 11,
65, 7, 65, 485, 10, 65, 12, 65, 14, 65, 488, 11, 65, 3, 66, 3, 66, 3, 67,
3, 67, 3, 67, 3, 67, 5, 67, 496, 10, 67, 3, 68, 6, 68, 499, 10, 68, 13,
68, 14, 68, 500, 3, 69, 3, 69, 3, 69, 6, 69, 506, 10, 69, 13, 69, 14, 69,
507, 3, 69, 5, 69, 511, 10, 69, 3, 69, 3, 69, 5, 69, 515, 10, 69, 5, 69,
517, 10, 69, 3, 70, 3, 70, 3, 70, 3, 71, 3, 71, 3, 72, 3, 72, 3, 73, 3,
73, 3, 73, 7, 73, 529, 10, 73, 12, 73, 14, 73, 532, 11, 73, 5, 73, 534,
10, 73, 3, 74, 3, 74, 5, 74, 538, 10, 74, 3, 74, 6, 74, 541, 10, 74, 13,
74, 14, 74, 542, 3, 75, 3, 75, 3, 76, 3, 76, 3, 77, 3, 77, 3, 78, 3, 78,
3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 7, 79, 559, 10, 79, 12, 79, 14,
79, 562, 11, 79, 3, 79, 3, 79, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80,
7, 80, 572, 10, 80, 12, 80, 14, 80, 575, 11, 80, 3, 80, 3, 80, 3, 81, 3,
81, 3, 81, 3, 81, 7, 81, 583, 10, 81, 12, 81, 14, 81, 586, 11, 81, 3, 81,
3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 7, 82, 594, 10, 82, 12, 82, 14, 82,
597, 11, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 3, 173, 2, 84, 3, 3, 5,
4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25,
14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43,
23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61,
32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79,
41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 93, 48, 95, 49, 97,
50, 99, 51, 101, 52, 103, 53, 105, 54, 107, 55, 109, 56, 111, 57, 113,
58, 115, 59, 117, 60, 119, 61, 121, 62, 123, 63, 125, 64, 127, 65, 129,
66, 131, 67, 133, 68, 135, 69, 137, 70, 139, 71, 141, 72, 143, 2, 145,
2, 147, 2, 149, 2, 151, 2, 153, 2, 155, 2, 157, 2, 159, 2, 161, 2, 163,
2, 165, 2, 3, 2, 14, 5, 2, 12, 12, 15, 15, 8234, 8235, 6, 2, 11, 11, 13,
14, 34, 34, 162, 162, 3, 2, 50, 59, 5, 2, 50, 59, 67, 72, 99, 104, 3, 2,
51, 59, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 4, 2, 67, 92, 99,
124, 4, 2, 36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 3, 2, 98, 98, 3, 2, 182,
182, 2, 627, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9,
3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2,
17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2,
2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2,
2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2,
2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3,
2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55,
3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2,
63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2,
2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2,
2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2,
2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3,
2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101,
3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2,
2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3,
2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2,
123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2,
2, 2, 2, 131, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3, 2, 2, 2, 2, 137,
3, 2, 2, 2, 2, 139, 3, 2, 2, 2, 2, 141, 3, 2, 2, 2, 3, 167, 3, 2, 2, 2,
5, 181, 3, 2, 2, 2, 7, 193, 3, 2, 2, 2, 9, 199, 3, 2, 2, 2, 11, 203, 3,
2, 2, 2, 13, 205, 3, 2, 2, 2, 15, 207, 3, 2, 2, 2, 17, 209, 3, 2, 2, 2,
19, 211, 3, 2, 2, 2, 21, 213, 3, 2, 2, 2, 23, 215, 3, 2, 2, 2, 25, 217,
3, 2, 2, 2, 27, 219, 3, 2, 2, 2, 29, 221, 3, 2, 2, 2, 31, 223, 3, 2, 2,
2, 33, 225, 3, 2, 2, 2, 35, 227, 3, 2, 2, 2, 37, 230, 3, 2, 2, 2, 39, 233,
3, 2, 2, 2, 41, 236, 3, 2, 2, 2, 43, 239, 3, 2, 2, 2, 45, 241, 3, 2, 2,
2, 47, 243, 3, 2, 2, 2, 49, 245, 3, 2, 2, 2, 51, 247, 3, 2, 2, 2, 53, 249,
3, 2, 2, 2, 55, 252, 3, 2, 2, 2, 57, 260, 3, 2, 2, 2, 59, 266, 3, 2, 2,
2, 61, 268, 3, 2, 2, 2, 63, 271, 3, 2, 2, 2, 65, 273, 3, 2, 2, 2, 67, 275,
3, 2, 2, 2, 69, 278, 3, 2, 2, 2, 71, 281, 3, 2, 2, 2, 73, 285, 3, 2, 2,
2, 75, 292, 3, 2, 2, 2, 77, 300, 3, 2, 2, 2, 79, 308, 3, 2, 2, 2, 81, 317,
3, 2, 2, 2, 83, 324, 3, 2, 2, 2, 85, 329, 3, 2, 2, 2, 87, 335, 3, 2, 2,
2, 89, 339, 3, 2, 2, 2, 91, 354, 3, 2, 2, 2, 93, 356, 3, 2, 2, 2, 95, 361,
3, 2, 2, 2, 97, 384, 3, 2, 2, 2, 99, 386, 3, 2, 2, 2, 101, 390, 3, 2, 2,
2, 103, 395, 3, 2, 2, 2, 105, 400, 3, 2, 2, 2, 107, 405, 3, 2, 2, 2, 109,
411, 3, 2, 2, 2, 111, 415, 3, 2, 2, 2, 113, 419, 3, 2, 2, 2, 115, 429,
3, 2, 2, 2, 117, 435, 3, 2, 2, 2, 119, 444, 3, 2, 2, 2, 121, 446, 3, 2,
2, 2, 123, 449, 3, 2, 2, 2, 125, 452, 3, 2, 2, 2, 127, 458, 3, 2, 2, 2,
129, 461, 3, 2, 2, 2, 131, 489, 3, 2, 2, 2, 133, 495, 3, 2, 2, 2, 135,
498, 3, 2, 2, 2, 137, 516, 3, 2, 2, 2, 139, 518, 3, 2, 2, 2, 141, 521,
3, 2, 2, 2, 143, 523, 3, 2, 2, 2, 145, 533, 3, 2, 2, 2, 147, 535, 3, 2,
2, 2, 149, 544, 3, 2, 2, 2, 151, 546, 3, 2, 2, 2, 153, 548, 3, 2, 2, 2,
155, 550, 3, 2, 2, 2, 157, 552, 3, 2, 2, 2, 159, 565, 3, 2, 2, 2, 161,
578, 3, 2, 2, 2, 163, 589, 3, 2, 2, 2, 165, 600, 3, 2, 2, 2, 167, 168,
7, 49, 2, 2, 168, 169, 7, 44, 2, 2, 169, 173, 3, 2, 2, 2, 170, 172, 11,
2, 2, 2, 171, 170, 3, 2, 2, 2, 172, 175, 3, 2, 2, 2, 173, 174, 3, 2, 2,
2, 173, 171, 3, 2, 2, 2, 174, 176, 3, 2, 2, 2, 175, 173, 3, 2, 2, 2, 176,
177, 7, 44, 2, 2, 177, 178, 7, 49, 2, 2, 178, 179, 3, 2, 2, 2, 179, 180,
8, 2, 2, 2, 180, 4, 3, 2, 2, 2, 181, 182, 7, 49, 2, 2, 182, 183, 7, 49,
2, 2, 183, 187, 3, 2, 2, 2, 184, 186, 10, 2, 2, 2, 185, 184, 3, 2, 2, 2,
186, 189, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 187, 188, 3, 2, 2, 2, 188,
190, 3, 2, 2, 2, 189, 187, 3, 2, 2, 2, 190, 191, 8, 3, 2, 2, 191, 6, 3,
2, 2, 2, 192, 194, 9, 3, 2, 2, 193, 192, 3, 2, 2, 2, 194, 195, 3, 2, 2,
2, 195, 193, 3, 2, 2, 2, 195, 196, 3, 2, 2, 2, 196, 197, 3, 2, 2, 2, 197,
198, 8, 4, 2, 2, 198, 8, 3, 2, 2, 2, 199, 200, 9, 2, 2, 2, 200, 201, 3,
2, 2, 2, 201, 202, 8, 5, 2, 2, 202, 10, 3, 2, 2, 2, 203, 204, 7, 60, 2,
2, 204, 12, 3, 2, 2, 2, 205, 206, 7, 61, 2, 2, 206, 14, 3, 2, 2, 2, 207,
208, 7, 48, 2, 2, 208, 16, 3, 2, 2, 2, 209, 210, 7, 46, 2, 2, 210, 18,
3, 2, 2, 2, 211, 212, 7, 93, 2, 2, 212, 20, 3, 2, 2, 2, 213, 214, 7, 95,
2, 2, 214, 22, 3, 2, 2, 2, 215, 216, 7, 42, 2, 2, 216, 24, 3, 2, 2, 2,
217, 218, 7, 43, 2, 2, 218, 26, 3, 2, 2, 2, 219, 220, 7, 125, 2, 2, 220,
28, 3, 2, 2, 2, 221, 222, 7, 127, 2, 2, 222, 30, 3, 2, 2, 2, 223, 224,
7, 64, 2, 2, 224, 32, 3, 2, 2, 2, 225, 226, 7, 62, 2, 2, 226, 34, 3, 2,
2, 2, 227, 228, 7, 63, 2, 2, 228, 229, 7, 63, 2, 2, 229, 36, 3, 2, 2, 2,
230, 231, 7, 64, 2, 2, 231, 232, 7, 63, 2, 2, 232, 38, 3, 2, 2, 2, 233,
234, 7, 62, 2, 2, 234, 235, 7, 63, 2, 2, 235, 40, 3, 2, 2, 2, 236, 237,
7, 35, 2, 2, 237, 238, 7, 63, 2, 2, 238, 42, 3, 2, 2, 2, 239, 240, 7, 44,
2, 2, 240, 44, 3, 2, 2, 2, 241, 242, 7, 49, 2, 2, 242, 46, 3, 2, 2, 2,
243, 244, 7, 39, 2, 2, 244, 48, 3, 2, 2, 2, 245, 246, 7, 45, 2, 2, 246,
50, 3, 2, 2, 2, 247, 248, 7, 47, 2, 2, 248, 52, 3, 2, 2, 2, 249, 250, 7,
47, 2, 2, 250, 251, 7, 47, 2, 2, 251, 54, 3, 2, 2, 2, 252, 253, 7, 45,
2, 2, 253, 254, 7, 45, 2, 2, 254, 56, 3, 2, 2, 2, 255, 256, 7, 67, 2, 2,
256, 257, 7, 80, 2, 2, 257, 261, 7, 70, 2, 2, 258, 259, 7, 40, 2, 2, 259,
261, 7, 40, 2, 2, 260, 255, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 261, 58,
3, 2, 2, 2, 262, 263, 7, 81, 2, 2, 263, 267, 7, 84, 2, 2, 264, 265, 7,
126, 2, 2, 265, 267, 7, 126, 2, 2, 266, 262, 3, 2, 2, 2, 266, 264, 3, 2,
2, 2, 267, 60, 3, 2, 2, 2, 268, 269, 5, 15, 8, 2, 269, 270, 5, 15, 8, 2,
270, 62, 3, 2, 2, 2, 271, 272, 7, 63, 2, 2, 272, 64, 3, 2, 2, 2, 273, 274,
7, 65, 2, 2, 274, 66, 3, 2, 2, 2, 275, 276, 7, 35, 2, 2, 276, 277, 7, 128,
2, 2, 277, 68, 3, 2, 2, 2, 278, 279, 7, 63, 2, 2, 279, 280, 7, 128, 2,
2, 280, 70, 3, 2, 2, 2, 281, 282, 7, 72, 2, 2, 282, 283, 7, 81, 2, 2, 283,
284, 7, 84, 2, 2, 284, 72, 3, 2, 2, 2, 285, 286, 7, 84, 2, 2, 286, 287,
7, 71, 2, 2, 287, 288, 7, 86, 2, 2, 288, 289, 7, 87, 2, 2, 289, 290, 7,
84, 2, 2, 290, 291, 7, 80, 2, 2, 291, 74, 3, 2, 2, 2, 292, 293, 7, 89,
2, 2, 293, 294, 7, 67, 2, 2, 294, 295, 7, 75, 2, 2, 295, 296, 7, 86, 2,
2, 296, 297, 7, 72, 2, 2, 297, 298, 7, 81, 2, 2, 298, 299, 7, 84, 2, 2,
299, 76, 3, 2, 2, 2, 300, 301, 7, 81, 2, 2, 301, 302, 7, 82, 2, 2, 302,
303, 7, 86, 2, 2, 303, 304, 7, 75, 2, 2, 304, 305, 7, 81, 2, 2, 305, 306,
7, 80, 2, 2, 306, 307, 7, 85, 2, 2, 307, 78, 3, 2, 2, 2, 308, 309, 7, 70,
2, 2, 309, 310, 7, 75, 2, 2, 310, 311, 7, 85, 2, 2, 311, 312, 7, 86, 2,
2, 312, 313, 7, 75, 2, 2, 313, 314, 7, 80, 2, 2, 314, 315, 7, 69, 2, 2,
315, 316, 7, 86, 2, 2, 316, 80, 3, 2, 2, 2, 317, 318, 7, 72, 2, 2, 318,
319, 7, 75, 2, 2, 319, 320, 7, 78, 2, 2, 320, 321, 7, 86, 2, 2, 321, 322,
7, 71, 2, 2, 322, 323, 7, 84, 2, 2, 323, 82, 3, 2, 2, 2, 324, 325, 7, 85,
2, 2, 325, 326, 7, 81, 2, 2, 326, 327, 7, 84, 2, 2, 327, 328, 7, 86, 2,
2, 328, 84, 3, 2, 2, 2, 329, 330, 7, 78, 2, 2, 330, 331, 7, 75, 2, 2, 331,
332, 7, 79, 2, 2, 332, 333, 7, 75, 2, 2, 333, 334, 7, 86, 2, 2, 334, 86,
3, 2, 2, 2, 335, 336, 7, 78, 2, 2, 336, 337, 7, 71, 2, 2, 337, 338, 7,
86, 2, 2, 338, 88, 3, 2, 2, 2, 339, 340, 7, 69, 2, 2, 340, 341, 7, 81,
2, 2, 341, 342, 7, 78, 2, 2, 342, 343, 7, 78, 2, 2, 343, 344, 7, 71, 2,
2, 344, 345, 7, 69, 2, 2, 345, 346, 7, 86, 2, 2, 346, 90, 3, 2, 2, 2, 347,
348, 7, 67, 2, 2, 348, 349, 7, 85, 2, 2, 349, 355, 7, 69, 2, 2, 350, 351,
7, 70, 2, 2, 351, 352, 7, 71, 2, 2, 352, 353, 7, 85, 2, 2, 353, 355, 7,
69, 2, 2, 354, 347, 3, 2, 2, 2, 354, 350, 3, 2, 2, 2, 355, 92, 3, 2, 2,
2, 356, 357, 7, 80, 2, 2, 357, 358, 7, 81, 2, 2, 358, 359, 7, 80, 2, 2,
359, 360, 7, 71, 2, 2, 360, 94, 3, 2, 2, 2, 361, 362, 7, 80, 2, 2, 362,
363, 7, 87, 2, 2, 363, 364, 7, 78, 2, 2, 364, 365, 7, 78, 2, 2, 365, 96,
3, 2, 2, 2, 366, 367, 7, 86, 2, 2, 367, 368, 7, 84, 2, 2, 368, 369, 7,
87, 2, 2, 369, 385, 7, 71, 2, 2, 370, 371, 7, 118, 2, 2, 371, 372, 7, 116,
2, 2, 372, 373, 7, 119, 2, 2, 373, 385, 7, 103, 2, 2, 374, 375, 7, 72,
2, 2, 375, 376, 7, 67, 2, 2, 376, 377, 7, 78, 2, 2, 377, 378, 7, 85, 2,
2, 378, 385, 7, 71, 2, 2, 379, 380, 7, 104, 2, 2, 380, 381, 7, 99, 2, 2,
381, 382, 7, 110, 2, 2, 382, 383, 7, 117, 2, 2, 383, 385, 7, 103, 2, 2,
384, 366, 3, 2, 2, 2, 384, 370, 3, 2, 2, 2, 384, 374, 3, 2, 2, 2, 384,
379, 3, 2, 2, 2, 385, 98, 3, 2, 2, 2, 386, 387, 7, 87, 2, 2, 387, 388,
7, 85, 2, 2, 388, 389, 7, 71, 2, 2, 389, 100, 3, 2, 2, 2, 390, 391, 7,
75, 2, 2, 391, 392, 7, 80, 2, 2, 392, 393, 7, 86, 2, 2, 393, 394, 7, 81,
2, 2, 394, 102, 3, 2, 2, 2, 395, 396, 7, 77, 2, 2, 396, 397, 7, 71, 2,
2, 397, 398, 7, 71, 2, 2, 398, 399, 7, 82, 2, 2, 399, 104, 3, 2, 2, 2,
400, 401, 7, 89, 2, 2, 401, 402, 7, 75, 2, 2, 402, 403, 7, 86, 2, 2, 403,
404, 7, 74, 2, 2, 404, 106, 3, 2, 2, 2, 405, 406, 7, 69, 2, 2, 406, 407,
7, 81, 2, 2, 407, 408, 7, 87, 2, 2, 408, 409, 7, 80, 2, 2, 409, 410, 7,
86, 2, 2, 410, 108, 3, 2, 2, 2, 411, 412, 7, 67, 2, 2, 412, 413, 7, 78,
2, 2, 413, 414, 7, 78, 2, 2, 414, 110, 3, 2, 2, 2, 415, 416, 7, 67, 2,
2, 416, 417, 7, 80, 2, 2, 417, 418, 7, 91, 2, 2, 418, 112, 3, 2, 2, 2,
419, 420, 7, 67, 2, 2, 420, 421, 7, 73, 2, 2, 421, 422, 7, 73, 2, 2, 422,
423, 7, 84, 2, 2, 423, 424, 7, 71, 2, 2, 424, 425, 7, 73, 2, 2, 425, 426,
7, 67, 2, 2, 426, 427, 7, 86, 2, 2, 427, 428, 7, 71, 2, 2, 428, 114, 3,
2, 2, 2, 429, 430, 7, 71, 2, 2, 430, 431, 7, 88, 2, 2, 431, 432, 7, 71,
2, 2, 432, 433, 7, 80, 2, 2, 433, 434, 7, 86, 2, 2, 434, 116, 3, 2, 2,
2, 435, 436, 7, 78, 2, 2, 436, 437, 7, 75, 2, 2, 437, 438, 7, 77, 2, 2,
438, 439, 7, 71, 2, 2, 439, 118, 3, 2, 2, 2, 440, 441, 7, 80, 2, 2, 441,
442, 7, 81, 2, 2, 442, 445, 7, 86, 2, 2, 443, 445, 7, 35, 2, 2, 444, 440,
3, 2, 2, 2, 444, 443, 3, 2, 2, 2, 445, 120, 3, 2, 2, 2, 446, 447, 7, 75,
2, 2, 447, 448, 7, 80, 2, 2, 448, 122, 3, 2, 2, 2, 449, 450, 7, 70, 2,
2, 450, 451, 7, 81, 2, 2, 451, 124, 3, 2, 2, 2, 452, 453, 7, 89, 2, 2,
453, 454, 7, 74, 2, 2, 454, 455, 7, 75, 2, 2, 455, 456, 7, 78, 2, 2, 456,
457, 7, 71, 2, 2, 457, 126, 3, 2, 2, 2, 458, 459, 7, 66, 2, 2, 459, 128,
3, 2, 2, 2, 460, 462, 5, 149, 75, 2, 461, 460, 3, 2, 2, 2, 462, 463, 3,
2, 2, 2, 463, 461, 3, 2, 2, 2, 463, 464, 3, 2, 2, 2, 464, 474, 3, 2, 2,
2, 465, 469, 5, 151, 76, 2, 466, 468, 5, 129, 65, 2, 467, 466, 3, 2, 2,
2, 468, 471, 3, 2, 2, 2, 469, 467, 3, 2, 2, 2, 469, 470, 3, 2, 2, 2, 470,
473, 3, 2, 2, 2, 471, 469, 3, 2, 2, 2, 472, 465, 3, 2, 2, 2, 473, 476,
3, 2, 2, 2, 474, 472, 3, 2, 2, 2, 474, 475, 3, 2, 2, 2, 475, 486, 3, 2,
2, 2, 476, 474, 3, 2, 2, 2, 477, 481, 5, 155, 78, 2, 478, 480, 5, 129,
65, 2, 479, 478, 3, 2, 2, 2, 480, 483, 3, 2, 2, 2, 481, 479, 3, 2, 2, 2,
481, 482, 3, 2, 2, 2, 482, 485, 3, 2, 2, 2, 483, 481, 3, 2, 2, 2, 484,
477, 3, 2, 2, 2, 485, 488, 3, 2, 2, 2, 486, 484, 3, 2, 2, 2, 486, 487,
3, 2, 2, 2, 487, 130, 3, 2, 2, 2, 488, 486, 3, 2, 2, 2, 489, 490, 5, 153,
77, 2, 490, 132, 3, 2, 2, 2, 491, 496, 5, 159, 80, 2, 492, 496, 5, 157,
79, 2, 493, 496, 5, 161, 81, 2, 494, 496, 5, 163, 82, 2, 495, 491, 3, 2,
2, 2, 495, 492, 3, 2, 2, 2, 495, 493, 3, 2, 2, 2, 495, 494, 3, 2, 2, 2,
496, 134, 3, 2, 2, 2, 497, 499, 9, 4, 2, 2, 498, 497, 3, 2, 2, 2, 499,
500, 3, 2, 2, 2, 500, 498, 3, 2, 2, 2, 500, 501, 3, 2, 2, 2, 501, 136,
3, 2, 2, 2, 502, 503, 5, 145, 73, 2, 503, 505, 5, 15, 8, 2, 504, 506, 9,
4, 2, 2, 505, 504, 3, 2, 2, 2, 506, 507, 3, 2, 2, 2, 507, 505, 3, 2, 2,
2, 507, 508, 3, 2, 2, 2, 508, 510, 3, 2, 2, 2, 509, 511, 5, 147, 74, 2,
510, 509, 3, 2, 2, 2, 510, 511, 3, 2, 2, 2, 511, 517, 3, 2, 2, 2, 512,
514, 5, 145, 73, 2, 513, 515, 5, 147, 74, 2, 514, 513, 3, 2, 2, 2, 514,
515, 3, 2, 2, 2, 515, 517, 3, 2, 2, 2, 516, 502, 3, 2, 2, 2, 516, 512,
3, 2, 2, 2, 517, 138, 3, 2, 2, 2, 518, 519, 5, 129, 65, 2, 519, 520, 5,
165, 83, 2, 520, 140, 3, 2, 2, 2, 521, 522, 11, 2, 2, 2, 522, 142, 3, 2,
2, 2, 523, 524, 9, 5, 2, 2, 524, 144, 3, 2, 2, 2, 525, 534, 7, 50, 2, 2,
526, 530, 9, 6, 2, 2, 527, 529, 9, 4, 2, 2, 528, 527, 3, 2, 2, 2, 529,
532, 3, 2, 2, 2, 530, 528, 3, 2, 2, 2, 530, 531, 3, 2, 2, 2, 531, 534,
3, 2, 2, 2, 532, 530, 3, 2, 2, 2, 533, 525, 3, 2, 2, 2, 533, 526, 3, 2,
2, 2, 534, 146, 3, 2, 2, 2, 535, 537, 9, 7, 2, 2, 536, 538, 9, 8, 2, 2,
537, 536, 3, 2, 2, 2, 537, 538, 3, 2, 2, 2, 538, 540, 3, 2, 2, 2, 539,
541, 9, 4, 2, 2, 540, 539, 3, 2, 2, 2, 541, 542, 3, 2, 2, 2, 542, 540,
3, 2, 2, 2, 542, 543, 3, 2, 2, 2, 543, 148, 3, 2, 2, 2, 544, 545, 9, 9,
2, 2, 545, 150, 3, 2, 2, 2, 546, 547, 5, 153, 77, 2, 547, 152, 3, 2, 2,
2, 548, 549, 7, 97, 2, 2, 549, 154, 3, 2, 2, 2, 550, 551, 4, 50, 59, 2,
551, 156, 3, 2, 2, 2, 552, 560, 7, 36, 2, 2, 553, 554, 7, 94, 2, 2, 554,
559, 11, 2, 2, 2, 555, 556, 7, 36, 2, 2, 556, 559, 7, 36, 2, 2, 557, 559,
10, 10, 2, 2, 558, 553, 3, 2, 2, 2, 558, 555, 3, 2, 2, 2, 558, 557, 3,
2, 2, 2, 559, 562, 3, 2, 2, 2, 560, 558, 3, 2, 2, 2, 560, 561, 3, 2, 2,
2, 561, 563, 3, 2, 2, 2, 562, 560, 3, 2, 2, 2, 563, 564, 7, 36, 2, 2, 564,
158, 3, 2, 2, 2, 565, 573, 7, 41, 2, 2, 566, 567, 7, 94, 2, 2, 567, 572,
11, 2, 2, 2, 568, 569, 7, 41, 2, 2, 569, 572, 7, 41, 2, 2, 570, 572, 10,
11, 2, 2, 571, 566, 3, 2, 2, 2, 571, 568, 3, 2, 2, 2, 571, 570, 3, 2, 2,
2, 572, 575, 3, 2, 2, 2, 573, 571, 3, 2, 2, 2, 573, 574, 3, 2, 2, 2, 574,
576, 3, 2, 2, 2, 575, 573, 3, 2, 2, 2, 576, 577, 7, 41, 2, 2, 577, 160,
3, 2, 2, 2, 578, 584, 7, 98, 2, 2, 579, 580, 7, 94, 2, 2, 580, 583, 7,
98, 2, 2, 581, 583, 10, 12, 2, 2, 582, 579, 3, 2, 2, 2, 582, 581, 3, 2,
2, 2, 583, 586, 3, 2, 2, 2, 584, 582, 3, 2, 2, 2, 584, 585, 3, 2, 2, 2,
585, 587, 3, 2, 2, 2, 586, 584, 3, 2, 2, 2, 587, 588, 7, 98, 2, 2, 588,
162, 3, 2, 2, 2, 589, 595, 7, 182, 2, 2, 590, 591, 7, 94, 2, 2, 591, 594,
7, 182, 2, 2, 592, 594, 10, 13, 2, 2, 593, 590, 3, 2, 2, 2, 593, 592, 3,
2, 2, 2, 594, 597, 3, 2, 2, 2, 595, 593, 3, 2, 2, 2, 595, 596, 3, 2, 2,
2, 596, 598, 3, 2, 2, 2, 597, 595, 3, 2, 2, 2, 598, 599, 7, 182, 2, 2,
599, 164, 3, 2, 2, 2, 600, 601, 7, 60, 2, 2, 601, 602, 7, 60, 2, 2, 602,
166, 3, 2, 2, 2, 34, 2, 173, 187, 195, 260, 266, 354, 384, 444, 463, 469,
474, 481, 486, 495, 500, 507, 510, 514, 516, 530, 533, 537, 542, 558, 560,
571, 573, 582, 584, 593, 595, 3, 2, 3, 2,
}
var lexerChannelNames = []string{
@ -308,8 +311,9 @@ var lexerSymbolicNames = []string{
"For", "Return", "Waitfor", "Options", "Distinct", "Filter", "Sort", "Limit",
"Let", "Collect", "SortDirection", "None", "Null", "BooleanLiteral", "Use",
"Into", "Keep", "With", "Count", "All", "Any", "Aggregate", "Event", "Like",
"Not", "In", "Do", "While", "Param", "Identifier", "StringLiteral", "IntegerLiteral",
"FloatLiteral", "NamespaceSegment", "UnknownIdentifier",
"Not", "In", "Do", "While", "Param", "Identifier", "IgnoreIdentifier",
"StringLiteral", "IntegerLiteral", "FloatLiteral", "NamespaceSegment",
"UnknownIdentifier",
}
var lexerRuleNames = []string{
@ -321,9 +325,10 @@ var lexerRuleNames = []string{
"For", "Return", "Waitfor", "Options", "Distinct", "Filter", "Sort", "Limit",
"Let", "Collect", "SortDirection", "None", "Null", "BooleanLiteral", "Use",
"Into", "Keep", "With", "Count", "All", "Any", "Aggregate", "Event", "Like",
"Not", "In", "Do", "While", "Param", "Identifier", "StringLiteral", "IntegerLiteral",
"FloatLiteral", "NamespaceSegment", "UnknownIdentifier", "HexDigit", "DecimalIntegerLiteral",
"ExponentPart", "Letter", "Symbols", "Digit", "DQSring", "SQString", "BacktickString",
"Not", "In", "Do", "While", "Param", "Identifier", "IgnoreIdentifier",
"StringLiteral", "IntegerLiteral", "FloatLiteral", "NamespaceSegment",
"UnknownIdentifier", "HexDigit", "DecimalIntegerLiteral", "ExponentPart",
"Letter", "Symbols", "Underscore", "Digit", "DQSring", "SQString", "BacktickString",
"TickString", "NamespaceSeparator",
}
@ -428,9 +433,10 @@ const (
FqlLexerWhile = 62
FqlLexerParam = 63
FqlLexerIdentifier = 64
FqlLexerStringLiteral = 65
FqlLexerIntegerLiteral = 66
FqlLexerFloatLiteral = 67
FqlLexerNamespaceSegment = 68
FqlLexerUnknownIdentifier = 69
FqlLexerIgnoreIdentifier = 65
FqlLexerStringLiteral = 66
FqlLexerIntegerLiteral = 67
FqlLexerFloatLiteral = 68
FqlLexerNamespaceSegment = 69
FqlLexerUnknownIdentifier = 70
)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
package core
const (
IgnorableVariable = "_"
)

View File

@ -74,21 +74,24 @@ func newScope(root *RootScope, parent *Scope) *Scope {
}
func (s *Scope) SetVariable(name string, val Value) error {
_, exists := s.vars[name]
if name != IgnorableVariable {
_, exists := s.vars[name]
// it already has been declared in the current scope
if exists {
return Errorf(ErrNotUnique, "variable is already declared: '%s'", name)
// it already has been declared in the current scope
if exists {
return Errorf(ErrNotUnique, "variable is already declared: '%s'", name)
}
s.vars[name] = val
}
// we still want to make sure that nothing than needs to be closed leaks out
disposable, ok := val.(io.Closer)
if ok {
s.root.AddDisposable(disposable)
}
s.vars[name] = val
return nil
}

View File

@ -9,11 +9,12 @@ import (
)
type ForExpression struct {
src core.SourceMap
dataSource collections.Iterable
predicate core.Expression
distinct bool
spread bool
src core.SourceMap
dataSource collections.Iterable
predicate core.Expression
distinct bool
spread bool
passThrough bool
}
func NewForExpression(
@ -21,7 +22,8 @@ func NewForExpression(
dataSource collections.Iterable,
predicate core.Expression,
distinct,
spread bool,
spread,
passThrough bool,
) (*ForExpression, error) {
if dataSource == nil {
return nil, core.Error(core.ErrMissedArgument, "missed source expression")
@ -31,13 +33,15 @@ func NewForExpression(
return nil, core.Error(core.ErrMissedArgument, "missed return expression")
}
return &ForExpression{
src,
dataSource,
predicate,
distinct,
spread,
}, nil
exp := new(ForExpression)
exp.src = src
exp.dataSource = dataSource
exp.predicate = predicate
exp.distinct = distinct
exp.spread = spread
exp.passThrough = passThrough
return exp, nil
}
func (e *ForExpression) AddLimit(src core.SourceMap, size, count core.Expression) error {
@ -118,14 +122,10 @@ func (e *ForExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value
return values.None, err
}
// Hash map for a check for uniqueness
var hashTable map[uint64]bool
if e.distinct {
hashTable = make(map[uint64]bool)
}
res := values.NewArray(10)
res := NewForResult(10).
Distinct(e.distinct).
Spread(e.spread).
PassThrough(e.passThrough)
for {
nextScope, err := iterator.Next(ctx, scope)
@ -144,42 +144,9 @@ func (e *ForExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value
return values.None, err
}
var add bool
// The result shouldn't be distinct
// Just add the output
if !e.distinct {
add = true
} else {
// We need to check whether the value already exists in the result set
hash := out.Hash()
_, exists := hashTable[hash]
if !exists {
hashTable[hash] = true
add = true
}
}
if add {
if !e.spread {
res.Push(out)
} else {
elements, ok := out.(*values.Array)
if !ok {
return values.None, core.Error(core.ErrInvalidOperation, "spread of non-array value")
}
elements.ForEach(func(i core.Value, _ int) bool {
res.Push(i)
return true
})
}
}
res.Push(out)
}
return res, nil
return res.ToArray(), nil
}
}

View File

@ -0,0 +1,88 @@
package expressions
import (
"github.com/MontFerret/ferret/pkg/runtime/core"
"github.com/MontFerret/ferret/pkg/runtime/values"
)
type ForResult struct {
itemList *values.Array
hashTable map[uint64]bool
distinct bool
spread bool
passThrough bool
}
func NewForResult(capacity int) *ForResult {
res := new(ForResult)
res.itemList = values.NewArray(capacity)
return res
}
func (f *ForResult) Distinct(distinct bool) *ForResult {
f.distinct = distinct
if f.distinct {
f.hashTable = make(map[uint64]bool)
} else {
f.hashTable = nil
}
return f
}
func (f *ForResult) Spread(spread bool) *ForResult {
f.spread = spread
return f
}
func (f *ForResult) PassThrough(passThrough bool) *ForResult {
f.passThrough = passThrough
return f
}
func (f *ForResult) Push(value core.Value) {
if f.passThrough {
return
}
if f.distinct {
// We need to check whether the value already exists in the result set
hash := value.Hash()
// if already exists
// we skip it
if f.hashTable[hash] {
return
}
f.hashTable[hash] = true
}
if !f.spread {
f.itemList.Push(value)
return
}
elements, ok := value.(*values.Array)
if !ok {
f.itemList.Push(value)
return
}
elements.ForEach(func(i core.Value, _ int) bool {
f.Push(i)
return true
})
}
func (f *ForResult) ToArray() *values.Array {
return f.itemList
}

View File

@ -13,3 +13,9 @@ var None = &noneLiteral{}
func (l noneLiteral) Exec(_ context.Context, _ *core.Scope) (core.Value, error) {
return values.None, nil
}
func IsNone(exp core.Expression) bool {
_, is := exp.(*noneLiteral)
return is
}

View File

@ -27,6 +27,10 @@ func NewReturnExpression(
}, nil
}
func (e *ReturnExpression) Predicate() core.Expression {
return e.predicate
}
func (e *ReturnExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value, error) {
select {
case <-ctx.Done():

View File

@ -0,0 +1,108 @@
package expressions
import (
"github.com/MontFerret/ferret/pkg/runtime/core"
"github.com/MontFerret/ferret/pkg/runtime/values"
"math"
)
// Vector TODO: Finish and add unit tests
type Vector struct {
slices map[int][]core.Value
capacity int
current int
}
func NewVector(capacity int) *Vector {
el := new(Vector)
el.slices = make(map[int][]core.Value)
el.capacity = capacity
el.current = -1
return el
}
func (vec *Vector) Push(value core.Value) *Vector {
slice := vec.getCurrentSlice()
slice[len(slice)] = value
return vec
}
func (vec *Vector) Get(index int) core.Value {
var sliceIndex int
var itemIndex int
// if it's within a capacity
if index < vec.capacity {
sliceIndex = 0
itemIndex = index
} else {
sliceIndex = int(math.Floor(float64(index / vec.capacity)))
itemIndex = index % vec.capacity
}
// if out of range
if sliceIndex >= len(vec.slices) {
return values.None
}
return vec.slices[sliceIndex][itemIndex]
}
func (vec *Vector) ForEach(predicate func(item core.Value, index int)) {
if len(vec.slices) == 0 {
return
}
lastIndex := vec.capacity * len(vec.slices)
for i := 0; i <= lastIndex; i++ {
itemIndex := i % vec.capacity
sliceIndex := int(math.Floor(float64(i / vec.capacity)))
predicate(vec.slices[sliceIndex][itemIndex], i)
}
}
func (vec *Vector) ToSlice() []core.Value {
out := make([]core.Value, vec.capacity*len(vec.slices))
if len(vec.slices) == 0 {
return out
}
lastIndex := vec.capacity * len(vec.slices)
for i := 0; i <= lastIndex; i++ {
itemIndex := i % vec.capacity
sliceIndex := int(math.Floor(float64(i / vec.capacity)))
out[i] = vec.slices[sliceIndex][itemIndex]
}
return out
}
func (vec *Vector) getCurrentSlice() []core.Value {
if vec.current < 0 {
return vec.newSlice()
}
current := vec.slices[vec.current]
if len(current) < vec.capacity {
return current
}
return vec.newSlice()
}
func (vec *Vector) newSlice() []core.Value {
slice := make([]core.Value, 0, vec.capacity)
vec.current++
vec.slices[vec.current] = slice
return slice
}

View File

@ -34,6 +34,10 @@ func NewArrayWith(values ...core.Value) *Array {
return &Array{items: values}
}
func NewArrayOf(values []core.Value) *Array {
return &Array{items: values}
}
func (t *Array) MarshalJSON() ([]byte, error) {
return jettison.MarshalOpts(t.items, jettison.NoHTMLEscaping())
}