How to use the pycparserext.ext_c_lexer.OpenCLCLexer function in pycparserext

To help you get started, we’ve selected a few pycparserext examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inducer / pycparserext / pycparserext / ext_c_lexer.py View on Github external
cls.keyword_map.update(dict(
        (kw, kw.upper()) for kw in keywords))

    cls.tokens = cls.tokens + tuple(
            kw.upper() for kw in keywords)


add_lexer_keywords(GnuCLexer, [
    '__attribute__', '__asm__', '__asm', '__typeof__',
    '__real__', '__imag__', '__builtin_types_compatible_p',
    '__const', '__restrict', '__inline', '__inline__',
    '__extension__', 'asm', '__attribute'])

_CL_KEYWORDS = ['kernel', 'constant', 'global', 'local', 'private',
        "read_only", "write_only", "read_write"]
add_lexer_keywords(OpenCLCLexer, [
    '__attribute__', '__attribute', '__asm__', '__asm', 'asm']
    + _CL_KEYWORDS + ["__"+kw for kw in _CL_KEYWORDS])