File: example.rst

package info (click to toggle)
pygccxml 3.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,444 kB
  • sloc: xml: 29,841; python: 13,914; cpp: 2,671; makefile: 163; ansic: 59
file content (16 lines) | stat: -rw-r--r-- 616 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
================================
Parsing a string containing code
================================

This example shows how to setup pygccxml to parse a string containing c++ code,
and how to access the declaration tree. Often, pygccxml is used to parse files
containing code, but there may be reasons to parse a string (for example
for debugging purposes).

The following code will show you how to create a configuration for
the xml generator (an external tool, either castxml or gccxml),
and how to parse the string containing the c++ code:

.. literalinclude:: example.py
   :language: python
   :lines: 6,7,8,12-