Ejemplo n.º 1
0
def _enum():
    return (
        _ENUM
        + pyparsing.Optional(_IDENTIFIER).setResultsName("id")
        + parsers.anything_in_curly()
        + _SEMICOLON
    ).setResultsName("_enum")
Ejemplo 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()
Ejemplo n.º 3
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")
Ejemplo n.º 4
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")
Ejemplo n.º 5
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")
Ejemplo n.º 6
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()
Ejemplo n.º 7
0
def _enum():
    return (_ENUM + pyparsing.Optional(_IDENTIFIER).setResultsName("id") +
            parsers.anything_in_curly() + _SEMICOLON).setResultsName("_enum")
Ejemplo n.º 8
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")