コード例 #1
0
ファイル: expression_parser.py プロジェクト: almatr/rekall
 def _function_call(self):
     return (
         ~_TYPE_PROPERTY_KEYWORD
         + self._identifier()
         + _OPEN_PARENTHESIS
         + self._arguments()
         + _CLOSE_PARENTHESIS
     ).setParseAction(util.action(c_ast.CFunctionCall))
コード例 #2
0
 def _integer(self):
     integer = self._hexadecimal_as_string() | self._decimal_as_string()
     # Python does not care about suffixes so we just drop them.
     possible_suffix = pyparsing.Literal(
         'u') | 'U' | 'll' | 'LL' | 'l' | 'L'
     maybe_suffix = (pyparsing.ZeroOrMore(possible_suffix)).suppress()
     return (integer + maybe_suffix).setParseAction(
         util.action(lambda x: int(x, base=0)))
コード例 #3
0
ファイル: expression_parser.py プロジェクト: almatr/rekall
 def _integer(self):
     integer = self._hexadecimal_as_string() | self._decimal_as_string()
     # Python does not care about suffixes so we just drop them.
     possible_suffix = pyparsing.Literal('u') | 'U' | 'll' | 'LL' | 'l' | 'L'
     maybe_suffix = (
         pyparsing.ZeroOrMore(possible_suffix)
     ).suppress()
     return (
         integer
         + maybe_suffix
     ).setParseAction(util.action(lambda x: int(x, base=0)))
コード例 #4
0
 def _number(self):
     return self._integer().addParseAction(util.action(c_ast.CNumber))
コード例 #5
0
 def _string_literal(self):
     return (pyparsing.dblQuotedString.copy()).setParseAction(
         util.action(c_ast.CLiteral))
コード例 #6
0
 def _variable(self):
     return (self._identifier()).addParseAction(util.action(
         c_ast.CVariable))
コード例 #7
0
 def _nested_expression(self):
     return (pyparsing.Literal('(') + self.expression +
             pyparsing.Literal(')')).setParseAction(
                 util.action(c_ast.CNestedExpression))
コード例 #8
0
 def _argument_with_dots(self):
     return (self._identifier_with_dots()).setParseAction(
         util.action(c_ast.CLiteral))
コード例 #9
0
 def _multiword_argument(self):
     return pyparsing.Group(
         self._variable() +
         pyparsing.OneOrMore(self._variable())).setParseAction(
             util.action(pre_ast.CompositeBlock))
コード例 #10
0
ファイル: expression_parser.py プロジェクト: almatr/rekall
 def _number(self):
     return self._integer().addParseAction(util.action(c_ast.CNumber))
コード例 #11
0
ファイル: expression_parser.py プロジェクト: almatr/rekall
 def _string_literal(self):
     return (
         pyparsing.dblQuotedString.copy()
     ).setParseAction(util.action(c_ast.CLiteral))
コード例 #12
0
ファイル: expression_parser.py プロジェクト: almatr/rekall
 def _variable(self):
     return (
         self._identifier()
     ).addParseAction(util.action(c_ast.CVariable))
コード例 #13
0
ファイル: expression_parser.py プロジェクト: almatr/rekall
 def _nested_expression(self):
     return (
         pyparsing.Literal('(')
         + self.expression
         + pyparsing.Literal(')')
     ).setParseAction(util.action(c_ast.CNestedExpression))
コード例 #14
0
ファイル: expression_parser.py プロジェクト: almatr/rekall
 def _argument_with_dots(self):
     return (
         self._identifier_with_dots()
     ).setParseAction(util.action(c_ast.CLiteral))
コード例 #15
0
ファイル: expression_parser.py プロジェクト: almatr/rekall
 def _multiword_argument(self):
     return pyparsing.Group(
         self._variable()
         + pyparsing.OneOrMore(self._variable())
     ).setParseAction(util.action(pre_ast.CompositeBlock))
コード例 #16
0
 def _function_call(self):
     return (~_TYPE_PROPERTY_KEYWORD + self._identifier() +
             _OPEN_PARENTHESIS + self._arguments() +
             _CLOSE_PARENTHESIS).setParseAction(
                 util.action(c_ast.CFunctionCall))
コード例 #17
0
ファイル: parser.py プロジェクト: almatr/rekall
 def _natural(self):
     return pyparsing.Word(pyparsing.nums).setParseAction(util.action(int))
コード例 #18
0
 def _natural(self):
     return pyparsing.Word(pyparsing.nums).setParseAction(util.action(int))