From dcbdccd1bd3ee87b636ab0e73268aa8c0f2a467b Mon Sep 17 00:00:00 2001 From: Wesley Shields Date: Mon, 20 Dec 2021 05:35:14 -0500 Subject: [PATCH] Handle remaining new grammar features (string count in range, string set in range and rule sets). (#46) * Handle string count in range. Add support for parsing string counts in range: #s0 in (0..100) == 2 * Handle string sets in range. Add support for parsing string sets in range: any of ($s*) in (0..100) * Add support for rule sets. To avoid a name clash with RuleSet in the protobuf I called it a RuleEnumeration. --- ast/ast.go | 124 ++++-- ast/serialization.go | 58 ++- parser/grammar.y | 67 ++++ parser/lexer.go | 654 +++++++++++++++++-------------- parser/lexer.l | 5 + parser/parser.go | 875 +++++++++++++++++++++++------------------- pb/yara.pb.go | 646 +++++++++++++++++++------------ pb/yara.proto | 24 ++ serialize.go | 44 ++- tests/grammar_test.go | 25 ++ 10 files changed, 1546 insertions(+), 976 deletions(-) diff --git a/ast/ast.go b/ast/ast.go index d33f126..ee5976a 100644 --- a/ast/ast.go +++ b/ast/ast.go @@ -127,8 +127,11 @@ type StringIdentifier struct { // StringCount is an Expression that represents a string count operation, like // "#a". Notice that the Identifier field doesn't contain the # prefix. +// "In" is non-nil if the identifier is accompanied by an "in" condition, like +// "#a in (0..100) == 2". type StringCount struct { Identifier string + In *Range } // StringOffset is an Expression that represents a string offset operation, like @@ -201,9 +204,13 @@ type ForOf struct { // Of is an Expression representing a "of" operation. Example: // of +// of in +// If "In" is non-nil there is an "in" condition: 3 of them in (0..100) type Of struct { Quantifier *Quantifier Strings Node + Rules Node + In *Range } // Operation is an Expression representing an operation with two or more operands, @@ -363,6 +370,12 @@ func (s *StringIdentifier) WriteSource(w io.Writer) error { // WriteSource writes the node's source into the writer w. func (s *StringCount) WriteSource(w io.Writer) error { _, err := io.WriteString(w, fmt.Sprintf("#%s", s.Identifier)) + if err == nil && s.In != nil { + _, err = io.WriteString(w, " in ") + if err == nil { + err = s.In.WriteSource(w) + } + } return err } @@ -495,13 +508,25 @@ func (f *ForOf) WriteSource(w io.Writer) error { // WriteSource writes the node's source into the writer w. func (o *Of) WriteSource(w io.Writer) error { + if (o.Strings == nil && o.Rules == nil) || (o.Strings != nil && o.Rules != nil) { + panic("expecting one string set or rule set in \"of\"") + } err := o.Quantifier.WriteSource(w) if err == nil { _, err = io.WriteString(w, " of ") } - if err == nil { + if err == nil && o.Strings != nil { err = o.Strings.WriteSource(w) } + if err == nil && o.Rules != nil { + err = o.Rules.WriteSource(w) + } + if err == nil && o.In != nil { + _, err = io.WriteString(w, " in ") + if err == nil { + err = o.In.WriteSource(w) + } + } return err } @@ -638,7 +663,7 @@ func (f *ForOf) Children() []Node { // Children returns the node's child nodes. func (o *Of) Children() []Node { - return []Node{o.Quantifier, o.Strings} + return []Node{o.Quantifier, o.Strings, o.Rules} } // Children returns the operation's children nodes. @@ -815,11 +840,27 @@ func (s *StringIdentifier) AsProto() *pb.Expression { // AsProto returns the Expression serialized as a pb.Expression. func (s *StringCount) AsProto() *pb.Expression { - return &pb.Expression{ + expr := &pb.Expression{ Expression: &pb.Expression_StringCount{ StringCount: fmt.Sprintf("#%s", s.Identifier), }, } + if s.In != nil { + expr = &pb.Expression{ + Expression: &pb.Expression_BinaryExpression{ + BinaryExpression: &pb.BinaryExpression{ + Operator: pb.BinaryExpression_IN.Enum(), + Left: expr, + Right: &pb.Expression{ + Expression: &pb.Expression_Range{ + Range: s.In.AsProto(), + }, + }, + }, + }, + } + } + return expr } // AsProto returns the Expression serialized as a pb.Expression. @@ -1043,39 +1084,70 @@ func (f *ForOf) AsProto() *pb.Expression { // AsProto returns the Expression serialized as a pb.Expression. func (o *Of) AsProto() *pb.Expression { + if (o.Strings == nil && o.Rules == nil) || (o.Strings != nil && o.Rules != nil) { + panic("expecting one string set or rule set in \"of\"") + } var s *pb.StringSet - switch v := o.Strings.(type) { - case *Enum: - items := make([]*pb.StringEnumeration_StringEnumerationItem, len(v.Values)) - for i, item := range v.Values { - identifier := item.(*StringIdentifier).Identifier - items[i] = &pb.StringEnumeration_StringEnumerationItem{ - StringIdentifier: proto.String(fmt.Sprintf("$%s", identifier)), - HasWildcard: proto.Bool(strings.HasSuffix(identifier, "*")), + var rule_enumeration *pb.RuleEnumeration + if o.Strings != nil { + switch v := o.Strings.(type) { + case *Enum: + items := make([]*pb.StringEnumeration_StringEnumerationItem, len(v.Values)) + for i, item := range v.Values { + identifier := item.(*StringIdentifier).Identifier + items[i] = &pb.StringEnumeration_StringEnumerationItem{ + StringIdentifier: proto.String(fmt.Sprintf("$%s", identifier)), + HasWildcard: proto.Bool(strings.HasSuffix(identifier, "*")), + } } - } - s = &pb.StringSet{ - Set: &pb.StringSet_Strings{ - Strings: &pb.StringEnumeration{ - Items: items, + s = &pb.StringSet{ + Set: &pb.StringSet_Strings{ + Strings: &pb.StringEnumeration{ + Items: items, + }, }, - }, + } + case Keyword: + if v != KeywordThem { + panic(fmt.Sprintf(`unexpected keyword "%s"`, v)) + } + s = &pb.StringSet{ + Set: &pb.StringSet_Keyword{ + Keyword: pb.StringSetKeyword_THEM, + }, + } } - case Keyword: - if v != KeywordThem { - panic(fmt.Sprintf(`unexpected keyword "%s"`, v)) + } + if o.Rules != nil { + switch v := o.Rules.(type) { + case *Enum: + items := make([]*pb.RuleEnumeration_RuleEnumerationItem, len(v.Values)) + for i, item := range v.Values { + identifier := item.(*Identifier).Identifier + items[i] = &pb.RuleEnumeration_RuleEnumerationItem{ + RuleIdentifier: proto.String(fmt.Sprintf("%s", identifier)), + HasWildcard: proto.Bool(strings.HasSuffix(identifier, "*")), + } + } + rule_enumeration = &pb.RuleEnumeration{ + Items: items, + } } - s = &pb.StringSet{ - Set: &pb.StringSet_Keyword{ - Keyword: pb.StringSetKeyword_THEM, - }, + } + var r *pb.Range = nil; + if o.In != nil { + r = &pb.Range{ + Start: o.In.Start.AsProto(), + End: o.In.End.AsProto(), } } return &pb.Expression{ Expression: &pb.Expression_ForOfExpression{ ForOfExpression: &pb.ForOfExpression{ - ForExpression: o.Quantifier.AsProto(), - StringSet: s, + ForExpression: o.Quantifier.AsProto(), + StringSet: s, + Range: r, + RuleEnumeration: rule_enumeration, }, }, } diff --git a/ast/serialization.go b/ast/serialization.go index ad41ad3..2db0ec6 100644 --- a/ast/serialization.go +++ b/ast/serialization.go @@ -326,24 +326,42 @@ func forInExpressionFromProto(expr *pb.ForInExpression) *ForIn { } func forOfExpressionFromProto(expr *pb.ForOfExpression) Expression { + if (expr.GetStringSet() == nil && expr.GetRuleEnumeration() == nil) || (expr.GetStringSet() != nil && expr.GetRuleEnumeration() != nil) { + panic("expecting one string set or rule set in \"forOf\"") + } var strs Node - switch v := expr.GetStringSet().GetSet().(type) { - case *pb.StringSet_Strings: - items := v.Strings.GetItems() + var rules Node + if expr.GetStringSet() != nil { + switch v := expr.GetStringSet().GetSet().(type) { + case *pb.StringSet_Strings: + items := v.Strings.GetItems() + enum := &Enum{ + Values: make([]Expression, len(items)), + } + for i, item := range items { + enum.Values[i] = &StringIdentifier{ + Identifier: strings.TrimPrefix(item.GetStringIdentifier(), "$"), + } + } + strs = enum + case *pb.StringSet_Keyword: + if v.Keyword != pb.StringSetKeyword_THEM { + panic(fmt.Sprintf(`unexpected keyword "%T"`, v)) + } + strs = KeywordThem + } + } + if expr.GetRuleEnumeration() != nil { + items := expr.GetRuleEnumeration().GetItems() enum := &Enum{ Values: make([]Expression, len(items)), } for i, item := range items { - enum.Values[i] = &StringIdentifier{ - Identifier: strings.TrimPrefix(item.GetStringIdentifier(), "$"), + enum.Values[i] = &Identifier{ + Identifier: item.GetRuleIdentifier(), } } - strs = enum - case *pb.StringSet_Keyword: - if v.Keyword != pb.StringSetKeyword_THEM { - panic(fmt.Sprintf(`unexpected keyword "%T"`, v)) - } - strs = KeywordThem + rules = enum } condition := expr.GetExpression() // A " of " expression is serialized to protobuf @@ -354,6 +372,8 @@ func forOfExpressionFromProto(expr *pb.ForOfExpression) Expression { return &Of{ Quantifier: quantifierFromProto(expr.GetForExpression()), Strings: strs, + Rules: rules, + In: rangeFromProto(expr.GetRange()), } } return &ForOf{ @@ -374,9 +394,19 @@ func binaryExpressionFromProto(expr *pb.BinaryExpression) Expression { At: expressionFromProto(expr.GetRight()), } case opIn: - return &StringIdentifier{ - Identifier: strings.TrimPrefix(expr.GetLeft().GetStringIdentifier(), "$"), - In: rangeFromProto(expr.GetRight().GetRange()), + switch v := expr.GetLeft().GetExpression().(type) { + case *pb.Expression_StringIdentifier: + return &StringIdentifier{ + Identifier: strings.TrimPrefix(expr.GetLeft().GetStringIdentifier(), "$"), + In: rangeFromProto(expr.GetRight().GetRange()), + } + case *pb.Expression_StringCount: + return &StringCount{ + Identifier: strings.TrimPrefix(expr.GetLeft().GetStringCount(), "#"), + In: rangeFromProto(expr.GetRight().GetRange()), + } + default: + panic(fmt.Sprintf(`unexpected binary expression "%v"`, v)) } default: return createOperationExpression(op, expr.GetLeft(), expr.GetRight()) diff --git a/parser/grammar.y b/parser/grammar.y index f18e0bf..f0626ba 100644 --- a/parser/grammar.y +++ b/parser/grammar.y @@ -79,6 +79,7 @@ type stringModifiers struct { %token _STRINGS_ %token _CONDITION_ %token _IDENTIFIER_ +%token _IDENTIFIER_WITH_WILDCARD_ %token _STRING_IDENTIFIER_ %token _STRING_COUNT_ %token _STRING_OFFSET_ @@ -166,6 +167,9 @@ type stringModifiers struct { %type for_variables %type string_enumeration %type string_enumeration_item +%type rule_set +%type rule_enumeration +%type rule_enumeration_item %union { @@ -190,6 +194,7 @@ type stringModifiers struct { si *ast.StringIdentifier sis []*ast.StringIdentifier quantifier *ast.Quantifier + ident *ast.Identifier // lineno is not a symbol type, it's the line number where the symbol // appears in the source file. This is a little hack used for passing @@ -817,6 +822,14 @@ expression Condition: $7, } } + | for_expression _OF_ string_set _IN_ range + { + $$ = &ast.Of{ + Quantifier: $1, + Strings: $3, + In: $5, + } + } | for_expression _OF_ string_set { $$ = &ast.Of{ @@ -824,6 +837,13 @@ expression Strings: $3, } } + | for_expression _OF_ rule_set + { + $$ = &ast.Of{ + Quantifier: $1, + Rules: $3, + } + } | primary_expression '%' _OF_ string_set { $$ = &ast.Of{ @@ -831,6 +851,13 @@ expression Strings: $4, } } + | primary_expression '%' _OF_ rule_set + { + $$ = &ast.Of{ + Quantifier: &ast.Quantifier{&ast.Percentage{$1}}, + Rules: $4, + } + } | _NOT_ boolean_expression { $$ = &ast.Not{$2} @@ -970,6 +997,39 @@ string_enumeration_item } ; + +rule_set + : '(' rule_enumeration ')' + { + $$ = &ast.Enum{Values: $2} + } + ; + + +rule_enumeration + : rule_enumeration_item + { + $$ = []ast.Expression{$1} + } + | rule_enumeration ',' rule_enumeration_item + { + $$ = append($1, $3) + } + ; + + +rule_enumeration_item + : _IDENTIFIER_ + { + $$ = &ast.Identifier{Identifier: $1} + } + | _IDENTIFIER_WITH_WILDCARD_ + { + $$ = &ast.Identifier{Identifier: $1} + } + ; + + for_expression : primary_expression { @@ -1050,6 +1110,13 @@ primary_expression $$ = &ast.LiteralString{$1} } + | _STRING_COUNT_ _IN_ range + { + $$ = &ast.StringCount{ + Identifier: strings.TrimPrefix($1, "#"), + In: $3, + } + } | _STRING_COUNT_ { $$ = &ast.StringCount{ diff --git a/parser/lexer.go b/parser/lexer.go index 0c7d836..7b8b6bb 100644 --- a/parser/lexer.go +++ b/parser/lexer.go @@ -190,41 +190,41 @@ const yyInteractiveDefault = false // SKEL ---------------------------------------------------------------- // [4.0] data tables for the DFA go here ------------------------------- -const yyNumRules = 82 -const yyEndOfBuffer = 83 -var yyAccept = [294]int16{ 0, - 0, 0, 0, 0, 0, 0, 0, 0, 83, 81, - 80, 80, 55, 77, 53, 52, 81, 78, 58, 58, - 2, 81, 3, 54, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 81, 69, 70, 62, 82, 75, 76, 72, - 82, 49, 49, 55, 7, 53, 51, 52, 1, 47, - 50, 0, 58, 0, 0, 0, 0, 8, 4, 6, - 5, 9, 54, 57, 57, 57, 57, 28, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 29, - 57, 57, 57, 57, 30, 27, 57, 57, 57, 57, - - 57, 57, 57, 57, 0, 0, 69, 71, 66, 67, - 65, 64, 63, 71, 75, 72, 72, 74, 73, 48, - 50, 59, 58, 61, 60, 33, 26, 34, 57, 57, - 57, 57, 57, 57, 57, 32, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 25, 57, - 57, 57, 57, 57, 57, 57, 57, 19, 79, 0, - 0, 0, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 56, 57, - 57, 13, 57, 35, 57, 12, 57, 57, 31, 23, - 18, 0, 0, 0, 0, 0, 79, 68, 15, 57, - - 57, 57, 57, 57, 24, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 0, - 0, 16, 57, 57, 57, 57, 57, 57, 11, 57, - 57, 45, 57, 56, 57, 57, 21, 57, 57, 57, - 0, 0, 0, 0, 0, 79, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 46, 57, 38, 10, 57, - 14, 0, 79, 0, 0, 0, 57, 57, 39, 43, - 57, 37, 20, 57, 57, 57, 57, 0, 0, 0, - 57, 22, 57, 40, 44, 57, 57, 17, 36, 57, - 41, 42, 0, +const yyNumRules = 83 +const yyEndOfBuffer = 84 +var yyAccept = [295]int16{ 0, + 0, 0, 0, 0, 0, 0, 0, 0, 84, 82, + 81, 81, 55, 78, 53, 52, 82, 79, 59, 59, + 2, 82, 3, 54, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 82, 70, 71, 63, 83, 76, 77, 73, + 83, 49, 49, 55, 7, 53, 51, 52, 1, 47, + 50, 0, 59, 0, 0, 0, 0, 8, 4, 6, + 5, 9, 54, 57, 58, 58, 58, 58, 28, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 29, 58, 58, 58, 58, 30, 27, 58, 58, 58, + + 58, 58, 58, 58, 58, 0, 0, 70, 72, 67, + 68, 66, 65, 64, 72, 76, 73, 73, 75, 74, + 48, 50, 60, 59, 62, 61, 33, 26, 34, 58, + 58, 58, 58, 58, 58, 58, 32, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 25, + 58, 58, 58, 58, 58, 58, 58, 58, 19, 80, + 0, 0, 0, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 56, + 58, 58, 13, 58, 35, 58, 12, 58, 58, 31, + 23, 18, 0, 0, 0, 0, 0, 80, 69, 15, + + 58, 58, 58, 58, 58, 24, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 0, 0, 16, 58, 58, 58, 58, 58, 58, 11, + 58, 58, 45, 58, 56, 58, 58, 21, 58, 58, + 58, 0, 0, 0, 0, 0, 80, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 46, 58, 38, 10, + 58, 14, 0, 80, 0, 0, 0, 58, 58, 39, + 43, 58, 37, 20, 58, 58, 58, 58, 0, 0, + 0, 58, 22, 58, 40, 44, 58, 58, 17, 36, + 58, 41, 42, 0, } @@ -268,83 +268,83 @@ var yyMeta = [57]byte{ 0, 11, 12, 11, 11, 1, 1, } -var yyBase = [315]uint16{ 0, - 0, 0, 54, 55, 58, 59, 593, 592, 600, 603, - 603, 603, 577, 603, 0, 589, 587, 54, 54, 58, - 45, 574, 49, 0, 0, 32, 563, 550, 550, 59, - 551, 58, 42, 547, 44, 544, 540, 540, 58, 547, - 546, 541, 573, 0, 603, 603, 88, 0, 603, 67, - 572, 603, 571, 559, 603, 0, 603, 571, 603, 603, - 0, 0, 0, 553, 552, 107, 0, 603, 603, 603, - 603, 603, 0, 0, 536, 42, 542, 0, 528, 531, - 61, 532, 531, 525, 529, 525, 524, 524, 521, 78, - 517, 516, 515, 94, 0, 0, 522, 520, 81, 524, - - 510, 514, 493, 479, 100, 106, 0, 603, 603, 603, - 603, 603, 603, 0, 0, 466, 603, 603, 603, 603, - 0, 0, 603, 131, 0, 0, 0, 0, 460, 456, - 81, 441, 418, 416, 423, 0, 415, 422, 411, 413, - 399, 399, 120, 407, 404, 404, 399, 393, 0, 378, - 387, 330, 335, 332, 337, 324, 335, 0, 603, 361, - 155, 0, 329, 350, 327, 334, 314, 311, 327, 315, - 310, 328, 311, 305, 305, 301, 331, 334, 312, 298, - 304, 0, 295, 0, 299, 0, 280, 284, 0, 0, - 0, 317, 314, 210, 0, 121, 0, 603, 0, 249, - - 216, 223, 222, 216, 0, 220, 215, 217, 225, 205, - 207, 219, 217, 204, 215, 214, 201, 201, 203, 266, - 141, 189, 199, 195, 189, 190, 179, 186, 0, 191, - 180, 0, 183, 0, 170, 169, 0, 179, 163, 163, - 0, 0, 321, 198, 142, 0, 168, 163, 159, 166, - 164, 167, 167, 158, 152, 0, 148, 0, 0, 158, - 0, 150, 188, 151, 185, 167, 160, 151, 0, 0, - 150, 0, 0, 139, 146, 143, 117, 168, 0, 173, - 128, 0, 107, 0, 0, 106, 102, 0, 0, 99, - 0, 0, 603, 377, 390, 403, 409, 414, 422, 429, - - 434, 439, 450, 460, 472, 485, 497, 510, 68, 516, - 519, 529, 542, 548, +var yyBase = [316]uint16{ 0, + 0, 0, 54, 55, 58, 59, 669, 621, 629, 817, + 817, 817, 606, 817, 0, 618, 616, 54, 54, 58, + 45, 601, 49, 0, 612, 64, 65, 69, 66, 82, + 67, 81, 68, 72, 83, 84, 70, 85, 86, 87, + 94, 92, 609, 0, 817, 817, 113, 0, 817, 95, + 606, 817, 605, 591, 817, 0, 817, 601, 817, 817, + 0, 0, 0, 582, 581, 132, 0, 817, 817, 817, + 817, 817, 0, 817, 597, 112, 128, 130, 596, 129, + 131, 132, 142, 143, 145, 146, 148, 149, 151, 153, + 161, 157, 159, 160, 163, 595, 594, 162, 169, 168, + + 176, 164, 173, 166, 177, 168, 179, 0, 817, 817, + 817, 817, 817, 817, 0, 0, 554, 817, 817, 817, + 817, 0, 0, 817, 213, 0, 591, 590, 589, 180, + 206, 187, 190, 194, 208, 209, 588, 195, 210, 223, + 212, 224, 229, 235, 225, 230, 237, 240, 242, 587, + 232, 243, 244, 247, 249, 250, 251, 252, 532, 817, + 531, 298, 0, 253, 256, 254, 264, 268, 267, 262, + 258, 271, 272, 280, 274, 283, 276, 266, 288, 294, + 298, 299, 530, 317, 529, 327, 528, 328, 330, 527, + 526, 525, 522, 519, 375, 0, 331, 0, 817, 520, + + 332, 334, 340, 341, 351, 519, 344, 353, 338, 336, + 347, 337, 390, 366, 356, 394, 396, 358, 404, 405, + 451, 346, 365, 406, 499, 500, 501, 363, 503, 518, + 409, 410, 516, 411, 514, 504, 505, 512, 412, 502, + 507, 0, 0, 553, 434, 352, 0, 506, 513, 511, + 508, 510, 523, 509, 517, 515, 435, 524, 433, 432, + 534, 431, 360, 430, 413, 427, 417, 567, 568, 428, + 427, 571, 425, 414, 572, 573, 575, 574, 418, 0, + 424, 582, 361, 583, 357, 349, 584, 585, 343, 342, + 586, 286, 90, 817, 632, 645, 658, 664, 669, 677, + + 684, 689, 697, 708, 718, 730, 743, 755, 768, 72, + 774, 777, 787, 800, 806, } -var yyDef = [315]int16{ 0, - 293, 1, 294, 294, 295, 295, 296, 296, 293, 293, - 293, 293, 297, 293, 298, 299, 293, 293, 300, 300, - 293, 293, 293, 301, 302, 302, 302, 302, 302, 302, - 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, - 302, 302, 303, 304, 293, 293, 305, 306, 293, 293, - 307, 293, 293, 297, 293, 298, 293, 299, 293, 293, - 308, 309, 20, 293, 293, 293, 310, 293, 293, 293, - 293, 293, 301, 302, 302, 302, 302, 302, 302, 302, - 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, - 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, - - 302, 302, 302, 302, 303, 293, 304, 293, 293, 293, - 293, 293, 293, 311, 306, 293, 293, 293, 293, 293, - 308, 309, 293, 293, 310, 302, 302, 302, 302, 302, - 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, - 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, - 302, 302, 302, 302, 302, 302, 302, 302, 293, 312, - 313, 314, 302, 302, 302, 302, 302, 302, 302, 302, - 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, - 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, - 302, 312, 293, 313, 194, 194, 194, 293, 302, 302, - - 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, - 302, 302, 302, 302, 302, 302, 302, 302, 302, 293, - 194, 302, 302, 302, 302, 302, 302, 302, 302, 302, - 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, - 220, 220, 312, 194, 220, 220, 302, 302, 302, 302, - 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, - 302, 312, 312, 194, 220, 220, 302, 302, 302, 302, - 302, 302, 302, 302, 302, 302, 302, 312, 220, 220, - 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, - 302, 302, 0, 293, 293, 293, 293, 293, 293, 293, - - 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, - 293, 293, 293, 293, +var yyDef = [316]int16{ 0, + 294, 1, 295, 295, 296, 296, 297, 297, 294, 294, + 294, 294, 298, 294, 299, 300, 294, 294, 301, 301, + 294, 294, 294, 302, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 304, 305, 294, 294, 306, 307, 294, 294, + 308, 294, 294, 298, 294, 299, 294, 300, 294, 294, + 309, 310, 20, 294, 294, 294, 311, 294, 294, 294, + 294, 294, 302, 294, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + + 303, 303, 303, 303, 303, 304, 294, 305, 294, 294, + 294, 294, 294, 294, 312, 307, 294, 294, 294, 294, + 294, 309, 310, 294, 294, 311, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 294, + 313, 314, 315, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 313, 294, 314, 195, 195, 195, 294, 303, + + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 294, 195, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 221, 221, 313, 195, 221, 221, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 313, 313, 195, 221, 221, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 313, 221, + 221, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 0, 294, 294, 294, 294, 294, 294, + + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, } -var yyNxt = [660]uint16{ 0, +var yyNxt = [874]uint16{ 0, 10, 11, 12, 13, 14, 15, 16, 10, 10, 17, 18, 19, 20, 20, 20, 20, 20, 20, 20, 20, 21, 22, 23, 24, 25, 25, 25, 25, 25, 10, @@ -352,74 +352,98 @@ var yyNxt = [660]uint16{ 0, 25, 33, 34, 35, 36, 37, 38, 39, 40, 25, 41, 42, 25, 25, 43, 10, 45, 45, 46, 46, 49, 49, 60, 62, 61, 68, 69, 62, 50, 50, - 71, 72, 75, 92, 76, 122, 127, 93, 77, 78, - 95, 64, 65, 47, 47, 64, 65, 51, 51, 96, - 82, 87, 109, 88, 128, 132, 100, 66, 83, 89, - - 90, 293, 84, 101, 91, 67, 116, 85, 133, 293, - 106, 142, 152, 117, 160, 165, 161, 110, 124, 124, - 124, 124, 124, 124, 124, 143, 153, 147, 166, 220, - 111, 221, 177, 112, 178, 113, 148, 292, 179, 114, - 291, 149, 124, 124, 124, 124, 124, 124, 124, 220, - 265, 221, 266, 290, 289, 159, 195, 105, 278, 220, - 279, 221, 195, 288, 287, 196, 195, 195, 195, 195, - 195, 195, 195, 195, 195, 265, 193, 266, 243, 195, - 195, 265, 286, 266, 285, 284, 195, 195, 195, 195, - 195, 195, 283, 282, 281, 280, 193, 277, 276, 275, - - 274, 273, 272, 271, 270, 269, 268, 267, 264, 261, - 197, 195, 105, 260, 259, 258, 257, 195, 256, 255, - 196, 195, 195, 195, 195, 195, 195, 195, 195, 195, - 254, 253, 252, 251, 195, 195, 250, 249, 248, 247, - 240, 195, 195, 195, 195, 195, 195, 239, 238, 237, - 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, - 226, 225, 224, 223, 222, 197, 241, 242, 243, 241, - 241, 241, 241, 242, 244, 241, 245, 242, 242, 242, - 242, 242, 242, 242, 242, 242, 241, 241, 241, 241, - 242, 242, 241, 241, 241, 241, 241, 242, 242, 242, - - 242, 242, 242, 241, 241, 241, 241, 241, 241, 241, - 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, - 241, 246, 243, 243, 105, 193, 219, 218, 243, 193, - 217, 262, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 216, 215, 214, 213, 243, 243, 179, 179, 212, - 211, 210, 243, 243, 243, 243, 243, 243, 209, 208, - 207, 206, 205, 204, 203, 202, 201, 200, 199, 193, - 191, 143, 190, 189, 188, 187, 263, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - - 48, 48, 48, 52, 52, 52, 52, 52, 52, 52, - 52, 52, 52, 52, 52, 52, 54, 54, 54, 54, - 54, 56, 186, 56, 56, 56, 58, 185, 184, 58, - 183, 58, 58, 58, 63, 182, 63, 181, 180, 176, - 63, 73, 175, 73, 73, 73, 74, 174, 74, 74, - 74, 105, 105, 173, 172, 171, 105, 105, 170, 105, - 107, 107, 169, 168, 107, 107, 107, 107, 107, 107, - 107, 107, 108, 108, 108, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 115, 115, 167, 115, 115, - 115, 164, 115, 115, 115, 115, 115, 118, 118, 163, - - 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - 121, 121, 117, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 125, 158, 125, 162, 157, 162, 192, - 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, - 192, 192, 194, 194, 194, 194, 194, 194, 194, 194, - 194, 194, 194, 194, 194, 198, 156, 198, 155, 154, - 151, 150, 146, 145, 144, 141, 140, 139, 138, 137, - 136, 135, 134, 131, 130, 129, 126, 123, 123, 57, - 293, 120, 119, 106, 104, 103, 102, 99, 98, 97, - 94, 86, 81, 80, 79, 70, 59, 57, 55, 293, - - 53, 53, 9, 293, 293, 293, 293, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 293, 293, 293, + 71, 72, 74, 74, 74, 74, 74, 74, 74, 123, + 74, 64, 65, 47, 47, 64, 65, 51, 51, 74, + 74, 74, 74, 74, 74, 74, 80, 66, 74, 93, + + 74, 294, 74, 94, 76, 67, 77, 87, 82, 294, + 78, 79, 81, 83, 88, 95, 89, 110, 99, 96, + 74, 84, 90, 91, 101, 85, 103, 92, 97, 98, + 86, 102, 100, 104, 117, 105, 74, 74, 74, 74, + 74, 118, 111, 125, 125, 125, 125, 125, 125, 125, + 74, 74, 127, 74, 74, 112, 74, 74, 113, 74, + 114, 74, 128, 130, 115, 74, 133, 74, 74, 74, + 74, 74, 74, 132, 74, 131, 74, 74, 107, 134, + 129, 74, 135, 136, 74, 74, 138, 161, 74, 162, + 137, 139, 140, 141, 143, 74, 148, 142, 74, 153, + + 158, 151, 74, 74, 145, 149, 146, 147, 144, 152, + 150, 155, 156, 154, 74, 157, 74, 74, 74, 164, + 74, 166, 159, 160, 125, 125, 125, 125, 125, 125, + 125, 74, 74, 74, 167, 172, 168, 74, 74, 169, + 74, 165, 173, 74, 171, 74, 175, 178, 74, 179, + 74, 74, 74, 180, 170, 74, 181, 74, 74, 74, + 74, 74, 74, 182, 74, 174, 74, 176, 183, 177, + 74, 184, 74, 201, 74, 74, 74, 185, 187, 74, + 74, 186, 74, 180, 74, 191, 189, 192, 74, 188, + 190, 74, 200, 202, 74, 203, 74, 206, 144, 196, + + 106, 180, 74, 209, 207, 196, 74, 74, 197, 196, + 196, 196, 196, 196, 196, 196, 196, 196, 204, 205, + 211, 208, 196, 196, 213, 74, 214, 210, 212, 196, + 196, 196, 196, 196, 196, 74, 74, 216, 74, 221, + 74, 222, 74, 215, 74, 74, 74, 223, 74, 74, + 74, 74, 74, 198, 221, 74, 222, 74, 218, 74, + 266, 74, 267, 217, 74, 74, 74, 231, 279, 74, + 280, 74, 220, 74, 74, 219, 196, 106, 230, 225, + 226, 224, 196, 228, 233, 197, 196, 196, 196, 196, + 196, 196, 196, 196, 196, 227, 229, 232, 74, 196, + + 196, 235, 74, 236, 74, 239, 196, 196, 196, 196, + 196, 196, 74, 74, 74, 248, 253, 74, 74, 74, + 74, 221, 74, 222, 234, 266, 194, 267, 244, 237, + 198, 238, 266, 74, 267, 74, 74, 281, 194, 74, + 74, 74, 241, 74, 265, 249, 257, 260, 255, 256, + 240, 242, 243, 244, 242, 242, 242, 242, 243, 245, + 242, 246, 243, 243, 243, 243, 243, 243, 243, 243, + 243, 242, 242, 242, 242, 243, 243, 242, 242, 242, + 242, 242, 243, 243, 243, 243, 243, 243, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + + 242, 242, 242, 242, 242, 242, 247, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 106, + 194, 74, 74, 74, 74, 74, 74, 74, 74, 194, + 74, 250, 74, 274, 252, 268, 271, 251, 254, 272, + 258, 259, 261, 262, 244, 244, 269, 270, 273, 275, + 244, 194, 276, 263, 244, 244, 244, 244, 244, 244, + 244, 244, 244, 278, 277, 74, 74, 244, 244, 74, + 74, 74, 74, 74, 244, 244, 244, 244, 244, 244, + 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + + 118, 282, 74, 74, 74, 74, 124, 124, 264, 57, + 283, 286, 294, 284, 287, 121, 120, 289, 285, 107, + 74, 288, 70, 292, 293, 59, 57, 55, 294, 53, + 290, 291, 44, 44, 44, 44, 44, 44, 44, 44, + 44, 44, 44, 44, 44, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 54, 54, 54, 54, 54, 56, 53, 56, 56, + 56, 58, 294, 294, 58, 294, 58, 58, 58, 63, + 294, 63, 294, 294, 294, 63, 73, 294, 73, 73, + + 73, 75, 294, 294, 75, 294, 75, 75, 75, 106, + 106, 294, 294, 294, 106, 106, 294, 106, 108, 108, + 294, 294, 108, 108, 108, 108, 108, 108, 108, 108, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 116, 116, 294, 116, 116, 116, 294, + 116, 116, 116, 116, 116, 119, 119, 294, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 122, 122, + 294, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 126, 294, 126, 163, 294, 163, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 199, 294, 199, 9, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, } -var yyChk = [660]int16{ 0, +var yyChk = [874]int16{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -427,80 +451,104 @@ var yyChk = [660]int16{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, 3, 4, 5, 6, 18, 19, 18, 21, 21, 20, 5, 6, - 23, 23, 26, 33, 26, 309, 76, 33, 26, 26, - 35, 19, 19, 3, 4, 20, 20, 5, 6, 35, - 30, 32, 47, 32, 76, 81, 39, 19, 30, 32, - - 32, 20, 30, 39, 32, 19, 50, 30, 81, 20, - 105, 90, 99, 50, 106, 131, 106, 47, 66, 66, - 66, 66, 66, 66, 66, 90, 99, 94, 131, 196, - 47, 196, 143, 47, 143, 47, 94, 290, 143, 47, - 287, 94, 124, 124, 124, 124, 124, 124, 124, 221, - 245, 221, 245, 286, 283, 105, 161, 161, 262, 264, - 262, 264, 161, 281, 277, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 266, 278, 266, 278, 161, - 161, 280, 276, 280, 275, 274, 161, 161, 161, 161, - 161, 161, 271, 268, 267, 265, 263, 260, 257, 255, - - 254, 253, 252, 251, 250, 249, 248, 247, 244, 240, - 161, 194, 194, 239, 238, 236, 235, 194, 233, 231, - 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, - 230, 228, 227, 226, 194, 194, 225, 224, 223, 222, - 219, 194, 194, 194, 194, 194, 194, 218, 217, 216, - 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, - 204, 203, 202, 201, 200, 194, 220, 220, 220, 220, - 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, - 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, - 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, - - 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, - 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, - 220, 220, 243, 243, 193, 192, 188, 187, 243, 243, - 185, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 183, 181, 180, 179, 243, 243, 178, 177, 176, - 175, 174, 243, 243, 243, 243, 243, 243, 173, 172, - 171, 170, 169, 168, 167, 166, 165, 164, 163, 160, - 157, 156, 155, 154, 153, 152, 243, 294, 294, 294, + 23, 23, 26, 27, 29, 31, 33, 28, 37, 310, + 34, 19, 19, 3, 4, 20, 20, 5, 6, 32, + 30, 35, 36, 38, 39, 40, 27, 19, 293, 33, + + 42, 20, 41, 33, 26, 19, 26, 31, 29, 20, + 26, 26, 28, 30, 32, 34, 32, 47, 37, 35, + 76, 30, 32, 32, 39, 30, 40, 32, 35, 36, + 30, 39, 38, 41, 50, 42, 77, 80, 78, 81, + 82, 50, 47, 66, 66, 66, 66, 66, 66, 66, + 83, 84, 76, 85, 86, 47, 87, 88, 47, 89, + 47, 90, 77, 78, 47, 92, 82, 93, 94, 91, + 98, 95, 102, 81, 104, 80, 100, 99, 106, 82, + 77, 103, 83, 84, 101, 105, 86, 107, 130, 107, + 85, 87, 88, 89, 91, 132, 95, 90, 133, 100, + + 104, 98, 134, 138, 92, 95, 93, 94, 91, 99, + 95, 101, 102, 100, 131, 103, 135, 136, 139, 130, + 141, 132, 105, 106, 125, 125, 125, 125, 125, 125, + 125, 140, 142, 145, 132, 138, 133, 143, 146, 134, + 151, 131, 139, 144, 136, 147, 141, 144, 148, 144, + 149, 152, 153, 144, 135, 154, 145, 155, 156, 157, + 158, 164, 166, 146, 165, 140, 171, 142, 147, 143, + 170, 148, 167, 165, 178, 169, 168, 149, 152, 172, + 173, 151, 175, 178, 177, 156, 154, 158, 174, 153, + 155, 176, 164, 166, 292, 167, 179, 170, 157, 162, + + 162, 179, 180, 173, 171, 162, 181, 182, 162, 162, + 162, 162, 162, 162, 162, 162, 162, 162, 168, 169, + 175, 172, 162, 162, 177, 184, 180, 174, 176, 162, + 162, 162, 162, 162, 162, 186, 188, 182, 189, 197, + 201, 197, 202, 181, 210, 212, 209, 201, 203, 204, + 290, 289, 207, 162, 222, 211, 222, 286, 186, 205, + 246, 208, 246, 184, 215, 285, 218, 210, 263, 283, + 263, 228, 189, 223, 214, 188, 195, 195, 209, 203, + 204, 202, 195, 207, 212, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 205, 208, 211, 213, 195, + + 195, 214, 216, 215, 217, 218, 195, 195, 195, 195, + 195, 195, 219, 220, 224, 223, 228, 231, 232, 234, + 239, 265, 274, 265, 213, 267, 279, 267, 279, 216, + 195, 217, 281, 273, 281, 271, 270, 266, 264, 262, + 260, 259, 220, 257, 245, 224, 234, 239, 231, 232, + 219, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + + 221, 221, 221, 221, 221, 221, 221, 225, 226, 227, + 240, 229, 236, 237, 248, 241, 251, 254, 252, 250, + 238, 249, 235, 256, 233, 255, 230, 206, 200, 194, + 193, 253, 258, 192, 191, 190, 187, 185, 183, 161, + 159, 225, 261, 254, 227, 248, 251, 226, 229, 252, + 236, 237, 240, 241, 244, 244, 249, 250, 253, 255, + 244, 244, 256, 244, 244, 244, 244, 244, 244, 244, + 244, 244, 244, 261, 258, 268, 269, 244, 244, 272, + 275, 276, 278, 277, 244, 244, 244, 244, 244, 244, + 282, 284, 287, 288, 291, 150, 137, 129, 128, 127, + + 117, 268, 97, 96, 79, 75, 65, 64, 244, 58, + 269, 276, 54, 272, 277, 53, 51, 282, 275, 43, + 25, 278, 22, 288, 291, 17, 16, 13, 9, 8, + 284, 287, 295, 295, 295, 295, 295, 295, 295, 295, + 295, 295, 295, 295, 295, 296, 296, 296, 296, 296, + 296, 296, 296, 296, 296, 296, 296, 296, 297, 297, + 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, + 297, 298, 298, 298, 298, 298, 299, 7, 299, 299, + 299, 300, 0, 0, 300, 0, 300, 300, 300, 301, + 0, 301, 0, 0, 0, 301, 302, 0, 302, 302, + + 302, 303, 0, 0, 303, 0, 303, 303, 303, 304, + 304, 0, 0, 0, 304, 304, 0, 304, 305, 305, + 0, 0, 305, 305, 305, 305, 305, 305, 305, 305, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 307, 307, 0, 307, 307, 307, 0, + 307, 307, 307, 307, 307, 308, 308, 0, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, 309, 309, + 0, 309, 309, 309, 309, 309, 309, 309, 309, 309, + 309, 311, 0, 311, 312, 0, 312, 313, 313, 313, + 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, + + 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, + 314, 314, 314, 315, 0, 315, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, - 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, - - 295, 295, 295, 296, 296, 296, 296, 296, 296, 296, - 296, 296, 296, 296, 296, 296, 297, 297, 297, 297, - 297, 298, 151, 298, 298, 298, 299, 150, 148, 299, - 147, 299, 299, 299, 300, 146, 300, 145, 144, 142, - 300, 301, 141, 301, 301, 301, 302, 140, 302, 302, - 302, 303, 303, 139, 138, 137, 303, 303, 135, 303, - 304, 304, 134, 133, 304, 304, 304, 304, 304, 304, - 304, 304, 305, 305, 305, 305, 305, 305, 305, 305, - 305, 305, 305, 305, 305, 306, 306, 132, 306, 306, - 306, 130, 306, 306, 306, 306, 306, 307, 307, 129, - - 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, - 308, 308, 116, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 310, 104, 310, 311, 103, 311, 312, - 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, - 312, 312, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 314, 102, 314, 101, 100, - 98, 97, 93, 92, 91, 89, 88, 87, 86, 85, - 84, 83, 82, 80, 79, 77, 75, 65, 64, 58, - 54, 53, 51, 43, 42, 41, 40, 38, 37, 36, - 34, 31, 29, 28, 27, 22, 17, 16, 13, 9, - - 8, 7, 293, 293, 293, 293, 293, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 293, 293, 293, + 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, + 294, 294, 294, } /* Table of booleans, true if rule could match eol. */ -var yyRuleCanMatchEol = [83]int32{ 0, +var yyRuleCanMatchEol = [84]int32{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, - 1, 0, 0, }; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, + 1, 1, 0, 0, }; //line parser/lexer.l:1 /* @@ -543,7 +591,7 @@ const eof = 0 -//line parser/lexer.go:547 +//line parser/lexer.go:595 // SKEL ---------------------------------------------------------------- const yyInitial = 0 @@ -628,7 +676,7 @@ func (yy *Scanner) Lex() YYtype { //line parser/lexer.l:161 -//line parser/lexer.go:632 +//line parser/lexer.go:680 // SKEL ---------------------------------------------------------------- for { // loops until end-of-file is reached @@ -656,13 +704,13 @@ yyMatch: } for int(yyChk[int(yyBase[yyCurrentState])+yyC]) != yyCurrentState { yyCurrentState = int(yyDef[yyCurrentState]) - if yyCurrentState >= 294 { + if yyCurrentState >= 295 { yyC = int(yyMeta[yyC]) } } yyCurrentState = int(yyNxt[int(yyBase[yyCurrentState])+yyC]) yyCp++ - if yyCurrentState == 293 { + if yyCurrentState == 294 { break } } @@ -1195,7 +1243,7 @@ case 57: //line parser/lexer.l:250 { - return yy.TokenString(_IDENTIFIER_, string(yytext)); + return yy.TokenString(_IDENTIFIER_WITH_WILDCARD_, string(yytext)); } case 58: @@ -1204,6 +1252,16 @@ case 58: //line parser/lexer.l:255 +{ + return yy.TokenString(_IDENTIFIER_, string(yytext)); +} +case 59: + + yylineno = yy.Lineno + YYtext = string(yytext) + + +//line parser/lexer.l:260 { s := strings.TrimRight(YYtext, "MKB") v, err := strconv.ParseInt(s, 10, 64) @@ -1231,13 +1289,13 @@ case 58: } return yy.TokenInt64(_NUMBER_, v); } -case 59: +case 60: yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:283 +//line parser/lexer.l:288 { v, err := strconv.ParseFloat(YYtext, 64) if err != nil { @@ -1247,13 +1305,13 @@ case 59: } return yy.TokenFloat64(_DOUBLE_, v); } -case 60: +case 61: yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:293 +//line parser/lexer.l:298 { v, err := strconv.ParseInt(YYtext, 0, 64) if err != nil { @@ -1263,13 +1321,13 @@ case 60: } return yy.TokenInt64(_NUMBER_, v); } -case 61: +case 62: yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:303 +//line parser/lexer.l:308 { s := strings.TrimLeft(YYtext, "0o") v, err := strconv.ParseInt(s, 8, 64) @@ -1280,27 +1338,17 @@ case 61: } return yy.TokenInt64(_NUMBER_, v); } -case 62: +case 63: yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:315 +//line parser/lexer.l:320 { /* saw closing quote - all done */ yy.start = 1 + 2* (yyInitial ); return yy.TokenString(_TEXT_STRING_, string(str)); } -case 63: - - yylineno = yy.Lineno - YYtext = string(yytext) - - -//line parser/lexer.l:321 -{ - str = append(str, yytext...) -} case 64: yylineno = yy.Lineno @@ -1362,38 +1410,48 @@ case 69: str = append(str, yytext...) } case 70: -/* rule 70 can match eol */ yylineno = yy.Lineno YYtext = string(yytext) //line parser/lexer.l:356 +{ + str = append(str, yytext...) +} +case 71: +/* rule 71 can match eol */ + + yylineno = yy.Lineno + YYtext = string(yytext) + + +//line parser/lexer.l:361 { return Error( gyperror.UnterminatedStringError, "unterminate string") } -case 71: -/* rule 71 can match eol */ +case 72: +/* rule 72 can match eol */ yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:363 +//line parser/lexer.l:368 { return Error( gyperror.IllegalEscapeSequenceError, "illegal escape sequence") } -case 72: +case 73: yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:370 +//line parser/lexer.l:375 { if err := validateUTF8(string(regexp)); err != nil { return Error(gyperror.InvalidUTF8Error, err.Error()) @@ -1422,79 +1480,79 @@ case 72: Modifiers: mods, }); } -case 73: +case 74: yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:400 +//line parser/lexer.l:405 { regexp = append(regexp, yytext...) } -case 74: +case 75: yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:405 +//line parser/lexer.l:410 { regexp = append(regexp, yytext...) } -case 75: +case 76: yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:410 +//line parser/lexer.l:415 { regexp = append(regexp, yytext...) } -case 76: -/* rule 76 can match eol */ +case 77: +/* rule 77 can match eol */ yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:415 +//line parser/lexer.l:420 { return Error( gyperror.UnterminatedRegexError, "unterminated regexp") } -case 77: +case 78: yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:422 +//line parser/lexer.l:427 { str = []byte{} yy.start = 1 + 2* (STR); } -case 78: +case 79: yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:428 +//line parser/lexer.l:433 { regexp = []byte{} yy.start = 1 + 2* (REGEXP); } -case 79: -/* rule 79 can match eol */ +case 80: +/* rule 80 can match eol */ yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:434 +//line parser/lexer.l:439 { // Match hex-digits with whitespace or comments. The latter are stripped // out by hex_lexer.l @@ -1509,22 +1567,22 @@ case 79: return yy.TokenHexString(hexTokens); } -case 80: -/* rule 80 can match eol */ +case 81: +/* rule 81 can match eol */ yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:450 +//line parser/lexer.l:455 /* skip whitespace */ -case 81: +case 82: yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:452 +//line parser/lexer.l:457 { r := int(yytext[0]) @@ -1537,15 +1595,15 @@ case 81: gyperror.InvalidAsciiError, fmt.Sprintf(`invalid ASCII character "\x%02x"`, r)) } -case 82: +case 83: yylineno = yy.Lineno YYtext = string(yytext) -//line parser/lexer.l:465 +//line parser/lexer.l:470 yyout.Write(yytext) -//line parser/lexer.go:1549 +//line parser/lexer.go:1607 // SKEL ---------------------------------------------------------------- case yyEndOfBuffer: @@ -1792,7 +1850,7 @@ func (yy *Scanner) getPreviousState() int { } for int(yyChk[int(yyBase[yyCurrentState])+yyC]) != yyCurrentState { yyCurrentState = int(yyDef[yyCurrentState]) - if yyCurrentState >= 294 { + if yyCurrentState >= 295 { yyC = int(yyMeta[yyC]) } } @@ -1824,12 +1882,12 @@ func (yy *Scanner) tryNulTrans(yyCurrentState int) int { } for int(yyChk[int(yyBase[yyCurrentState])+yyC]) != yyCurrentState { yyCurrentState = int(yyDef[yyCurrentState]) - if yyCurrentState >= 294 { + if yyCurrentState >= 295 { yyC = int(yyMeta[yyC]) } } yyCurrentState = int(yyNxt[int(yyBase[yyCurrentState])+yyC]) - if yyCurrentState == 293 { + if yyCurrentState == 294 { yyIsJam = true } // SKEL ---------------------------------------------------------------- @@ -2006,7 +2064,7 @@ func YYmain(filenames ...string) (interface{}, error) { } // END OF SKELL -------------------------------------------------------- -//line parser/lexer.l:465 +//line parser/lexer.l:470 diff --git a/parser/lexer.l b/parser/lexer.l index bf78429..4a217c8 100644 --- a/parser/lexer.l +++ b/parser/lexer.l @@ -247,6 +247,11 @@ u?int(8|16|32)(be)? { } +({letter}|_)({letter}|{digit}|_)*"*" { + return yy.TokenString(_IDENTIFIER_WITH_WILDCARD_, string(yytext)); +} + + ({letter}|_)({letter}|{digit}|_)* { return yy.TokenString(_IDENTIFIER_, string(yytext)); } diff --git a/parser/parser.go b/parser/parser.go index 42a618f..5a127c4 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -35,7 +35,7 @@ type stringModifiers struct { Base64Alphabet string } -//line parser/grammar.y:171 +//line parser/grammar.y:175 type yrSymType struct { yys int i64 int64 @@ -59,6 +59,7 @@ type yrSymType struct { si *ast.StringIdentifier sis []*ast.StringIdentifier quantifier *ast.Quantifier + ident *ast.Identifier // lineno is not a symbol type, it's the line number where the symbol // appears in the source file. This is a little hack used for passing @@ -90,57 +91,58 @@ const _META_ = 57351 const _STRINGS_ = 57352 const _CONDITION_ = 57353 const _IDENTIFIER_ = 57354 -const _STRING_IDENTIFIER_ = 57355 -const _STRING_COUNT_ = 57356 -const _STRING_OFFSET_ = 57357 -const _STRING_LENGTH_ = 57358 -const _STRING_IDENTIFIER_WITH_WILDCARD_ = 57359 -const _NUMBER_ = 57360 -const _DOUBLE_ = 57361 -const _INTEGER_FUNCTION_ = 57362 -const _TEXT_STRING_ = 57363 -const _HEX_STRING_ = 57364 -const _REGEXP_ = 57365 -const _ASCII_ = 57366 -const _WIDE_ = 57367 -const _XOR_ = 57368 -const _NOCASE_ = 57369 -const _FULLWORD_ = 57370 -const _BASE64_ = 57371 -const _BASE64WIDE_ = 57372 -const _AT_ = 57373 -const _FILESIZE_ = 57374 -const _ENTRYPOINT_ = 57375 -const _ALL_ = 57376 -const _ANY_ = 57377 -const _NONE_ = 57378 -const _IN_ = 57379 -const _OF_ = 57380 -const _FOR_ = 57381 -const _THEM_ = 57382 -const _MATCHES_ = 57383 -const _CONTAINS_ = 57384 -const _ICONTAINS_ = 57385 -const _STARTSWITH_ = 57386 -const _ISTARTSWITH_ = 57387 -const _ENDSWITH_ = 57388 -const _IENDSWITH_ = 57389 -const _IMPORT_ = 57390 -const _TRUE_ = 57391 -const _FALSE_ = 57392 -const _INCLUDE_ = 57393 -const _OR_ = 57394 -const _AND_ = 57395 -const _EQ_ = 57396 -const _NEQ_ = 57397 -const _LT_ = 57398 -const _LE_ = 57399 -const _GT_ = 57400 -const _GE_ = 57401 -const _SHIFT_LEFT_ = 57402 -const _SHIFT_RIGHT_ = 57403 -const _NOT_ = 57404 -const UNARY_MINUS = 57405 +const _IDENTIFIER_WITH_WILDCARD_ = 57355 +const _STRING_IDENTIFIER_ = 57356 +const _STRING_COUNT_ = 57357 +const _STRING_OFFSET_ = 57358 +const _STRING_LENGTH_ = 57359 +const _STRING_IDENTIFIER_WITH_WILDCARD_ = 57360 +const _NUMBER_ = 57361 +const _DOUBLE_ = 57362 +const _INTEGER_FUNCTION_ = 57363 +const _TEXT_STRING_ = 57364 +const _HEX_STRING_ = 57365 +const _REGEXP_ = 57366 +const _ASCII_ = 57367 +const _WIDE_ = 57368 +const _XOR_ = 57369 +const _NOCASE_ = 57370 +const _FULLWORD_ = 57371 +const _BASE64_ = 57372 +const _BASE64WIDE_ = 57373 +const _AT_ = 57374 +const _FILESIZE_ = 57375 +const _ENTRYPOINT_ = 57376 +const _ALL_ = 57377 +const _ANY_ = 57378 +const _NONE_ = 57379 +const _IN_ = 57380 +const _OF_ = 57381 +const _FOR_ = 57382 +const _THEM_ = 57383 +const _MATCHES_ = 57384 +const _CONTAINS_ = 57385 +const _ICONTAINS_ = 57386 +const _STARTSWITH_ = 57387 +const _ISTARTSWITH_ = 57388 +const _ENDSWITH_ = 57389 +const _IENDSWITH_ = 57390 +const _IMPORT_ = 57391 +const _TRUE_ = 57392 +const _FALSE_ = 57393 +const _INCLUDE_ = 57394 +const _OR_ = 57395 +const _AND_ = 57396 +const _EQ_ = 57397 +const _NEQ_ = 57398 +const _LT_ = 57399 +const _LE_ = 57400 +const _GT_ = 57401 +const _GE_ = 57402 +const _SHIFT_LEFT_ = 57403 +const _SHIFT_RIGHT_ = 57404 +const _NOT_ = 57405 +const UNARY_MINUS = 57406 var yrToknames = [...]string{ "$end", @@ -155,6 +157,7 @@ var yrToknames = [...]string{ "_STRINGS_", "_CONDITION_", "_IDENTIFIER_", + "_IDENTIFIER_WITH_WILDCARD_", "_STRING_IDENTIFIER_", "_STRING_COUNT_", "_STRING_OFFSET_", @@ -233,7 +236,7 @@ const yrEofCode = 1 const yrErrCode = 2 const yrInitialStackSize = 16 -//line parser/grammar.y:1143 +//line parser/grammar.y:1210 // This function takes an operator and two operands and returns a Expression // representing the operation. If the left operand is an operation of the @@ -259,128 +262,130 @@ var yrExca = [...]int{ 1, -1, -2, 15, -1, 52, - 38, 109, - -2, 96, + 39, 117, + -2, 99, -1, 113, - 38, 109, - -2, 96, - -1, 173, - 78, 66, - 82, 66, + 39, 117, + -2, 99, + -1, 176, + 79, 66, + 83, 66, -2, 69, - -1, 217, - 78, 67, - 82, 67, + -1, 230, + 79, 67, + 83, 67, -2, 69, } const yrPrivate = 57344 -const yrLast = 482 +const yrLast = 474 var yrAct = [...]int{ - 52, 189, 49, 153, 67, 161, 232, 215, 185, 197, - 233, 216, 117, 116, 82, 83, 84, 85, 86, 87, - 88, 120, 163, 118, 119, 244, 114, 102, 100, 101, + 52, 197, 196, 49, 67, 154, 162, 163, 246, 228, + 207, 189, 247, 229, 82, 83, 84, 85, 86, 87, + 88, 226, 81, 80, 118, 227, 114, 102, 100, 101, 94, 95, 90, 92, 91, 93, 103, 104, 96, 97, - 98, 99, 89, 70, 238, 81, 80, 81, 80, 74, - 236, 165, 235, 186, 196, 108, 237, 164, 113, 162, - 112, 231, 225, 220, 219, 218, 154, 48, 115, 121, - 122, 243, 42, 241, 38, 222, 214, 40, 28, 26, - 17, 39, 18, 111, 129, 130, 131, 132, 133, 134, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 126, 127, 80, - 160, 98, 99, 159, 211, 75, 166, 167, 168, 110, - 170, 81, 80, 173, 242, 55, 128, 74, 53, 64, - 65, 66, 228, 61, 62, 60, 63, 227, 75, 13, - 8, 183, 96, 97, 98, 99, 159, 58, 59, 71, - 72, 73, 5, 35, 54, 184, 105, 102, 100, 101, - 136, 30, 106, 187, 50, 51, 103, 104, 96, 97, - 98, 99, 159, 103, 104, 96, 97, 98, 99, 159, - 107, 68, 229, 190, 195, 56, 69, 191, 41, 212, - 209, 37, 57, 100, 101, 79, 7, 36, 213, 4, - 217, 103, 104, 96, 97, 98, 99, 159, 221, 76, - 78, 77, 224, 169, 31, 23, 20, 74, 226, 64, - 65, 66, 14, 61, 62, 60, 63, 33, 75, 25, - 9, 11, 12, 182, 240, 101, 22, 58, 59, 71, - 72, 73, 103, 104, 96, 97, 98, 99, 159, 155, - 123, 27, 234, 102, 100, 101, 15, 1, 239, 158, - 188, 156, 103, 104, 96, 97, 98, 99, 159, 210, - 208, 68, 223, 171, 172, 32, 69, 102, 100, 101, - 194, 6, 109, 10, 125, 157, 103, 104, 96, 97, - 98, 99, 159, 181, 74, 124, 64, 65, 66, 175, - 61, 62, 60, 63, 193, 75, 174, 198, 34, 24, - 21, 29, 19, 16, 58, 59, 102, 100, 101, 44, - 135, 2, 43, 3, 0, 103, 104, 96, 97, 98, - 99, 159, 0, 0, 0, 74, 0, 64, 65, 66, - 230, 61, 62, 60, 63, 0, 75, 0, 68, 0, - 46, 47, 0, 69, 0, 58, 59, 0, 0, 109, - 82, 83, 84, 85, 86, 87, 88, 45, 0, 0, - 0, 0, 0, 102, 100, 101, 94, 95, 90, 92, + 98, 99, 89, 121, 117, 119, 120, 70, 257, 81, + 80, 167, 252, 258, 250, 108, 190, 249, 113, 206, + 166, 112, 245, 42, 251, 238, 233, 48, 232, 122, + 123, 74, 165, 231, 165, 255, 155, 115, 38, 235, + 224, 40, 28, 111, 130, 131, 132, 133, 134, 135, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 127, 128, 192, + 161, 164, 26, 17, 39, 18, 168, 80, 170, 171, + 55, 173, 169, 110, 74, 176, 53, 64, 65, 66, + 129, 61, 62, 60, 63, 75, 75, 221, 96, 97, + 98, 99, 160, 186, 187, 58, 59, 71, 72, 73, + 81, 80, 54, 98, 99, 160, 188, 193, 102, 100, + 101, 137, 50, 51, 5, 191, 116, 103, 104, 96, + 97, 98, 99, 160, 105, 107, 156, 30, 242, 68, + 106, 241, 35, 56, 69, 205, 159, 76, 78, 77, + 57, 102, 100, 101, 219, 222, 256, 13, 8, 225, + 103, 104, 96, 97, 98, 99, 160, 37, 243, 7, + 79, 230, 4, 158, 183, 244, 74, 41, 234, 64, + 65, 66, 237, 61, 62, 60, 63, 36, 75, 223, + 239, 240, 180, 179, 33, 181, 182, 58, 59, 71, + 72, 73, 102, 100, 101, 198, 200, 201, 254, 199, + 172, 103, 104, 96, 97, 98, 99, 160, 103, 104, + 96, 97, 98, 99, 160, 248, 31, 23, 20, 204, + 14, 68, 253, 25, 22, 185, 69, 102, 100, 101, + 124, 27, 109, 9, 11, 12, 103, 104, 96, 97, + 98, 99, 160, 74, 15, 1, 64, 65, 66, 101, + 61, 62, 60, 63, 203, 75, 103, 104, 96, 97, + 98, 99, 160, 195, 58, 59, 102, 100, 101, 44, + 136, 194, 43, 157, 220, 103, 104, 96, 97, 98, + 99, 160, 218, 236, 74, 174, 175, 64, 65, 66, + 202, 61, 62, 60, 63, 32, 75, 6, 68, 10, + 46, 47, 126, 69, 184, 58, 59, 125, 178, 109, + 82, 83, 84, 85, 86, 87, 88, 45, 177, 208, + 217, 34, 24, 102, 100, 101, 94, 95, 90, 92, 91, 93, 103, 104, 96, 97, 98, 99, 89, 68, - 207, 0, 0, 0, 69, 102, 100, 101, 0, 0, - 109, 0, 0, 0, 103, 104, 96, 97, 98, 99, - 159, 102, 100, 101, 0, 0, 180, 0, 0, 192, - 103, 104, 96, 97, 98, 99, 159, 0, 0, 0, - 0, 0, 0, 177, 176, 165, 178, 179, 0, 102, - 100, 101, 0, 0, 0, 0, 0, 0, 103, 104, - 96, 97, 98, 99, 159, 102, 100, 101, 203, 0, - 0, 0, 0, 0, 103, 104, 96, 97, 98, 99, - 159, 0, 0, 0, 0, 200, 199, 206, 201, 202, - 204, 205, + 21, 29, 19, 213, 69, 102, 100, 101, 16, 2, + 109, 3, 0, 0, 103, 104, 96, 97, 98, 99, + 160, 210, 209, 216, 211, 212, 214, 215, 0, 167, + 102, 100, 101, 0, 0, 0, 0, 0, 0, 103, + 104, 96, 97, 98, 99, 160, 102, 100, 101, 0, + 0, 0, 0, 0, 0, 103, 104, 96, 97, 98, + 99, 160, 100, 101, 0, 0, 0, 0, 0, 0, + 103, 104, 96, 97, 98, 99, 160, 200, 201, 198, + 0, 0, 0, 199, } var yrPact = [...]int{ - -1000, 148, -1000, -1000, 119, -1000, 224, 118, -1000, 210, - -1000, -1000, -1000, -1000, -1000, 5, 9, 204, 227, 203, - -1000, 219, 4, -1000, -1000, 3, 202, 216, 184, 202, - -1000, -2, 7, 2, 184, -1000, -4, -1000, 301, -1000, - 115, -1000, 188, -1000, -1000, 177, -1000, -1000, 69, -1000, - -1000, -1000, 319, 125, 205, 81, 115, 115, -1000, -1000, - -9, -1000, -1000, -1000, -1000, -67, -68, -56, 323, 323, + -1000, 160, -1000, -1000, 176, -1000, 277, 175, -1000, 258, + -1000, -1000, -1000, -1000, -1000, 37, 41, 256, 265, 255, + -1000, 263, 36, -1000, -1000, 6, 254, 223, 213, 254, + -1000, 1, 39, 5, 213, -1000, -14, -1000, 300, -1000, + 112, -1000, 165, -1000, -1000, 191, -1000, -1000, 97, -1000, + -1000, -1000, 318, 142, 204, 84, 112, 112, -1000, -1000, + -1, -1000, -1000, -1000, 128, -37, -57, -35, 322, 322, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - 115, 115, 92, 323, 323, 323, 323, 323, 323, 282, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, -11, 247, 401, 323, - -18, -1000, -21, -27, 69, 323, 323, 323, 201, 323, - 115, -1000, -1000, -1000, 409, 226, -1000, 56, -1000, 401, - 401, 401, 401, 401, 401, -18, -1000, 401, 401, 401, - 401, 401, 401, 44, 44, -1000, -1000, 179, 110, 138, - 77, 77, 401, -1000, 323, -1000, -29, -18, -1000, 323, - 357, -1000, 170, -1000, -1000, -1000, 341, 223, 199, -1000, - 103, -24, -73, -1000, 451, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, 385, 37, 186, 1, -71, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, 115, -1000, -1000, - -1000, -1000, -1000, -1000, -12, -13, -14, 323, 0, -56, - -1000, 323, -1000, -1000, -15, -1000, 170, -1000, 116, 111, - 164, 262, -16, -72, 385, 115, -1000, -26, -28, -22, - -1000, 115, -1000, 323, -5, -1000, -1000, -1000, 106, -7, - 401, -1000, -53, -1000, -1000, + 112, 112, 111, 322, 322, 322, 322, 322, 322, 281, + 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, -2, 174, 381, 322, + 33, -1000, -19, -28, 97, 322, -2, 322, 322, 238, + 322, 112, -1000, -1000, -1000, 207, 268, -1000, 63, -1000, + 381, 381, 381, 381, 381, 381, 33, -1000, 381, 381, + 381, 381, 381, 381, 85, 85, -1000, -1000, 242, 194, + 396, 72, 72, 381, -1000, 322, -1000, -27, 31, -1000, + 322, 340, 119, -1000, 455, -1000, -1000, -1000, 261, -1000, + 222, 187, -1000, 103, -20, -73, -1000, 386, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 365, 59, + 217, 4, 231, -2, -58, -70, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, 112, -1000, -1000, + -1000, -1000, -1000, -1000, -5, -10, -12, 322, 3, -35, + -1000, 322, -1000, -1000, -13, -1000, -1000, 231, -1000, 234, + -1000, 159, 156, 189, 136, -16, -71, 365, 112, -1000, + -1000, -22, -25, -15, -1000, 112, -1000, 322, -4, -1000, + -1000, -1000, 177, -31, 381, -1000, -26, -1000, -1000, } var yrPgo = [...]int{ - 0, 323, 321, 313, 312, 161, 311, 310, 309, 153, - 308, 307, 306, 299, 295, 293, 284, 283, 281, 275, - 2, 26, 0, 4, 274, 273, 125, 272, 270, 269, - 5, 43, 3, 261, 260, 1, 257, 256, 251, 250, + 0, 401, 399, 398, 392, 177, 391, 390, 372, 182, + 371, 369, 368, 358, 357, 354, 352, 349, 347, 345, + 3, 26, 0, 4, 336, 335, 120, 333, 332, 324, + 6, 47, 5, 323, 321, 2, 7, 313, 1, 295, + 294, 281, 280, } var yrR1 = [...]int{ - 0, 36, 36, 36, 36, 36, 1, 37, 38, 2, + 0, 39, 39, 39, 39, 39, 1, 40, 41, 2, 7, 7, 8, 8, 19, 18, 18, 17, 17, 3, 3, 4, 4, 6, 6, 5, 5, 5, 5, 5, - 10, 10, 39, 9, 9, 9, 12, 12, 11, 11, + 10, 10, 42, 9, 9, 9, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 14, 14, 13, 13, 13, 13, 13, 16, 16, 15, 23, 23, 23, 23, 25, 25, 24, 24, 31, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 29, 29, - 32, 27, 27, 30, 30, 34, 34, 35, 35, 26, - 26, 26, 26, 33, 33, 28, 28, 22, 22, 22, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 29, 29, 32, 27, 27, 30, 30, 34, 34, + 35, 35, 36, 37, 37, 38, 38, 26, 26, 26, + 26, 33, 33, 28, 28, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, + 22, 22, } var yrR2 = [...]int{ @@ -392,41 +397,43 @@ var yrR2 = [...]int{ 0, 2, 1, 1, 1, 1, 1, 0, 2, 1, 1, 3, 4, 4, 0, 1, 1, 3, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 1, - 3, 3, 3, 9, 8, 3, 4, 2, 3, 3, - 3, 3, 3, 3, 3, 3, 1, 3, 3, 1, - 5, 1, 3, 3, 1, 1, 3, 1, 1, 1, - 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, - 4, 1, 1, 1, 1, 4, 1, 4, 1, 1, - 2, 3, 3, 3, 3, 3, 3, 3, 3, 2, - 3, 3, 1, + 3, 3, 3, 9, 8, 5, 3, 3, 4, 4, + 2, 3, 3, 3, 3, 3, 3, 3, 3, 1, + 3, 3, 1, 5, 1, 3, 3, 1, 1, 3, + 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 3, 1, 1, 3, 1, 1, 4, 1, + 1, 1, 3, 1, 4, 1, 4, 1, 1, 2, + 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, + 3, 1, } var yrChk = [...]int{ - -1000, -36, -2, -1, 51, 4, -18, 48, 21, 6, - -17, 7, 8, 21, 12, -37, -3, 75, 73, -4, - 12, -7, 9, 12, -8, 10, 75, -38, 75, -6, - -5, 12, -19, 11, -10, -9, 13, -5, 76, 74, - 75, -9, 76, 21, 18, 66, 49, 50, -21, -20, - 49, 50, -22, 13, 39, -26, 70, 77, 32, 33, - 20, 18, 19, 21, 14, 15, 16, -23, 66, 71, - -31, 34, 35, 36, 12, 23, 21, 23, 22, 18, - 53, 52, 41, 42, 43, 44, 45, 46, 47, 69, - 59, 61, 60, 62, 57, 58, 65, 66, 67, 68, - 55, 56, 54, 63, 64, 31, 37, -26, -22, 77, - 38, -21, -20, -22, -21, 77, 80, 80, 79, 80, - 77, -22, -22, -39, -14, -16, -21, -21, -31, -22, - -22, -22, -22, -22, -22, 38, -22, -22, -22, -22, + -1000, -39, -2, -1, 52, 4, -18, 49, 22, 6, + -17, 7, 8, 22, 12, -40, -3, 76, 74, -4, + 12, -7, 9, 12, -8, 10, 76, -41, 76, -6, + -5, 12, -19, 11, -10, -9, 14, -5, 77, 75, + 76, -9, 77, 22, 19, 67, 50, 51, -21, -20, + 50, 51, -22, 14, 40, -26, 71, 78, 33, 34, + 21, 19, 20, 22, 15, 16, 17, -23, 67, 72, + -31, 35, 36, 37, 12, 24, 22, 24, 23, 19, + 54, 53, 42, 43, 44, 45, 46, 47, 48, 70, + 60, 62, 61, 63, 58, 59, 66, 67, 68, 69, + 56, 57, 55, 64, 65, 32, 38, -26, -22, 78, + 39, -21, -20, -22, -21, 78, 38, 81, 81, 80, + 81, 78, -22, -22, -42, -14, -16, -21, -21, -31, + -22, -22, -22, -22, -22, -22, 39, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -32, 77, 2, -33, 38, 12, 69, - -22, -30, 77, 40, 78, 78, -22, -22, -22, 12, - -22, -25, -24, -20, -12, -13, 25, 24, 27, 28, - 7, -15, 7, -30, -22, 37, 82, -30, -34, -35, - 13, 17, 78, 81, 81, 81, 78, 82, -11, 25, - 24, 27, 28, 7, 29, 30, 26, 5, -28, -23, - -29, 77, -32, 12, 75, 78, 82, -20, 77, 77, - 77, -22, 75, -27, -22, 77, -35, 21, 21, 18, - 78, 77, 78, 82, -21, 78, 78, 78, 66, -21, - -22, 78, 18, 78, 78, + -22, -22, -22, -22, -32, 78, 2, -33, 39, 12, + 70, -22, -30, -36, 78, 41, 79, 79, -22, -32, + -22, -22, 12, -22, -25, -24, -20, -12, -13, 26, + 25, 28, 29, 7, -15, 7, -30, -36, -22, 38, + 83, -30, 78, 38, -34, -37, -35, -38, 14, 18, + 12, 13, 79, 82, 82, 82, 79, 83, -11, 26, + 25, 28, 29, 7, 30, 31, 27, 5, -28, -23, + -29, 78, -32, 12, 76, -32, 79, 83, 79, 83, + -20, 78, 78, 78, -22, 76, -27, -22, 78, -35, + -38, 22, 22, 19, 79, 78, 79, 83, -21, 79, + 79, 79, 67, -21, -22, 79, 19, 79, 79, } var yrDef = [...]int{ @@ -435,42 +442,43 @@ var yrDef = [...]int{ 21, 12, 0, 22, 8, 0, 0, 0, 0, 11, 23, 0, 0, 0, 13, 30, 0, 24, 0, 9, 0, 31, 0, 25, 26, 0, 28, 29, 14, 69, - 70, 71, -2, 79, 0, 0, 0, 0, 118, 119, - 0, 121, 122, 123, 124, 126, 128, 129, 0, 0, - 142, 110, 111, 112, 60, 68, 32, 50, 57, 27, + 70, 71, -2, 79, 0, 0, 0, 0, 126, 127, + 0, 129, 130, 131, 133, 135, 137, 138, 0, 0, + 151, 118, 119, 120, 60, 68, 32, 50, 57, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 109, 0, - 0, 87, 69, -2, 0, 0, 0, 0, 0, 0, - 64, 130, 139, 36, 34, 35, 88, 89, 72, 73, - 74, 75, 76, 77, 78, 0, 135, 90, 91, 92, - 93, 94, 95, 131, 132, 133, 134, 136, 137, 138, - 140, 141, 80, 81, 0, 82, 0, 0, 113, 0, - 0, 85, 0, 104, 97, 117, 0, 0, 0, 61, - 0, 0, 65, -2, 33, 51, 52, 53, 54, 55, - 56, 58, 59, 86, 0, 0, 0, 0, 0, 105, - 107, 108, 120, 125, 127, 62, 63, 0, 37, 38, - 39, 40, 41, 42, 43, 44, 47, 0, 0, 115, - 116, 0, 99, 114, 0, 103, 0, -2, 0, 0, - 0, 0, 0, 0, 101, 0, 106, 0, 0, 0, - 100, 0, 98, 0, 0, 45, 46, 48, 0, 0, - 102, 84, 0, 83, 49, + 0, 0, 0, 0, 0, 0, 0, 0, 117, 0, + 0, 90, 69, -2, 0, 0, 0, 0, 0, 0, + 0, 64, 139, 148, 36, 34, 35, 91, 92, 72, + 73, 74, 75, 76, 77, 78, 0, 144, 93, 94, + 95, 96, 97, 98, 140, 141, 142, 143, 145, 146, + 147, 149, 150, 80, 81, 0, 82, 0, 0, 121, + 0, 0, 86, 87, 0, 107, 100, 125, 0, 132, + 0, 0, 61, 0, 0, 65, -2, 33, 51, 52, + 53, 54, 55, 56, 58, 59, 88, 89, 0, 0, + 0, 0, 0, 0, 0, 0, 108, 113, 110, 111, + 115, 116, 128, 134, 136, 62, 63, 0, 37, 38, + 39, 40, 41, 42, 43, 44, 47, 0, 0, 123, + 124, 0, 102, 122, 0, 85, 106, 0, 112, 0, + -2, 0, 0, 0, 0, 0, 0, 104, 0, 109, + 114, 0, 0, 0, 103, 0, 101, 0, 0, 45, + 46, 48, 0, 0, 105, 84, 0, 83, 49, } var yrTok1 = [...]int{ 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 69, 56, 3, - 77, 78, 67, 65, 82, 66, 79, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 75, 3, - 3, 76, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 70, 57, 3, + 78, 79, 68, 66, 83, 67, 80, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 76, 3, + 3, 77, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 80, 68, 81, 55, 3, 3, 3, 3, 3, + 3, 81, 69, 82, 56, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 73, 54, 74, 71, + 3, 3, 3, 74, 55, 75, 72, } var yrTok2 = [...]int{ @@ -479,8 +487,8 @@ var yrTok2 = [...]int{ 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 57, 58, 59, 60, 61, 62, 63, 64, - 70, 72, + 52, 53, 54, 58, 59, 60, 61, 62, 63, 64, + 65, 71, 73, } var yrTok3 = [...]int{ @@ -826,34 +834,34 @@ yrdefault: case 2: yrDollar = yrS[yrpt-2 : yrpt+1] -//line parser/grammar.y:221 +//line parser/grammar.y:226 { ruleSet := asLexer(yrlex).ruleSet ruleSet.Rules = append(ruleSet.Rules, yrDollar[2].rule) } case 3: yrDollar = yrS[yrpt-2 : yrpt+1] -//line parser/grammar.y:226 +//line parser/grammar.y:231 { ruleSet := asLexer(yrlex).ruleSet ruleSet.Imports = append(ruleSet.Imports, yrDollar[2].s) } case 4: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:231 +//line parser/grammar.y:236 { ruleSet := asLexer(yrlex).ruleSet ruleSet.Includes = append(ruleSet.Includes, yrDollar[3].s) } case 5: yrDollar = yrS[yrpt-2 : yrpt+1] -//line parser/grammar.y:236 +//line parser/grammar.y:241 { } case 6: yrDollar = yrS[yrpt-2 : yrpt+1] -//line parser/grammar.y:244 +//line parser/grammar.y:249 { if err := validateAscii(yrDollar[2].s); err != nil { return asLexer(yrlex).setError( @@ -864,7 +872,7 @@ yrdefault: } case 7: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:257 +//line parser/grammar.y:262 { lexer := asLexer(yrlex) @@ -885,7 +893,7 @@ yrdefault: } case 8: yrDollar = yrS[yrpt-8 : yrpt+1] -//line parser/grammar.y:276 +//line parser/grammar.y:281 { yrDollar[4].rule.Tags = yrDollar[5].ss yrDollar[4].rule.Meta = yrDollar[7].metas @@ -893,86 +901,86 @@ yrdefault: } case 9: yrDollar = yrS[yrpt-11 : yrpt+1] -//line parser/grammar.y:282 +//line parser/grammar.y:287 { yrDollar[4].rule.Condition = yrDollar[10].expr yrVAL.rule = yrDollar[4].rule } case 10: yrDollar = yrS[yrpt-0 : yrpt+1] -//line parser/grammar.y:291 +//line parser/grammar.y:296 { yrVAL.metas = []*ast.Meta{} } case 11: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:295 +//line parser/grammar.y:300 { yrVAL.metas = yrDollar[3].metas } case 12: yrDollar = yrS[yrpt-0 : yrpt+1] -//line parser/grammar.y:303 +//line parser/grammar.y:308 { yrVAL.yss = []ast.String{} } case 13: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:307 +//line parser/grammar.y:312 { yrVAL.yss = yrDollar[3].yss } case 14: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:315 +//line parser/grammar.y:320 { yrVAL.expr = yrDollar[3].expr } case 15: yrDollar = yrS[yrpt-0 : yrpt+1] -//line parser/grammar.y:323 +//line parser/grammar.y:328 { yrVAL.mod = 0 } case 16: yrDollar = yrS[yrpt-2 : yrpt+1] -//line parser/grammar.y:327 +//line parser/grammar.y:332 { yrVAL.mod = yrDollar[1].mod | yrDollar[2].mod } case 17: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:335 +//line parser/grammar.y:340 { yrVAL.mod = ModPrivate } case 18: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:339 +//line parser/grammar.y:344 { yrVAL.mod = ModGlobal } case 19: yrDollar = yrS[yrpt-0 : yrpt+1] -//line parser/grammar.y:347 +//line parser/grammar.y:352 { yrVAL.ss = []string{} } case 20: yrDollar = yrS[yrpt-2 : yrpt+1] -//line parser/grammar.y:351 +//line parser/grammar.y:356 { yrVAL.ss = yrDollar[2].ss } case 21: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:359 +//line parser/grammar.y:364 { yrVAL.ss = []string{yrDollar[1].s} } case 22: yrDollar = yrS[yrpt-2 : yrpt+1] -//line parser/grammar.y:363 +//line parser/grammar.y:368 { lexer := asLexer(yrlex) @@ -987,19 +995,19 @@ yrdefault: } case 23: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:380 +//line parser/grammar.y:385 { yrVAL.metas = []*ast.Meta{yrDollar[1].meta} } case 24: yrDollar = yrS[yrpt-2 : yrpt+1] -//line parser/grammar.y:384 +//line parser/grammar.y:389 { yrVAL.metas = append(yrDollar[1].metas, yrDollar[2].meta) } case 25: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:392 +//line parser/grammar.y:397 { yrVAL.meta = &ast.Meta{ Key: yrDollar[1].s, @@ -1008,7 +1016,7 @@ yrdefault: } case 26: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:399 +//line parser/grammar.y:404 { yrVAL.meta = &ast.Meta{ Key: yrDollar[1].s, @@ -1017,7 +1025,7 @@ yrdefault: } case 27: yrDollar = yrS[yrpt-4 : yrpt+1] -//line parser/grammar.y:406 +//line parser/grammar.y:411 { yrVAL.meta = &ast.Meta{ Key: yrDollar[1].s, @@ -1026,7 +1034,7 @@ yrdefault: } case 28: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:413 +//line parser/grammar.y:418 { yrVAL.meta = &ast.Meta{ Key: yrDollar[1].s, @@ -1035,7 +1043,7 @@ yrdefault: } case 29: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:420 +//line parser/grammar.y:425 { yrVAL.meta = &ast.Meta{ Key: yrDollar[1].s, @@ -1044,19 +1052,19 @@ yrdefault: } case 30: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:431 +//line parser/grammar.y:436 { yrVAL.yss = []ast.String{yrDollar[1].ys} } case 31: yrDollar = yrS[yrpt-2 : yrpt+1] -//line parser/grammar.y:435 +//line parser/grammar.y:440 { yrVAL.yss = append(yrDollar[1].yss, yrDollar[2].ys) } case 32: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:443 +//line parser/grammar.y:448 { if err := validateUTF8(yrDollar[3].s); err != nil { return asLexer(yrlex).setError( @@ -1065,7 +1073,7 @@ yrdefault: } case 33: yrDollar = yrS[yrpt-5 : yrpt+1] -//line parser/grammar.y:450 +//line parser/grammar.y:455 { yrVAL.ys = &ast.TextString{ BaseString: ast.BaseString{ @@ -1088,7 +1096,7 @@ yrdefault: } case 34: yrDollar = yrS[yrpt-4 : yrpt+1] -//line parser/grammar.y:471 +//line parser/grammar.y:476 { yrVAL.ys = &ast.RegexpString{ BaseString: ast.BaseString{ @@ -1105,7 +1113,7 @@ yrdefault: } case 35: yrDollar = yrS[yrpt-4 : yrpt+1] -//line parser/grammar.y:486 +//line parser/grammar.y:491 { yrVAL.ys = &ast.HexString{ BaseString: ast.BaseString{ @@ -1118,13 +1126,13 @@ yrdefault: } case 36: yrDollar = yrS[yrpt-0 : yrpt+1] -//line parser/grammar.y:501 +//line parser/grammar.y:506 { yrVAL.smod = stringModifiers{} } case 37: yrDollar = yrS[yrpt-2 : yrpt+1] -//line parser/grammar.y:505 +//line parser/grammar.y:510 { if yrDollar[1].smod.modifiers&yrDollar[2].smod.modifiers != 0 { return asLexer(yrlex).setError( @@ -1146,49 +1154,49 @@ yrdefault: } case 38: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:528 +//line parser/grammar.y:533 { yrVAL.smod = stringModifiers{modifiers: ModWide} } case 39: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:529 +//line parser/grammar.y:534 { yrVAL.smod = stringModifiers{modifiers: ModASCII} } case 40: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:530 +//line parser/grammar.y:535 { yrVAL.smod = stringModifiers{modifiers: ModNocase} } case 41: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:531 +//line parser/grammar.y:536 { yrVAL.smod = stringModifiers{modifiers: ModFullword} } case 42: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:532 +//line parser/grammar.y:537 { yrVAL.smod = stringModifiers{modifiers: ModPrivate} } case 43: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:533 +//line parser/grammar.y:538 { yrVAL.smod = stringModifiers{modifiers: ModBase64} } case 44: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:534 +//line parser/grammar.y:539 { yrVAL.smod = stringModifiers{modifiers: ModBase64Wide} } case 45: yrDollar = yrS[yrpt-4 : yrpt+1] -//line parser/grammar.y:536 +//line parser/grammar.y:541 { if err := validateAscii(yrDollar[3].s); err != nil { return asLexer(yrlex).setError( @@ -1208,7 +1216,7 @@ yrdefault: } case 46: yrDollar = yrS[yrpt-4 : yrpt+1] -//line parser/grammar.y:554 +//line parser/grammar.y:559 { if err := validateAscii(yrDollar[3].s); err != nil { return asLexer(yrlex).setError( @@ -1228,7 +1236,7 @@ yrdefault: } case 47: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:572 +//line parser/grammar.y:577 { yrVAL.smod = stringModifiers{ modifiers: ModXor, @@ -1238,7 +1246,7 @@ yrdefault: } case 48: yrDollar = yrS[yrpt-4 : yrpt+1] -//line parser/grammar.y:580 +//line parser/grammar.y:585 { yrVAL.smod = stringModifiers{ modifiers: ModXor, @@ -1248,7 +1256,7 @@ yrdefault: } case 49: yrDollar = yrS[yrpt-6 : yrpt+1] -//line parser/grammar.y:588 +//line parser/grammar.y:593 { lexer := asLexer(yrlex) @@ -1278,73 +1286,73 @@ yrdefault: } case 50: yrDollar = yrS[yrpt-0 : yrpt+1] -//line parser/grammar.y:620 +//line parser/grammar.y:625 { yrVAL.mod = 0 } case 51: yrDollar = yrS[yrpt-2 : yrpt+1] -//line parser/grammar.y:624 +//line parser/grammar.y:629 { yrVAL.mod = yrDollar[1].mod | yrDollar[2].mod } case 52: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:631 +//line parser/grammar.y:636 { yrVAL.mod = ModWide } case 53: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:632 +//line parser/grammar.y:637 { yrVAL.mod = ModASCII } case 54: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:633 +//line parser/grammar.y:638 { yrVAL.mod = ModNocase } case 55: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:634 +//line parser/grammar.y:639 { yrVAL.mod = ModFullword } case 56: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:635 +//line parser/grammar.y:640 { yrVAL.mod = ModPrivate } case 57: yrDollar = yrS[yrpt-0 : yrpt+1] -//line parser/grammar.y:641 +//line parser/grammar.y:646 { yrVAL.mod = 0 } case 58: yrDollar = yrS[yrpt-2 : yrpt+1] -//line parser/grammar.y:645 +//line parser/grammar.y:650 { yrVAL.mod = yrDollar[1].mod | yrDollar[2].mod } case 59: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:652 +//line parser/grammar.y:657 { yrVAL.mod = ModPrivate } case 60: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:658 +//line parser/grammar.y:663 { yrVAL.expr = &ast.Identifier{Identifier: yrDollar[1].s} } case 61: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:662 +//line parser/grammar.y:667 { yrVAL.expr = &ast.MemberAccess{ Container: yrDollar[1].expr, @@ -1353,7 +1361,7 @@ yrdefault: } case 62: yrDollar = yrS[yrpt-4 : yrpt+1] -//line parser/grammar.y:669 +//line parser/grammar.y:674 { yrVAL.expr = &ast.Subscripting{ Array: yrDollar[1].expr, @@ -1362,7 +1370,7 @@ yrdefault: } case 63: yrDollar = yrS[yrpt-4 : yrpt+1] -//line parser/grammar.y:676 +//line parser/grammar.y:681 { yrVAL.expr = &ast.FunctionCall{ Callable: yrDollar[1].expr, @@ -1371,55 +1379,55 @@ yrdefault: } case 64: yrDollar = yrS[yrpt-0 : yrpt+1] -//line parser/grammar.y:687 +//line parser/grammar.y:692 { yrVAL.exprs = []ast.Expression{} } case 65: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:691 +//line parser/grammar.y:696 { yrVAL.exprs = yrDollar[1].exprs } case 66: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:698 +//line parser/grammar.y:703 { yrVAL.exprs = []ast.Expression{yrDollar[1].expr} } case 67: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:702 +//line parser/grammar.y:707 { yrVAL.exprs = append(yrDollar[1].exprs, yrDollar[3].expr) } case 68: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:710 +//line parser/grammar.y:715 { yrVAL.reg = yrDollar[1].reg } case 69: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:718 +//line parser/grammar.y:723 { yrVAL.expr = yrDollar[1].expr } case 70: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:726 +//line parser/grammar.y:731 { yrVAL.expr = ast.KeywordTrue } case 71: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:730 +//line parser/grammar.y:735 { yrVAL.expr = ast.KeywordFalse } case 72: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:734 +//line parser/grammar.y:739 { yrVAL.expr = &ast.Operation{ Operator: ast.OpMatches, @@ -1428,7 +1436,7 @@ yrdefault: } case 73: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:741 +//line parser/grammar.y:746 { yrVAL.expr = &ast.Operation{ Operator: ast.OpContains, @@ -1437,7 +1445,7 @@ yrdefault: } case 74: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:748 +//line parser/grammar.y:753 { yrVAL.expr = &ast.Operation{ Operator: ast.OpIContains, @@ -1446,7 +1454,7 @@ yrdefault: } case 75: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:755 +//line parser/grammar.y:760 { yrVAL.expr = &ast.Operation{ Operator: ast.OpStartsWith, @@ -1455,7 +1463,7 @@ yrdefault: } case 76: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:762 +//line parser/grammar.y:767 { yrVAL.expr = &ast.Operation{ Operator: ast.OpIStartsWith, @@ -1464,7 +1472,7 @@ yrdefault: } case 77: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:769 +//line parser/grammar.y:774 { yrVAL.expr = &ast.Operation{ Operator: ast.OpEndsWith, @@ -1473,7 +1481,7 @@ yrdefault: } case 78: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:776 +//line parser/grammar.y:781 { yrVAL.expr = &ast.Operation{ Operator: ast.OpIEndsWith, @@ -1482,7 +1490,7 @@ yrdefault: } case 79: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:783 +//line parser/grammar.y:788 { yrVAL.expr = &ast.StringIdentifier{ Identifier: strings.TrimPrefix(yrDollar[1].s, "$"), @@ -1490,7 +1498,7 @@ yrdefault: } case 80: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:789 +//line parser/grammar.y:794 { yrVAL.expr = &ast.StringIdentifier{ Identifier: strings.TrimPrefix(yrDollar[1].s, "$"), @@ -1499,7 +1507,7 @@ yrdefault: } case 81: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:796 +//line parser/grammar.y:801 { yrVAL.expr = &ast.StringIdentifier{ Identifier: strings.TrimPrefix(yrDollar[1].s, "$"), @@ -1508,12 +1516,12 @@ yrdefault: } case 82: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:802 +//line parser/grammar.y:807 { } case 83: yrDollar = yrS[yrpt-9 : yrpt+1] -//line parser/grammar.y:804 +//line parser/grammar.y:809 { yrVAL.expr = &ast.ForIn{ Quantifier: yrDollar[2].quantifier, @@ -1524,7 +1532,7 @@ yrdefault: } case 84: yrDollar = yrS[yrpt-8 : yrpt+1] -//line parser/grammar.y:813 +//line parser/grammar.y:818 { yrVAL.expr = &ast.ForOf{ Quantifier: yrDollar[2].quantifier, @@ -1533,270 +1541,328 @@ yrdefault: } } case 85: - yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:821 + yrDollar = yrS[yrpt-5 : yrpt+1] +//line parser/grammar.y:826 { yrVAL.expr = &ast.Of{ Quantifier: yrDollar[1].quantifier, Strings: yrDollar[3].node, + In: yrDollar[5].rng, } } case 86: + yrDollar = yrS[yrpt-3 : yrpt+1] +//line parser/grammar.y:834 + { + yrVAL.expr = &ast.Of{ + Quantifier: yrDollar[1].quantifier, + Strings: yrDollar[3].node, + } + } + case 87: + yrDollar = yrS[yrpt-3 : yrpt+1] +//line parser/grammar.y:841 + { + yrVAL.expr = &ast.Of{ + Quantifier: yrDollar[1].quantifier, + Rules: yrDollar[3].node, + } + } + case 88: yrDollar = yrS[yrpt-4 : yrpt+1] -//line parser/grammar.y:828 +//line parser/grammar.y:848 { yrVAL.expr = &ast.Of{ Quantifier: &ast.Quantifier{&ast.Percentage{yrDollar[1].expr}}, Strings: yrDollar[4].node, } } - case 87: + case 89: + yrDollar = yrS[yrpt-4 : yrpt+1] +//line parser/grammar.y:855 + { + yrVAL.expr = &ast.Of{ + Quantifier: &ast.Quantifier{&ast.Percentage{yrDollar[1].expr}}, + Rules: yrDollar[4].node, + } + } + case 90: yrDollar = yrS[yrpt-2 : yrpt+1] -//line parser/grammar.y:835 +//line parser/grammar.y:862 { yrVAL.expr = &ast.Not{yrDollar[2].expr} } - case 88: + case 91: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:839 +//line parser/grammar.y:866 { yrVAL.expr = operation(ast.OpAnd, yrDollar[1].expr, yrDollar[3].expr) } - case 89: + case 92: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:843 +//line parser/grammar.y:870 { yrVAL.expr = operation(ast.OpOr, yrDollar[1].expr, yrDollar[3].expr) } - case 90: + case 93: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:847 +//line parser/grammar.y:874 { yrVAL.expr = &ast.Operation{ Operator: ast.OpLessThan, Operands: []ast.Expression{yrDollar[1].expr, yrDollar[3].expr}, } } - case 91: + case 94: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:854 +//line parser/grammar.y:881 { yrVAL.expr = &ast.Operation{ Operator: ast.OpGreaterThan, Operands: []ast.Expression{yrDollar[1].expr, yrDollar[3].expr}, } } - case 92: + case 95: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:861 +//line parser/grammar.y:888 { yrVAL.expr = &ast.Operation{ Operator: ast.OpLessOrEqual, Operands: []ast.Expression{yrDollar[1].expr, yrDollar[3].expr}, } } - case 93: + case 96: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:868 +//line parser/grammar.y:895 { yrVAL.expr = &ast.Operation{ Operator: ast.OpGreaterOrEqual, Operands: []ast.Expression{yrDollar[1].expr, yrDollar[3].expr}, } } - case 94: + case 97: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:875 +//line parser/grammar.y:902 { yrVAL.expr = &ast.Operation{ Operator: ast.OpEqual, Operands: []ast.Expression{yrDollar[1].expr, yrDollar[3].expr}, } } - case 95: + case 98: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:882 +//line parser/grammar.y:909 { yrVAL.expr = &ast.Operation{ Operator: ast.OpNotEqual, Operands: []ast.Expression{yrDollar[1].expr, yrDollar[3].expr}, } } - case 96: + case 99: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:889 +//line parser/grammar.y:916 { yrVAL.expr = yrDollar[1].expr } - case 97: + case 100: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:893 +//line parser/grammar.y:920 { yrVAL.expr = &ast.Group{yrDollar[2].expr} } - case 98: + case 101: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:901 +//line parser/grammar.y:928 { yrVAL.node = &ast.Enum{Values: yrDollar[2].exprs} } - case 99: + case 102: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:905 +//line parser/grammar.y:932 { yrVAL.node = yrDollar[1].rng } - case 100: + case 103: yrDollar = yrS[yrpt-5 : yrpt+1] -//line parser/grammar.y:913 +//line parser/grammar.y:940 { yrVAL.rng = &ast.Range{ Start: yrDollar[2].expr, End: yrDollar[4].expr, } } - case 101: + case 104: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:924 +//line parser/grammar.y:951 { yrVAL.exprs = []ast.Expression{yrDollar[1].expr} } - case 102: + case 105: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:928 +//line parser/grammar.y:955 { yrVAL.exprs = append(yrDollar[1].exprs, yrDollar[3].expr) } - case 103: + case 106: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:936 +//line parser/grammar.y:963 { yrVAL.node = &ast.Enum{Values: yrDollar[2].exprs} } - case 104: + case 107: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:940 +//line parser/grammar.y:967 { yrVAL.node = ast.KeywordThem } - case 105: + case 108: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:948 +//line parser/grammar.y:975 { yrVAL.exprs = []ast.Expression{yrDollar[1].si} } - case 106: + case 109: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:952 +//line parser/grammar.y:979 { yrVAL.exprs = append(yrDollar[1].exprs, yrDollar[3].si) } - case 107: + case 110: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:960 +//line parser/grammar.y:987 { yrVAL.si = &ast.StringIdentifier{ Identifier: strings.TrimPrefix(yrDollar[1].s, "$"), } } - case 108: + case 111: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:966 +//line parser/grammar.y:993 { yrVAL.si = &ast.StringIdentifier{ Identifier: strings.TrimPrefix(yrDollar[1].s, "$"), } } - case 109: + case 112: + yrDollar = yrS[yrpt-3 : yrpt+1] +//line parser/grammar.y:1003 + { + yrVAL.node = &ast.Enum{Values: yrDollar[2].exprs} + } + case 113: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:975 +//line parser/grammar.y:1011 + { + yrVAL.exprs = []ast.Expression{yrDollar[1].ident} + } + case 114: + yrDollar = yrS[yrpt-3 : yrpt+1] +//line parser/grammar.y:1015 + { + yrVAL.exprs = append(yrDollar[1].exprs, yrDollar[3].ident) + } + case 115: + yrDollar = yrS[yrpt-1 : yrpt+1] +//line parser/grammar.y:1023 + { + yrVAL.ident = &ast.Identifier{Identifier: yrDollar[1].s} + } + case 116: + yrDollar = yrS[yrpt-1 : yrpt+1] +//line parser/grammar.y:1027 + { + yrVAL.ident = &ast.Identifier{Identifier: yrDollar[1].s} + } + case 117: + yrDollar = yrS[yrpt-1 : yrpt+1] +//line parser/grammar.y:1035 { yrVAL.quantifier = &ast.Quantifier{yrDollar[1].expr} } - case 110: + case 118: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:979 +//line parser/grammar.y:1039 { yrVAL.quantifier = &ast.Quantifier{ast.KeywordAll} } - case 111: + case 119: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:983 +//line parser/grammar.y:1043 { yrVAL.quantifier = &ast.Quantifier{ast.KeywordAny} } - case 112: + case 120: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:987 +//line parser/grammar.y:1047 { yrVAL.quantifier = &ast.Quantifier{ast.KeywordNone} } - case 113: + case 121: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:995 +//line parser/grammar.y:1055 { yrVAL.ss = []string{yrDollar[1].s} } - case 114: + case 122: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:999 +//line parser/grammar.y:1059 { yrVAL.ss = append(yrDollar[1].ss, yrDollar[3].s) } - case 115: + case 123: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:1006 +//line parser/grammar.y:1066 { yrVAL.node = yrDollar[1].expr } - case 116: + case 124: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:1010 +//line parser/grammar.y:1070 { yrVAL.node = yrDollar[1].node } - case 117: + case 125: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:1018 +//line parser/grammar.y:1078 { yrVAL.expr = &ast.Group{yrDollar[2].expr} } - case 118: + case 126: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:1022 +//line parser/grammar.y:1082 { yrVAL.expr = ast.KeywordFilesize } - case 119: + case 127: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:1026 +//line parser/grammar.y:1086 { yrVAL.expr = ast.KeywordEntrypoint } - case 120: + case 128: yrDollar = yrS[yrpt-4 : yrpt+1] -//line parser/grammar.y:1030 +//line parser/grammar.y:1090 { yrVAL.expr = &ast.FunctionCall{ Callable: &ast.Identifier{Identifier: yrDollar[1].s}, Arguments: []ast.Expression{yrDollar[3].expr}, } } - case 121: + case 129: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:1037 +//line parser/grammar.y:1097 { yrVAL.expr = &ast.LiteralInteger{yrDollar[1].i64} } - case 122: + case 130: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:1041 +//line parser/grammar.y:1101 { yrVAL.expr = &ast.LiteralFloat{yrDollar[1].f64} } - case 123: + case 131: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:1045 +//line parser/grammar.y:1105 { if err := validateUTF8(yrDollar[1].s); err != nil { return asLexer(yrlex).setError( @@ -1805,129 +1871,138 @@ yrdefault: yrVAL.expr = &ast.LiteralString{yrDollar[1].s} } - case 124: + case 132: + yrDollar = yrS[yrpt-3 : yrpt+1] +//line parser/grammar.y:1114 + { + yrVAL.expr = &ast.StringCount{ + Identifier: strings.TrimPrefix(yrDollar[1].s, "#"), + In: yrDollar[3].rng, + } + } + case 133: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:1054 +//line parser/grammar.y:1121 { yrVAL.expr = &ast.StringCount{ Identifier: strings.TrimPrefix(yrDollar[1].s, "#"), } } - case 125: + case 134: yrDollar = yrS[yrpt-4 : yrpt+1] -//line parser/grammar.y:1060 +//line parser/grammar.y:1127 { yrVAL.expr = &ast.StringOffset{ Identifier: strings.TrimPrefix(yrDollar[1].s, "@"), Index: yrDollar[3].expr, } } - case 126: + case 135: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:1067 +//line parser/grammar.y:1134 { yrVAL.expr = &ast.StringOffset{ Identifier: strings.TrimPrefix(yrDollar[1].s, "@"), } } - case 127: + case 136: yrDollar = yrS[yrpt-4 : yrpt+1] -//line parser/grammar.y:1073 +//line parser/grammar.y:1140 { yrVAL.expr = &ast.StringLength{ Identifier: strings.TrimPrefix(yrDollar[1].s, "!"), Index: yrDollar[3].expr, } } - case 128: + case 137: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:1080 +//line parser/grammar.y:1147 { yrVAL.expr = &ast.StringLength{ Identifier: strings.TrimPrefix(yrDollar[1].s, "!"), } } - case 129: + case 138: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:1086 +//line parser/grammar.y:1153 { yrVAL.expr = yrDollar[1].expr } - case 130: + case 139: yrDollar = yrS[yrpt-2 : yrpt+1] -//line parser/grammar.y:1090 +//line parser/grammar.y:1157 { yrVAL.expr = &ast.Minus{yrDollar[2].expr} } - case 131: + case 140: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:1094 +//line parser/grammar.y:1161 { yrVAL.expr = operation(ast.OpAdd, yrDollar[1].expr, yrDollar[3].expr) } - case 132: + case 141: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:1098 +//line parser/grammar.y:1165 { yrVAL.expr = operation(ast.OpSub, yrDollar[1].expr, yrDollar[3].expr) } - case 133: + case 142: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:1102 +//line parser/grammar.y:1169 { yrVAL.expr = operation(ast.OpMul, yrDollar[1].expr, yrDollar[3].expr) } - case 134: + case 143: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:1106 +//line parser/grammar.y:1173 { yrVAL.expr = operation(ast.OpDiv, yrDollar[1].expr, yrDollar[3].expr) } - case 135: + case 144: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:1110 +//line parser/grammar.y:1177 { yrVAL.expr = operation(ast.OpMod, yrDollar[1].expr, yrDollar[3].expr) } - case 136: + case 145: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:1114 +//line parser/grammar.y:1181 { yrVAL.expr = operation(ast.OpBitXor, yrDollar[1].expr, yrDollar[3].expr) } - case 137: + case 146: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:1118 +//line parser/grammar.y:1185 { yrVAL.expr = operation(ast.OpBitAnd, yrDollar[1].expr, yrDollar[3].expr) } - case 138: + case 147: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:1122 +//line parser/grammar.y:1189 { yrVAL.expr = operation(ast.OpBitOr, yrDollar[1].expr, yrDollar[3].expr) } - case 139: + case 148: yrDollar = yrS[yrpt-2 : yrpt+1] -//line parser/grammar.y:1126 +//line parser/grammar.y:1193 { yrVAL.expr = &ast.BitwiseNot{yrDollar[2].expr} } - case 140: + case 149: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:1130 +//line parser/grammar.y:1197 { yrVAL.expr = operation(ast.OpShiftLeft, yrDollar[1].expr, yrDollar[3].expr) } - case 141: + case 150: yrDollar = yrS[yrpt-3 : yrpt+1] -//line parser/grammar.y:1134 +//line parser/grammar.y:1201 { yrVAL.expr = operation(ast.OpShiftRight, yrDollar[1].expr, yrDollar[3].expr) } - case 142: + case 151: yrDollar = yrS[yrpt-1 : yrpt+1] -//line parser/grammar.y:1138 +//line parser/grammar.y:1205 { yrVAL.expr = yrDollar[1].reg } diff --git a/pb/yara.pb.go b/pb/yara.pb.go index 7abb669..58feda1 100644 --- a/pb/yara.pb.go +++ b/pb/yara.pb.go @@ -1948,6 +1948,11 @@ type ForOfExpression struct { StringSet *StringSet `protobuf:"bytes,2,opt,name=string_set,json=stringSet" json:"string_set,omitempty"` // Expression to match: "(@$ > 10)" Expression *Expression `protobuf:"bytes,3,opt,name=expression" json:"expression,omitempty"` + // "3 of ($s1, $s2) in (0..100)" + Range *Range `protobuf:"bytes,4,opt,name=range" json:"range,omitempty"` + // Rule set: "(rule1, rule2, foo*)". + // Only one of StringSet or RuleEnumeration is allowed. + RuleEnumeration *RuleEnumeration `protobuf:"bytes,5,opt,name=rule_enumeration,json=ruleEnumeration" json:"rule_enumeration,omitempty"` } func (x *ForOfExpression) Reset() { @@ -2003,6 +2008,20 @@ func (x *ForOfExpression) GetExpression() *Expression { return nil } +func (x *ForOfExpression) GetRange() *Range { + if x != nil { + return x.Range + } + return nil +} + +func (x *ForOfExpression) GetRuleEnumeration() *RuleEnumeration { + if x != nil { + return x.RuleEnumeration + } + return nil +} + // Set of strings. Can be either an enumeration of strings or a keyword. type StringSet struct { state protoimpl.MessageState @@ -2137,6 +2156,56 @@ func (x *StringEnumeration) GetItems() []*StringEnumeration_StringEnumerationIte return nil } +// Set of rules, referenced by their identifier. +// A wildcard can be used to match multiple rules. +type RuleEnumeration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Items in the rule enumeration. + Items []*RuleEnumeration_RuleEnumerationItem `protobuf:"bytes,1,rep,name=items" json:"items,omitempty"` +} + +func (x *RuleEnumeration) Reset() { + *x = RuleEnumeration{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_yara_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RuleEnumeration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RuleEnumeration) ProtoMessage() {} + +func (x *RuleEnumeration) ProtoReflect() protoreflect.Message { + mi := &file_pb_yara_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RuleEnumeration.ProtoReflect.Descriptor instead. +func (*RuleEnumeration) Descriptor() ([]byte, []int) { + return file_pb_yara_proto_rawDescGZIP(), []int{24} +} + +func (x *RuleEnumeration) GetItems() []*RuleEnumeration_RuleEnumerationItem { + if x != nil { + return x.Items + } + return nil +} + // Expression used as part of a rule condition. type Expression struct { state protoimpl.MessageState @@ -2171,7 +2240,7 @@ type Expression struct { func (x *Expression) Reset() { *x = Expression{} if protoimpl.UnsafeEnabled { - mi := &file_pb_yara_proto_msgTypes[24] + mi := &file_pb_yara_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2184,7 +2253,7 @@ func (x *Expression) String() string { func (*Expression) ProtoMessage() {} func (x *Expression) ProtoReflect() protoreflect.Message { - mi := &file_pb_yara_proto_msgTypes[24] + mi := &file_pb_yara_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2197,7 +2266,7 @@ func (x *Expression) ProtoReflect() protoreflect.Message { // Deprecated: Use Expression.ProtoReflect.Descriptor instead. func (*Expression) Descriptor() ([]byte, []int) { - return file_pb_yara_proto_rawDescGZIP(), []int{24} + return file_pb_yara_proto_rawDescGZIP(), []int{25} } func (m *Expression) GetExpression() isExpression_Expression { @@ -2503,7 +2572,7 @@ type StringOffset struct { func (x *StringOffset) Reset() { *x = StringOffset{} if protoimpl.UnsafeEnabled { - mi := &file_pb_yara_proto_msgTypes[25] + mi := &file_pb_yara_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2516,7 +2585,7 @@ func (x *StringOffset) String() string { func (*StringOffset) ProtoMessage() {} func (x *StringOffset) ProtoReflect() protoreflect.Message { - mi := &file_pb_yara_proto_msgTypes[25] + mi := &file_pb_yara_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2529,7 +2598,7 @@ func (x *StringOffset) ProtoReflect() protoreflect.Message { // Deprecated: Use StringOffset.ProtoReflect.Descriptor instead. func (*StringOffset) Descriptor() ([]byte, []int) { - return file_pb_yara_proto_rawDescGZIP(), []int{25} + return file_pb_yara_proto_rawDescGZIP(), []int{26} } func (x *StringOffset) GetStringIdentifier() string { @@ -2566,7 +2635,7 @@ type StringLength struct { func (x *StringLength) Reset() { *x = StringLength{} if protoimpl.UnsafeEnabled { - mi := &file_pb_yara_proto_msgTypes[26] + mi := &file_pb_yara_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2579,7 +2648,7 @@ func (x *StringLength) String() string { func (*StringLength) ProtoMessage() {} func (x *StringLength) ProtoReflect() protoreflect.Message { - mi := &file_pb_yara_proto_msgTypes[26] + mi := &file_pb_yara_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2592,7 +2661,7 @@ func (x *StringLength) ProtoReflect() protoreflect.Message { // Deprecated: Use StringLength.ProtoReflect.Descriptor instead. func (*StringLength) Descriptor() ([]byte, []int) { - return file_pb_yara_proto_rawDescGZIP(), []int{26} + return file_pb_yara_proto_rawDescGZIP(), []int{27} } func (x *StringLength) GetStringIdentifier() string { @@ -2627,7 +2696,7 @@ type Identifier struct { func (x *Identifier) Reset() { *x = Identifier{} if protoimpl.UnsafeEnabled { - mi := &file_pb_yara_proto_msgTypes[27] + mi := &file_pb_yara_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2640,7 +2709,7 @@ func (x *Identifier) String() string { func (*Identifier) ProtoMessage() {} func (x *Identifier) ProtoReflect() protoreflect.Message { - mi := &file_pb_yara_proto_msgTypes[27] + mi := &file_pb_yara_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2653,7 +2722,7 @@ func (x *Identifier) ProtoReflect() protoreflect.Message { // Deprecated: Use Identifier.ProtoReflect.Descriptor instead. func (*Identifier) Descriptor() ([]byte, []int) { - return file_pb_yara_proto_rawDescGZIP(), []int{27} + return file_pb_yara_proto_rawDescGZIP(), []int{28} } func (x *Identifier) GetItems() []*Identifier_IdentifierItem { @@ -2676,7 +2745,7 @@ type Expressions struct { func (x *Expressions) Reset() { *x = Expressions{} if protoimpl.UnsafeEnabled { - mi := &file_pb_yara_proto_msgTypes[28] + mi := &file_pb_yara_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2689,7 +2758,7 @@ func (x *Expressions) String() string { func (*Expressions) ProtoMessage() {} func (x *Expressions) ProtoReflect() protoreflect.Message { - mi := &file_pb_yara_proto_msgTypes[28] + mi := &file_pb_yara_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2702,7 +2771,7 @@ func (x *Expressions) ProtoReflect() protoreflect.Message { // Deprecated: Use Expressions.ProtoReflect.Descriptor instead. func (*Expressions) Descriptor() ([]byte, []int) { - return file_pb_yara_proto_rawDescGZIP(), []int{28} + return file_pb_yara_proto_rawDescGZIP(), []int{29} } func (x *Expressions) GetTerms() []*Expression { @@ -2735,7 +2804,7 @@ type Rule struct { func (x *Rule) Reset() { *x = Rule{} if protoimpl.UnsafeEnabled { - mi := &file_pb_yara_proto_msgTypes[29] + mi := &file_pb_yara_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2748,7 +2817,7 @@ func (x *Rule) String() string { func (*Rule) ProtoMessage() {} func (x *Rule) ProtoReflect() protoreflect.Message { - mi := &file_pb_yara_proto_msgTypes[29] + mi := &file_pb_yara_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2761,7 +2830,7 @@ func (x *Rule) ProtoReflect() protoreflect.Message { // Deprecated: Use Rule.ProtoReflect.Descriptor instead. func (*Rule) Descriptor() ([]byte, []int) { - return file_pb_yara_proto_rawDescGZIP(), []int{29} + return file_pb_yara_proto_rawDescGZIP(), []int{30} } func (x *Rule) GetModifiers() *RuleModifiers { @@ -2827,7 +2896,7 @@ type RuleSet struct { func (x *RuleSet) Reset() { *x = RuleSet{} if protoimpl.UnsafeEnabled { - mi := &file_pb_yara_proto_msgTypes[30] + mi := &file_pb_yara_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2840,7 +2909,7 @@ func (x *RuleSet) String() string { func (*RuleSet) ProtoMessage() {} func (x *RuleSet) ProtoReflect() protoreflect.Message { - mi := &file_pb_yara_proto_msgTypes[30] + mi := &file_pb_yara_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2853,7 +2922,7 @@ func (x *RuleSet) ProtoReflect() protoreflect.Message { // Deprecated: Use RuleSet.ProtoReflect.Descriptor instead. func (*RuleSet) Descriptor() ([]byte, []int) { - return file_pb_yara_proto_rawDescGZIP(), []int{30} + return file_pb_yara_proto_rawDescGZIP(), []int{31} } func (x *RuleSet) GetImports() []string { @@ -2893,7 +2962,7 @@ type StringEnumeration_StringEnumerationItem struct { func (x *StringEnumeration_StringEnumerationItem) Reset() { *x = StringEnumeration_StringEnumerationItem{} if protoimpl.UnsafeEnabled { - mi := &file_pb_yara_proto_msgTypes[31] + mi := &file_pb_yara_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2906,7 +2975,7 @@ func (x *StringEnumeration_StringEnumerationItem) String() string { func (*StringEnumeration_StringEnumerationItem) ProtoMessage() {} func (x *StringEnumeration_StringEnumerationItem) ProtoReflect() protoreflect.Message { - mi := &file_pb_yara_proto_msgTypes[31] + mi := &file_pb_yara_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2936,6 +3005,65 @@ func (x *StringEnumeration_StringEnumerationItem) GetHasWildcard() bool { return false } +// An entry in the rule enumeration. +type RuleEnumeration_RuleEnumerationItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier or part of it if a wildcard (*) is used. + // Includes the wildcard if present. + RuleIdentifier *string `protobuf:"bytes,1,opt,name=rule_identifier,json=ruleIdentifier" json:"rule_identifier,omitempty"` + // Wildcard (*). + HasWildcard *bool `protobuf:"varint,2,opt,name=has_wildcard,json=hasWildcard" json:"has_wildcard,omitempty"` +} + +func (x *RuleEnumeration_RuleEnumerationItem) Reset() { + *x = RuleEnumeration_RuleEnumerationItem{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_yara_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RuleEnumeration_RuleEnumerationItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RuleEnumeration_RuleEnumerationItem) ProtoMessage() {} + +func (x *RuleEnumeration_RuleEnumerationItem) ProtoReflect() protoreflect.Message { + mi := &file_pb_yara_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RuleEnumeration_RuleEnumerationItem.ProtoReflect.Descriptor instead. +func (*RuleEnumeration_RuleEnumerationItem) Descriptor() ([]byte, []int) { + return file_pb_yara_proto_rawDescGZIP(), []int{24, 0} +} + +func (x *RuleEnumeration_RuleEnumerationItem) GetRuleIdentifier() string { + if x != nil && x.RuleIdentifier != nil { + return *x.RuleIdentifier + } + return "" +} + +func (x *RuleEnumeration_RuleEnumerationItem) GetHasWildcard() bool { + if x != nil && x.HasWildcard != nil { + return *x.HasWildcard + } + return false +} + type Identifier_IdentifierItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2951,7 +3079,7 @@ type Identifier_IdentifierItem struct { func (x *Identifier_IdentifierItem) Reset() { *x = Identifier_IdentifierItem{} if protoimpl.UnsafeEnabled { - mi := &file_pb_yara_proto_msgTypes[32] + mi := &file_pb_yara_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2964,7 +3092,7 @@ func (x *Identifier_IdentifierItem) String() string { func (*Identifier_IdentifierItem) ProtoMessage() {} func (x *Identifier_IdentifierItem) ProtoReflect() protoreflect.Message { - mi := &file_pb_yara_proto_msgTypes[32] + mi := &file_pb_yara_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2977,7 +3105,7 @@ func (x *Identifier_IdentifierItem) ProtoReflect() protoreflect.Message { // Deprecated: Use Identifier_IdentifierItem.ProtoReflect.Descriptor instead. func (*Identifier_IdentifierItem) Descriptor() ([]byte, []int) { - return file_pb_yara_proto_rawDescGZIP(), []int{27, 0} + return file_pb_yara_proto_rawDescGZIP(), []int{28, 0} } func (m *Identifier_IdentifierItem) GetItem() isIdentifier_IdentifierItem_Item { @@ -3203,7 +3331,7 @@ var file_pb_yara_proto_rawDesc = []byte{ 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x42, 0x05, 0x0a, - 0x03, 0x66, 0x6f, 0x72, 0x22, 0xa0, 0x01, 0x0a, 0x0f, 0x46, 0x6f, 0x72, 0x4f, 0x66, 0x45, 0x78, + 0x03, 0x66, 0x6f, 0x72, 0x22, 0xfb, 0x01, 0x0a, 0x0f, 0x46, 0x6f, 0x72, 0x4f, 0x66, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x0e, 0x66, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x46, 0x6f, 0x72, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, @@ -3213,149 +3341,166 @@ var file_pb_yara_proto_rawDesc = []byte{ 0x09, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x12, 0x2b, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x65, 0x78, 0x70, - 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x71, 0x0a, 0x09, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x53, 0x65, 0x74, 0x12, 0x2e, 0x0a, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6e, - 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x07, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2d, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x65, - 0x74, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, - 0x6f, 0x72, 0x64, 0x42, 0x05, 0x0a, 0x03, 0x73, 0x65, 0x74, 0x22, 0xbc, 0x01, 0x0a, 0x11, 0x53, + 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x05, + 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x3b, 0x0a, 0x10, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x65, 0x6e, + 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0f, 0x72, 0x75, 0x6c, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x71, 0x0a, 0x09, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x12, + 0x2e, 0x0a, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x12, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x12, + 0x2d, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x11, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x77, + 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x05, + 0x0a, 0x03, 0x73, 0x65, 0x74, 0x22, 0xbc, 0x01, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x3e, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x28, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, - 0x1a, 0x67, 0x0a, 0x15, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x61, 0x73, 0x5f, 0x77, 0x69, - 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x68, 0x61, - 0x73, 0x57, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x22, 0x99, 0x08, 0x0a, 0x0a, 0x45, 0x78, - 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, - 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x40, 0x0a, 0x11, 0x62, 0x69, 0x6e, - 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x45, 0x78, 0x70, - 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x10, 0x62, 0x69, 0x6e, 0x61, 0x72, - 0x79, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x10, 0x75, - 0x6e, 0x61, 0x72, 0x79, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x45, 0x78, 0x70, - 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0f, 0x75, 0x6e, 0x61, 0x72, 0x79, - 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x11, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x3e, 0x0a, 0x11, 0x66, 0x6f, 0x72, - 0x5f, 0x69, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x46, 0x6f, 0x72, 0x49, 0x6e, 0x45, 0x78, 0x70, 0x72, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0f, 0x66, 0x6f, 0x72, 0x49, 0x6e, 0x45, - 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x11, 0x66, 0x6f, 0x72, - 0x5f, 0x6f, 0x66, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x46, 0x6f, 0x72, 0x4f, 0x66, 0x45, 0x78, 0x70, 0x72, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0f, 0x66, 0x6f, 0x72, 0x4f, 0x66, 0x45, - 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x34, 0x0a, 0x0e, 0x6e, 0x6f, 0x74, - 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, - 0x52, 0x0d, 0x6e, 0x6f, 0x74, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x33, 0x0a, 0x0d, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x6f, 0x72, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x0e, 0x61, 0x6e, 0x64, 0x5f, 0x65, 0x78, 0x70, 0x72, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x45, - 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x0d, 0x61, 0x6e, - 0x64, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x05, 0x72, - 0x61, 0x6e, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x48, 0x00, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x06, 0x72, - 0x65, 0x67, 0x65, 0x78, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x52, 0x65, - 0x67, 0x65, 0x78, 0x70, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x12, 0x24, - 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x08, 0x2e, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x07, 0x6b, 0x65, 0x79, - 0x77, 0x6f, 0x72, 0x64, 0x12, 0x23, 0x0a, 0x0c, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0b, 0x6e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x64, 0x6f, 0x75, - 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x01, 0x48, - 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, - 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, - 0x74, 0x65, 0x78, 0x74, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x0d, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0d, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x48, - 0x00, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, - 0x34, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, - 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, - 0x65, 0x6e, 0x67, 0x74, 0x68, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, - 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x2d, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, - 0x69, 0x65, 0x72, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x5f, - 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x48, 0x00, 0x52, 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x46, 0x75, 0x6e, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x15, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, - 0x65, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x15, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x48, - 0x00, 0x52, 0x14, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x45, 0x78, 0x70, - 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0c, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5e, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, - 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, - 0x65, 0x72, 0x12, 0x21, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x05, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x5e, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, - 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, - 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, - 0x65, 0x72, 0x12, 0x21, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x05, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xce, 0x01, 0x0a, 0x0a, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, - 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x52, - 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x8d, 0x01, 0x0a, 0x0e, 0x49, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x66, 0x69, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x20, 0x0a, 0x0a, 0x69, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, - 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x05, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x78, 0x70, - 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x12, 0x2c, 0x0a, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x48, 0x00, 0x52, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x06, - 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x30, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x05, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x05, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x22, 0xd1, 0x01, 0x0a, 0x04, 0x52, 0x75, 0x6c, - 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x69, 0x66, - 0x69, 0x65, 0x72, 0x73, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x12, - 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, - 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, - 0x61, 0x67, 0x73, 0x12, 0x19, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x05, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x21, - 0x0a, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x07, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x73, 0x12, 0x29, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0x0a, 0x07, - 0x52, 0x75, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x6d, 0x70, 0x6f, 0x72, - 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, - 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x12, 0x1b, 0x0a, - 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x52, - 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2a, 0x34, 0x0a, 0x07, 0x4b, 0x65, - 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, - 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x50, 0x4f, 0x49, 0x4e, 0x54, - 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x49, 0x4c, 0x45, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x03, - 0x2a, 0x28, 0x0a, 0x0a, 0x46, 0x6f, 0x72, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x08, - 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4c, 0x4c, 0x10, - 0x01, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x59, 0x10, 0x02, 0x2a, 0x1c, 0x0a, 0x10, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x08, - 0x0a, 0x04, 0x54, 0x48, 0x45, 0x4d, 0x10, 0x01, 0x42, 0x1e, 0x5a, 0x1c, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x56, 0x69, 0x72, 0x75, 0x73, 0x54, 0x6f, 0x74, 0x61, - 0x6c, 0x2f, 0x67, 0x79, 0x70, 0x2f, 0x70, 0x62, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x67, 0x0a, 0x15, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x74, 0x65, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, + 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x61, 0x73, 0x5f, 0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x68, 0x61, 0x73, 0x57, 0x69, 0x6c, 0x64, + 0x63, 0x61, 0x72, 0x64, 0x22, 0xb0, 0x01, 0x0a, 0x0f, 0x52, 0x75, 0x6c, 0x65, 0x45, 0x6e, 0x75, + 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x45, 0x6e, + 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x45, 0x6e, + 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x61, 0x0a, 0x13, 0x52, 0x75, 0x6c, 0x65, 0x45, 0x6e, 0x75, 0x6d, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x27, 0x0a, 0x0f, 0x72, + 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x61, 0x73, 0x5f, 0x77, 0x69, 0x6c, 0x64, + 0x63, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x68, 0x61, 0x73, 0x57, + 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x22, 0x99, 0x08, 0x0a, 0x0a, 0x45, 0x78, 0x70, 0x72, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, + 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x40, 0x0a, 0x11, 0x62, 0x69, 0x6e, 0x61, 0x72, + 0x79, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x45, 0x78, 0x70, 0x72, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x10, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x45, + 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x10, 0x75, 0x6e, 0x61, + 0x72, 0x79, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x45, 0x78, 0x70, 0x72, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0f, 0x75, 0x6e, 0x61, 0x72, 0x79, 0x45, 0x78, + 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x3e, 0x0a, 0x11, 0x66, 0x6f, 0x72, 0x5f, 0x69, + 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x46, 0x6f, 0x72, 0x49, 0x6e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0f, 0x66, 0x6f, 0x72, 0x49, 0x6e, 0x45, 0x78, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x11, 0x66, 0x6f, 0x72, 0x5f, 0x6f, + 0x66, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x46, 0x6f, 0x72, 0x4f, 0x66, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0f, 0x66, 0x6f, 0x72, 0x4f, 0x66, 0x45, 0x78, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x34, 0x0a, 0x0e, 0x6e, 0x6f, 0x74, 0x5f, 0x65, + 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0b, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0d, + 0x6e, 0x6f, 0x74, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, + 0x0d, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x6f, 0x72, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x0e, 0x61, 0x6e, 0x64, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x45, 0x78, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x0d, 0x61, 0x6e, 0x64, 0x45, + 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x05, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x48, 0x00, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x06, 0x72, 0x65, 0x67, + 0x65, 0x78, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x52, 0x65, 0x67, 0x65, + 0x78, 0x70, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x12, 0x24, 0x0a, 0x07, + 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x08, 0x2e, + 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, + 0x72, 0x64, 0x12, 0x23, 0x0a, 0x0c, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0b, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, + 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, + 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x04, + 0x74, 0x65, 0x78, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x74, 0x65, + 0x78, 0x74, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x48, 0x00, 0x52, + 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x34, 0x0a, + 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x12, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x6e, + 0x67, 0x74, 0x68, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x6e, + 0x67, 0x74, 0x68, 0x12, 0x2d, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, + 0x72, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x5f, 0x66, 0x75, + 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x49, + 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, + 0x52, 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x42, 0x0a, 0x15, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x5f, + 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0b, 0x2e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, + 0x14, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x45, 0x78, 0x70, 0x72, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0c, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x22, 0x5e, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x12, 0x21, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0b, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x22, 0x5e, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x6e, + 0x67, 0x74, 0x68, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x12, 0x21, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0b, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x22, 0xce, 0x01, 0x0a, 0x0a, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x12, 0x30, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x8d, 0x01, 0x0a, 0x0e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x20, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0a, 0x69, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x05, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x2c, + 0x0a, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0c, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x48, + 0x00, 0x52, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x06, 0x0a, 0x04, + 0x69, 0x74, 0x65, 0x6d, 0x22, 0x30, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x05, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x05, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x22, 0xd1, 0x01, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, + 0x2c, 0x0a, 0x09, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, + 0x72, 0x73, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x12, 0x1e, 0x0a, + 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, + 0x73, 0x12, 0x19, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x05, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x07, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x12, + 0x29, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0x0a, 0x07, 0x52, 0x75, + 0x6c, 0x65, 0x53, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, + 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x08, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x05, 0x72, + 0x75, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x52, 0x75, 0x6c, + 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2a, 0x34, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x77, + 0x6f, 0x72, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x01, + 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x50, 0x4f, 0x49, 0x4e, 0x54, 0x10, 0x02, + 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x49, 0x4c, 0x45, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x03, 0x2a, 0x28, + 0x0a, 0x0a, 0x46, 0x6f, 0x72, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x08, 0x0a, 0x04, + 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, + 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x59, 0x10, 0x02, 0x2a, 0x1c, 0x0a, 0x10, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x53, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x08, 0x0a, 0x04, + 0x54, 0x48, 0x45, 0x4d, 0x10, 0x01, 0x42, 0x1e, 0x5a, 0x1c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x56, 0x69, 0x72, 0x75, 0x73, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x2f, + 0x67, 0x79, 0x70, 0x2f, 0x70, 0x62, } var ( @@ -3371,7 +3516,7 @@ func file_pb_yara_proto_rawDescGZIP() []byte { } var file_pb_yara_proto_enumTypes = make([]protoimpl.EnumInfo, 5) -var file_pb_yara_proto_msgTypes = make([]protoimpl.MessageInfo, 33) +var file_pb_yara_proto_msgTypes = make([]protoimpl.MessageInfo, 35) var file_pb_yara_proto_goTypes = []interface{}{ (Keyword)(0), // 0: Keyword (ForKeyword)(0), // 1: ForKeyword @@ -3402,15 +3547,17 @@ var file_pb_yara_proto_goTypes = []interface{}{ (*ForOfExpression)(nil), // 26: ForOfExpression (*StringSet)(nil), // 27: StringSet (*StringEnumeration)(nil), // 28: StringEnumeration - (*Expression)(nil), // 29: Expression - (*StringOffset)(nil), // 30: StringOffset - (*StringLength)(nil), // 31: StringLength - (*Identifier)(nil), // 32: Identifier - (*Expressions)(nil), // 33: Expressions - (*Rule)(nil), // 34: Rule - (*RuleSet)(nil), // 35: RuleSet - (*StringEnumeration_StringEnumerationItem)(nil), // 36: StringEnumeration.StringEnumerationItem - (*Identifier_IdentifierItem)(nil), // 37: Identifier.IdentifierItem + (*RuleEnumeration)(nil), // 29: RuleEnumeration + (*Expression)(nil), // 30: Expression + (*StringOffset)(nil), // 31: StringOffset + (*StringLength)(nil), // 32: StringLength + (*Identifier)(nil), // 33: Identifier + (*Expressions)(nil), // 34: Expressions + (*Rule)(nil), // 35: Rule + (*RuleSet)(nil), // 36: RuleSet + (*StringEnumeration_StringEnumerationItem)(nil), // 37: StringEnumeration.StringEnumerationItem + (*RuleEnumeration_RuleEnumerationItem)(nil), // 38: RuleEnumeration.RuleEnumerationItem + (*Identifier_IdentifierItem)(nil), // 39: Identifier.IdentifierItem } var file_pb_yara_proto_depIdxs = []int32{ 9, // 0: String.text:type_name -> TextString @@ -3424,62 +3571,65 @@ var file_pb_yara_proto_depIdxs = []int32{ 13, // 8: HexToken.alternative:type_name -> HexAlternative 11, // 9: HexAlternative.tokens:type_name -> HexTokens 3, // 10: BinaryExpression.operator:type_name -> BinaryExpression.Operator - 29, // 11: BinaryExpression.left:type_name -> Expression - 29, // 12: BinaryExpression.right:type_name -> Expression + 30, // 11: BinaryExpression.left:type_name -> Expression + 30, // 12: BinaryExpression.right:type_name -> Expression 4, // 13: UnaryExpression.operator:type_name -> UnaryExpression.Operator - 29, // 14: UnaryExpression.expression:type_name -> Expression - 29, // 15: Range.start:type_name -> Expression - 29, // 16: Range.end:type_name -> Expression - 29, // 17: IntegerFunction.argument:type_name -> Expression + 30, // 14: UnaryExpression.expression:type_name -> Expression + 30, // 15: Range.start:type_name -> Expression + 30, // 16: Range.end:type_name -> Expression + 30, // 17: IntegerFunction.argument:type_name -> Expression 25, // 18: ForInExpression.for_expression:type_name -> ForExpression 21, // 19: ForInExpression.iterator:type_name -> Iterator - 29, // 20: ForInExpression.expression:type_name -> Expression + 30, // 20: ForInExpression.expression:type_name -> Expression 22, // 21: Iterator.integer_set:type_name -> IntegerSet - 32, // 22: Iterator.identifier:type_name -> Identifier + 33, // 22: Iterator.identifier:type_name -> Identifier 23, // 23: IntegerSet.integer_enumeration:type_name -> IntegerEnumeration 18, // 24: IntegerSet.range:type_name -> Range - 29, // 25: IntegerEnumeration.values:type_name -> Expression - 29, // 26: Percentage.expression:type_name -> Expression - 29, // 27: ForExpression.expression:type_name -> Expression + 30, // 25: IntegerEnumeration.values:type_name -> Expression + 30, // 26: Percentage.expression:type_name -> Expression + 30, // 27: ForExpression.expression:type_name -> Expression 1, // 28: ForExpression.keyword:type_name -> ForKeyword 24, // 29: ForExpression.percentage:type_name -> Percentage 25, // 30: ForOfExpression.for_expression:type_name -> ForExpression 27, // 31: ForOfExpression.string_set:type_name -> StringSet - 29, // 32: ForOfExpression.expression:type_name -> Expression - 28, // 33: StringSet.strings:type_name -> StringEnumeration - 2, // 34: StringSet.keyword:type_name -> StringSetKeyword - 36, // 35: StringEnumeration.items:type_name -> StringEnumeration.StringEnumerationItem - 16, // 36: Expression.binary_expression:type_name -> BinaryExpression - 17, // 37: Expression.unary_expression:type_name -> UnaryExpression - 20, // 38: Expression.for_in_expression:type_name -> ForInExpression - 26, // 39: Expression.for_of_expression:type_name -> ForOfExpression - 29, // 40: Expression.not_expression:type_name -> Expression - 33, // 41: Expression.or_expression:type_name -> Expressions - 33, // 42: Expression.and_expression:type_name -> Expressions - 18, // 43: Expression.range:type_name -> Range - 10, // 44: Expression.regexp:type_name -> Regexp - 0, // 45: Expression.keyword:type_name -> Keyword - 30, // 46: Expression.string_offset:type_name -> StringOffset - 31, // 47: Expression.string_length:type_name -> StringLength - 32, // 48: Expression.identifier:type_name -> Identifier - 19, // 49: Expression.integer_function:type_name -> IntegerFunction - 24, // 50: Expression.percentage_expression:type_name -> Percentage - 29, // 51: StringOffset.index:type_name -> Expression - 29, // 52: StringLength.index:type_name -> Expression - 37, // 53: Identifier.items:type_name -> Identifier.IdentifierItem - 29, // 54: Expressions.terms:type_name -> Expression - 5, // 55: Rule.modifiers:type_name -> RuleModifiers - 6, // 56: Rule.meta:type_name -> Meta - 7, // 57: Rule.strings:type_name -> String - 29, // 58: Rule.condition:type_name -> Expression - 34, // 59: RuleSet.rules:type_name -> Rule - 29, // 60: Identifier.IdentifierItem.index:type_name -> Expression - 33, // 61: Identifier.IdentifierItem.arguments:type_name -> Expressions - 62, // [62:62] is the sub-list for method output_type - 62, // [62:62] is the sub-list for method input_type - 62, // [62:62] is the sub-list for extension type_name - 62, // [62:62] is the sub-list for extension extendee - 0, // [0:62] is the sub-list for field type_name + 30, // 32: ForOfExpression.expression:type_name -> Expression + 18, // 33: ForOfExpression.range:type_name -> Range + 29, // 34: ForOfExpression.rule_enumeration:type_name -> RuleEnumeration + 28, // 35: StringSet.strings:type_name -> StringEnumeration + 2, // 36: StringSet.keyword:type_name -> StringSetKeyword + 37, // 37: StringEnumeration.items:type_name -> StringEnumeration.StringEnumerationItem + 38, // 38: RuleEnumeration.items:type_name -> RuleEnumeration.RuleEnumerationItem + 16, // 39: Expression.binary_expression:type_name -> BinaryExpression + 17, // 40: Expression.unary_expression:type_name -> UnaryExpression + 20, // 41: Expression.for_in_expression:type_name -> ForInExpression + 26, // 42: Expression.for_of_expression:type_name -> ForOfExpression + 30, // 43: Expression.not_expression:type_name -> Expression + 34, // 44: Expression.or_expression:type_name -> Expressions + 34, // 45: Expression.and_expression:type_name -> Expressions + 18, // 46: Expression.range:type_name -> Range + 10, // 47: Expression.regexp:type_name -> Regexp + 0, // 48: Expression.keyword:type_name -> Keyword + 31, // 49: Expression.string_offset:type_name -> StringOffset + 32, // 50: Expression.string_length:type_name -> StringLength + 33, // 51: Expression.identifier:type_name -> Identifier + 19, // 52: Expression.integer_function:type_name -> IntegerFunction + 24, // 53: Expression.percentage_expression:type_name -> Percentage + 30, // 54: StringOffset.index:type_name -> Expression + 30, // 55: StringLength.index:type_name -> Expression + 39, // 56: Identifier.items:type_name -> Identifier.IdentifierItem + 30, // 57: Expressions.terms:type_name -> Expression + 5, // 58: Rule.modifiers:type_name -> RuleModifiers + 6, // 59: Rule.meta:type_name -> Meta + 7, // 60: Rule.strings:type_name -> String + 30, // 61: Rule.condition:type_name -> Expression + 35, // 62: RuleSet.rules:type_name -> Rule + 30, // 63: Identifier.IdentifierItem.index:type_name -> Expression + 34, // 64: Identifier.IdentifierItem.arguments:type_name -> Expressions + 65, // [65:65] is the sub-list for method output_type + 65, // [65:65] is the sub-list for method input_type + 65, // [65:65] is the sub-list for extension type_name + 65, // [65:65] is the sub-list for extension extendee + 0, // [0:65] is the sub-list for field type_name } func init() { file_pb_yara_proto_init() } @@ -3777,7 +3927,7 @@ func file_pb_yara_proto_init() { } } file_pb_yara_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Expression); i { + switch v := v.(*RuleEnumeration); i { case 0: return &v.state case 1: @@ -3789,7 +3939,7 @@ func file_pb_yara_proto_init() { } } file_pb_yara_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StringOffset); i { + switch v := v.(*Expression); i { case 0: return &v.state case 1: @@ -3801,7 +3951,7 @@ func file_pb_yara_proto_init() { } } file_pb_yara_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StringLength); i { + switch v := v.(*StringOffset); i { case 0: return &v.state case 1: @@ -3813,7 +3963,7 @@ func file_pb_yara_proto_init() { } } file_pb_yara_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Identifier); i { + switch v := v.(*StringLength); i { case 0: return &v.state case 1: @@ -3825,7 +3975,7 @@ func file_pb_yara_proto_init() { } } file_pb_yara_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Expressions); i { + switch v := v.(*Identifier); i { case 0: return &v.state case 1: @@ -3837,7 +3987,7 @@ func file_pb_yara_proto_init() { } } file_pb_yara_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Rule); i { + switch v := v.(*Expressions); i { case 0: return &v.state case 1: @@ -3849,7 +3999,7 @@ func file_pb_yara_proto_init() { } } file_pb_yara_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RuleSet); i { + switch v := v.(*Rule); i { case 0: return &v.state case 1: @@ -3861,7 +4011,7 @@ func file_pb_yara_proto_init() { } } file_pb_yara_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StringEnumeration_StringEnumerationItem); i { + switch v := v.(*RuleSet); i { case 0: return &v.state case 1: @@ -3873,6 +4023,30 @@ func file_pb_yara_proto_init() { } } file_pb_yara_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StringEnumeration_StringEnumerationItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_yara_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RuleEnumeration_RuleEnumerationItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_yara_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Identifier_IdentifierItem); i { case 0: return &v.state @@ -3917,7 +4091,7 @@ func file_pb_yara_proto_init() { (*StringSet_Strings)(nil), (*StringSet_Keyword)(nil), } - file_pb_yara_proto_msgTypes[24].OneofWrappers = []interface{}{ + file_pb_yara_proto_msgTypes[25].OneofWrappers = []interface{}{ (*Expression_BoolValue)(nil), (*Expression_BinaryExpression)(nil), (*Expression_UnaryExpression)(nil), @@ -3940,7 +4114,7 @@ func file_pb_yara_proto_init() { (*Expression_IntegerFunction)(nil), (*Expression_PercentageExpression)(nil), } - file_pb_yara_proto_msgTypes[32].OneofWrappers = []interface{}{ + file_pb_yara_proto_msgTypes[34].OneofWrappers = []interface{}{ (*Identifier_IdentifierItem_Identifier)(nil), (*Identifier_IdentifierItem_Index)(nil), (*Identifier_IdentifierItem_Arguments)(nil), @@ -3951,7 +4125,7 @@ func file_pb_yara_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pb_yara_proto_rawDesc, NumEnums: 5, - NumMessages: 33, + NumMessages: 35, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/yara.proto b/pb/yara.proto index 58c3019..ea140b4 100644 --- a/pb/yara.proto +++ b/pb/yara.proto @@ -296,6 +296,13 @@ message ForOfExpression { // Expression to match: "(@$ > 10)" optional Expression expression = 3; + + // "3 of ($s1, $s2) in (0..100)" + optional Range range = 4; + + // Rule set: "(rule1, rule2, foo*)". + // Only one of StringSet or RuleEnumeration is allowed. + optional RuleEnumeration rule_enumeration = 5; } // Set of strings. Can be either an enumeration of strings or a keyword. @@ -327,6 +334,23 @@ message StringEnumeration { repeated StringEnumerationItem items = 1; } +// Set of rules, referenced by their identifier. +// A wildcard can be used to match multiple rules. +message RuleEnumeration { + // An entry in the rule enumeration. + message RuleEnumerationItem { + // Identifier or part of it if a wildcard (*) is used. + // Includes the wildcard if present. + optional string rule_identifier = 1; + + // Wildcard (*). + optional bool has_wildcard = 2; + } + + // Items in the rule enumeration. + repeated RuleEnumerationItem items = 1; +} + // Keywords used in expressions of rule condition. enum Keyword { UNKNOWN = 1; diff --git a/serialize.go b/serialize.go index c39da37..3ae43a6 100644 --- a/serialize.go +++ b/serialize.go @@ -743,6 +743,9 @@ func (ys *YaraSerializer) serializeRange(e *pb.Range) error { // Serializes a for..of expression func (ys *YaraSerializer) serializeForOfExpression(e *pb.ForOfExpression) error { + if (e.GetStringSet() == nil && e.GetRuleEnumeration() == nil) || (e.GetStringSet() != nil && e.GetRuleEnumeration() != nil) { + panic("expecting one string set or rule set in \"ForOf\"") + } if e.GetExpression() != nil { if err := ys.writeString("for "); err != nil { return err @@ -757,8 +760,25 @@ func (ys *YaraSerializer) serializeForOfExpression(e *pb.ForOfExpression) error return err } - if err := ys.serializeStringSet(e.StringSet); err != nil { - return err + if e.GetStringSet() != nil { + if err := ys.serializeStringSet(e.StringSet); err != nil { + return err + } + } + + if e.GetRuleEnumeration() != nil { + if err := ys.serializeRuleEnumeration(e.RuleEnumeration); err != nil { + return err + } + } + + if e.GetRange() != nil { + if err := ys.writeString(" in "); err != nil { + return err + } + if err := ys.serializeRange(e.Range); err != nil { + return err + } } if e.GetExpression() != nil { @@ -820,6 +840,26 @@ func (ys *YaraSerializer) serializeKeyword(e pb.Keyword) error { return ys.writeString(kw) } +// Serializes a RuleEnumeration. +func (ys *YaraSerializer) serializeRuleEnumeration(e *pb.RuleEnumeration) error { + if err := ys.writeString("("); err != nil { + return err + } + + for i, item := range e.GetItems() { + if err := ys.writeString(item.GetRuleIdentifier()); err != nil { + return err + } + if i < len(e.GetItems())-1 { + if err := ys.writeString(", "); err != nil { + return err + } + } + } + + return ys.writeString(")") +} + // Serializes a ForKeyword. func (ys *YaraSerializer) serializeForKeyword(e pb.ForKeyword) error { kw, ok := forKeywords[e] diff --git a/tests/grammar_test.go b/tests/grammar_test.go index fae0c1f..10d2775 100644 --- a/tests/grammar_test.go +++ b/tests/grammar_test.go @@ -278,6 +278,31 @@ rule PERCENT_OF_IDENTIFIER { condition: x% of them } + +rule STRING_COUNT_IN_RANGE { + strings: + $s0 = "AXSERS" + condition: + #s0 in (0..100) == 2 +} + +rule STRING_SET_IN_RANGE { + strings: + $s0 = "AXSERS" + $s0 = "WXSMTS" + condition: + any of ($s0) in (0..100) +} + +rule RULE_SET { + condition: + any of (KEYWORD_NONE, STRING_*) +} + +rule RULE_SET_PERCENT { + condition: + 50% of (PERCENT*) +} ` func TestRulesetParsing(t *testing.T) {