Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matching some expressions out of an expression array #1338

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,771 changes: 1,516 additions & 1,255 deletions libyara/grammar.c

Large diffs are not rendered by default.

134 changes: 72 additions & 62 deletions libyara/grammar.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* A Bison parser, made by GNU Bison 3.0.5. */
/* A Bison parser, made by GNU Bison 3.6.4. */

/* Bison interface for Yacc-like parsers in C

Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
Inc.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -30,6 +31,10 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */

/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
especially those whose name start with YY_ or yy_. They are
private implementation details that can be changed or removed. */

#ifndef YY_YARA_YY_GRAMMAR_H_INCLUDED
# define YY_YARA_YY_GRAMMAR_H_INCLUDED
/* Debug traces. */
Expand All @@ -40,69 +45,75 @@
extern int yara_yydebug;
#endif

/* Token type. */
/* Token kinds. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
_END_OF_FILE_ = 0,
_END_OF_INCLUDED_FILE_ = 258,
_DOT_DOT_ = 259,
_RULE_ = 260,
_PRIVATE_ = 261,
_GLOBAL_ = 262,
_META_ = 263,
_STRINGS_ = 264,
_CONDITION_ = 265,
_IDENTIFIER_ = 266,
_STRING_IDENTIFIER_ = 267,
_STRING_COUNT_ = 268,
_STRING_OFFSET_ = 269,
_STRING_LENGTH_ = 270,
_STRING_IDENTIFIER_WITH_WILDCARD_ = 271,
_NUMBER_ = 272,
_DOUBLE_ = 273,
_INTEGER_FUNCTION_ = 274,
_TEXT_STRING_ = 275,
_HEX_STRING_ = 276,
_REGEXP_ = 277,
_ASCII_ = 278,
_WIDE_ = 279,
_XOR_ = 280,
_BASE64_ = 281,
_BASE64_WIDE_ = 282,
_NOCASE_ = 283,
_FULLWORD_ = 284,
_AT_ = 285,
_FILESIZE_ = 286,
_ENTRYPOINT_ = 287,
_ALL_ = 288,
_ANY_ = 289,
_IN_ = 290,
_OF_ = 291,
_FOR_ = 292,
_THEM_ = 293,
_MATCHES_ = 294,
_CONTAINS_ = 295,
_IMPORT_ = 296,
_TRUE_ = 297,
_FALSE_ = 298,
_OR_ = 299,
_AND_ = 300,
_NOT_ = 301,
_EQ_ = 302,
_NEQ_ = 303,
_LT_ = 304,
_LE_ = 305,
_GT_ = 306,
_GE_ = 307,
_SHIFT_LEFT_ = 308,
_SHIFT_RIGHT_ = 309,
UNARY_MINUS = 310
YYEMPTY = -2,
_END_OF_FILE_ = 0, /* "end of file" */
YYerror = 256, /* error */
YYUNDEF = 257, /* "invalid token" */
_END_OF_INCLUDED_FILE_ = 258, /* "end of included file" */
_DOT_DOT_ = 259, /* ".." */
_RULE_ = 260, /* "<rule>" */
_PRIVATE_ = 261, /* "<private>" */
_GLOBAL_ = 262, /* "<global>" */
_META_ = 263, /* "<meta>" */
_STRINGS_ = 264, /* "<strings>" */
_CONDITION_ = 265, /* "<condition>" */
_IDENTIFIER_ = 266, /* "identifier" */
_STRING_IDENTIFIER_ = 267, /* "string identifier" */
_STRING_COUNT_ = 268, /* "string count" */
_STRING_OFFSET_ = 269, /* "string offset" */
_STRING_LENGTH_ = 270, /* "string length" */
_STRING_IDENTIFIER_WITH_WILDCARD_ = 271, /* "string identifier with wildcard" */
_NUMBER_ = 272, /* "integer number" */
_DOUBLE_ = 273, /* "floating point number" */
_INTEGER_FUNCTION_ = 274, /* "integer function" */
_TEXT_STRING_ = 275, /* "text string" */
_HEX_STRING_ = 276, /* "hex string" */
_REGEXP_ = 277, /* "regular expression" */
_ASCII_ = 278, /* "<ascii>" */
_WIDE_ = 279, /* "<wide>" */
_XOR_ = 280, /* "<xor>" */
_BASE64_ = 281, /* "<base64>" */
_BASE64_WIDE_ = 282, /* "<base64wide>" */
_NOCASE_ = 283, /* "<nocase>" */
_FULLWORD_ = 284, /* "<fullword>" */
_AT_ = 285, /* "<at>" */
_FILESIZE_ = 286, /* "<filesize>" */
_ENTRYPOINT_ = 287, /* "<entrypoint>" */
_ALL_ = 288, /* "<all>" */
_ANY_ = 289, /* "<any>" */
_IN_ = 290, /* "<in>" */
_OF_ = 291, /* "<of>" */
_FOR_ = 292, /* "<for>" */
_THEM_ = 293, /* "<them>" */
_MATCHES_ = 294, /* "<matches>" */
_CONTAINS_ = 295, /* "<contains>" */
_IMPORT_ = 296, /* "<import>" */
_TRUE_ = 297, /* "<true>" */
_FALSE_ = 298, /* "<false" */
_OR_ = 299, /* "<or>" */
_AND_ = 300, /* "<and>" */
_NOT_ = 301, /* "<not>" */
_EQ_ = 302, /* "==" */
_NEQ_ = 303, /* "!=" */
_LT_ = 304, /* "<" */
_LE_ = 305, /* "<=" */
_GT_ = 306, /* ">" */
_GE_ = 307, /* ">=" */
_SHIFT_LEFT_ = 308, /* "<<" */
_SHIFT_RIGHT_ = 309, /* ">>" */
UNARY_MINUS = 310 /* UNARY_MINUS */
};
typedef enum yytokentype yytoken_kind_t;
#endif
/* Tokens. */
/* Token kinds. */
#define _END_OF_FILE_ 0
#define YYerror 256
#define YYUNDEF 257
#define _END_OF_INCLUDED_FILE_ 258
#define _DOT_DOT_ 259
#define _RULE_ 260
Expand Down Expand Up @@ -159,10 +170,9 @@ extern int yara_yydebug;

/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED

union YYSTYPE
{
#line 297 "grammar.y" /* yacc.c:1916 */
#line 294 "grammar.y"

YR_EXPRESSION expression;
SIZED_STRING* sized_string;
Expand All @@ -176,9 +186,9 @@ union YYSTYPE
YR_ARENA_REF meta;
YR_ARENA_REF string;

#line 180 "grammar.h" /* yacc.c:1916 */
};
#line 190 "grammar.h"

};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
Expand Down
Loading