Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 1 KB

custom.rst

File metadata and controls

44 lines (31 loc) · 1 KB

Custom parsing

For many users, the data provided by the simple API is enough. In some advanced cases you may find it necessary to use this more customizable parsing mechanism.

First, define a visitor that implements the CxxVisitor protocol. Then you can create an instance of it and pass it to the CxxParser.

visitor = MyVisitor()
parser = CxxParser(filename, content, visitor)
parser.parse()

# do something with the data collected by the visitor

Your visitor should do something with the data as the various callbacks are called. See the SimpleCxxVisitor for inspiration.

API

cxxheaderparser.parser

cxxheaderparser.visitor

Parser state

cxxheaderparser.parserstate

Preprocessor

cxxheaderparser.preprocessor