Пример #1
0
""" 
free function call parser

This module implements all functionality necessary to parse C++ free function 
invocation. In other words this module is able to extract next information from 
the string like this C{ print_message( message ) }.
    - name ( print_message )
    - list of arguments ( message )

This module also defines few convenience function like L{split} and L{join}.
"""

import pattern_parser

__THE_PARSER = pattern_parser.parser_t( '(', ')', ',' )

def is_call_invocation( decl_string ):
    """
    returns True if decl_string is function invocation and False otherwise
    
    @param decl_string: string that should be checked for pattern presence
    @type decl_string: str
    
    @return: bool
    """
    global __THE_PARSER
    return __THE_PARSER.has_pattern( decl_string )

def name( decl_string ):
    """
Пример #2
0
# http://www.boost.org/LICENSE_1_0.txt)
""" 
template instantiation parser

This module implements all functionality necessary to parse C++ template
instantiations.In other words this module is able to extract next information from 
the string like this C{ std::vector<int> }.
    - name ( std::vector )
    - list of arguments ( int )

This module also defines few convenience function like L{split} and L{join}.
"""

import pattern_parser

__THE_PARSER = pattern_parser.parser_t('<', '>', ',')


def is_instantiation(decl_string):
    """
    returns True if decl_string is template instantiation and False otherwise
    
    @param decl_string: string that should be checked for pattern presence
    @type decl_string: str
    
    @return: bool
    """
    global __THE_PARSER
    return __THE_PARSER.has_pattern(decl_string)

Пример #3
0
""" 
template instantiation parser

This module implements all functionality necessary to parse C++ template
instantiations.In other words this module is able to extract next information from 
the string like this C{ std::vector<int> }.
    - name ( std::vector )
    - list of arguments ( int )

This module also defines few convenience function like L{split} and L{join}.
"""

import pattern_parser

__THE_PARSER = pattern_parser.parser_t( '<', '>', ',' )

def is_instantiation( decl_string ):
    """
    returns True if decl_string is template instantiation and False otherwise
    
    @param decl_string: string that should be checked for pattern presence
    @type decl_string: str
    
    @return: bool
    """
    global __THE_PARSER
    return __THE_PARSER.has_pattern( decl_string )

def name( decl_string ):
    """