/usr/lib/python2.7/dist-packages/pygccxml/declarations/call_invocation.py is in python-pygccxml 1.8.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | # Copyright 2014-2016 Insight Software Consortium.
# Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
"""
Free function invocation parser
The parser is able to extract function name and list of arguments from a
function invocation statement. For example, for the following code
.. code-block:: c++
do_something( x1, x2, x3 )
the parser will extract
- function name - `do_something`
- argument names - `[ x1, x2, x3 ]`
"""
from . import pattern_parser
__THE_PARSER = pattern_parser.parser_t('(', ')', ',')
def is_call_invocation(declaration_string):
"""
Returns True if `declaration_string` is a function invocation.
:param declaration_string: string that should be checked for pattern.
:type declaration_string: str
:rtype: bool
"""
return __THE_PARSER.has_pattern(declaration_string)
def name(declaration_string):
"""
Returns the name of a function.
:type declaration_string: str
:rtype: str
"""
return __THE_PARSER.name(declaration_string)
def args(declaration_string):
"""
Returns list of function arguments
:type declaration_string: str
:rtype: [str]
"""
return __THE_PARSER.args(declaration_string)
NOT_FOUND = __THE_PARSER.NOT_FOUND
def find_args(text, start=None):
"""
Finds arguments within function invocation.
:type text: str
:rtype: [ arguments ] or :data:NOT_FOUND if arguments could not be found.
"""
return __THE_PARSER.find_args(text, start)
def split(declaration_string):
"""
Returns (name, [arguments] )
"""
return __THE_PARSER.split(declaration_string)
def split_recursive(declaration_string):
"""
Returns [(name, [arguments])].
"""
return __THE_PARSER.split_recursive(declaration_string)
def join(name, args, arg_separator=None):
"""
Returns name( argument_1, argument_2, ..., argument_n ).
"""
return __THE_PARSER.join(name, args, arg_separator)
|