Esempio n. 1
0
def _enum():
    return (
        _ENUM
        + pyparsing.Optional(_IDENTIFIER).setResultsName("id")
        + parsers.anything_in_curly()
        + _SEMICOLON
    ).setResultsName("_enum")
Esempio n. 2
0
 def static_function(self):
     return (
         (pyparsing.Keyword("static") | pyparsing.Keyword("inline"))
         + pyparsing.OneOrMore(pyparsing.Word(pyparsing.alphanums + "_*&"))
         + parsers.anything_in_parentheses()
         + parsers.anything_in_curly()
     ).suppress()
Esempio n. 3
0
def _struct_definition():
    return (
        (_STRUCT.setResultsName("type") | _UNION.setResultsName("type"))
        + _IDENTIFIER.setResultsName("name")
        + parsers.anything_in_curly()
        + pyparsing.SkipTo(_SEMICOLON)
        + _SEMICOLON
    ).setResultsName("_struct_definition")
Esempio n. 4
0
def _struct_typedef():
    return (
        _TYPEDEF
        + (_STRUCT.setResultsName("type") | _UNION.setResultsName("type"))
        + pyparsing.Optional(_IDENTIFIER).setResultsName("id")
        + parsers.anything_in_curly()
        + pyparsing.Optional(_STAR)
        + _IDENTIFIER.setResultsName("typedef_name")
        + pyparsing.SkipTo(_SEMICOLON)
        + _SEMICOLON
    ).setResultsName("_struct_typedef")