-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
203 changed files
with
4,172 additions
and
21,738 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
*.pyc | ||
*~ | ||
docs/_build | ||
unittests/temp | ||
unittests/data/pygccxml.cache | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Contributors | ||
------------ | ||
|
||
Thanks to all the people that have contributed patches, bug reports and suggestions, | ||
or supported this project: | ||
|
||
* Roman Yakovenko (original author) | ||
* Roman Yakovenko's wife - Yulia | ||
* Michka Popoff | ||
* Brad King | ||
* Matt Mccormick | ||
* Mark Moll | ||
* Holger Frydrych | ||
* John Pallister | ||
* Matthias Baas | ||
* Allen Bierbaum | ||
* Georgiy Dernovoy | ||
* Darren Garnier | ||
* Gottfried Ganssauge | ||
* Gaetan Lehmann | ||
* Martin Preisler | ||
* Miguel Lobo | ||
* Jeremy Sanders | ||
* Ben Schleimer | ||
* Gustavo Carneiro | ||
* Christopher Bruns | ||
* Alejandro Dubrovsky | ||
* Aron Xu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
======== | ||
Examples | ||
======== | ||
|
||
First examples | ||
-------------- | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
examples/parsing/example.rst | ||
examples/variables/example.rst | ||
examples/caching/example.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright 2014-2015 Insight Software Consortium. | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// See http://www.boost.org/LICENSE_1_0.txt | ||
|
||
namespace ns{ | ||
int a = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright 2014-2015 Insight Software Consortium. | ||
# Distributed under the Boost Software License, Version 1.0. | ||
# See http://www.boost.org/LICENSE_1_0.txt | ||
|
||
from pygccxml import utils | ||
from pygccxml import declarations | ||
from pygccxml import parser | ||
|
||
# Find out the c++ parser | ||
generator_path, generator_name = utils.find_xml_generator() | ||
|
||
# Configure the xml generator | ||
xml_generator_config = parser.xml_generator_configuration_t( | ||
xml_generator_path=generator_path, | ||
xml_generator=generator_name) | ||
|
||
# The c++ file we want to parse | ||
filename = "example.hpp" | ||
|
||
file_config = parser.file_configuration_t( | ||
data=filename, | ||
content_type=parser.CONTENT_TYPE.CACHED_SOURCE_FILE) | ||
|
||
project_reader = parser.project_reader_t(xml_generator_config) | ||
decls = project_reader.read_files( | ||
[file_config], | ||
compilation_mode=parser.COMPILATION_MODE.FILE_BY_FILE) | ||
|
||
global_namespace = declarations.get_global_namespace(decls) | ||
|
||
value = global_namespace.namespace("ns") | ||
print("My name is: " + value.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
======= | ||
Caching | ||
======= | ||
|
||
This example shows how to use caching. This can be useful | ||
for big projects where you don't want the c++ to be parsed | ||
again and again. | ||
|
||
Let's consider the following c++ file: | ||
|
||
.. literalinclude:: example.hpp | ||
:language: c++ | ||
|
||
To enable caching, you can use the following code: | ||
|
||
.. literalinclude:: example.py | ||
:language: python | ||
|
||
The first time you run this example, the c++ file will be read and a xml | ||
file will be generated: | ||
|
||
INFO Creating xml file "example.hpp.xml" from source file "example.hpp" ... | ||
INFO Parsing xml file "example.hpp.xml" ... | ||
My name is: ns | ||
|
||
The second time you run the example the xml file will not be regenerated: | ||
|
||
INFO Parsing xml file "example.hpp.xml" ... | ||
My name is: ns | ||
|
||
Of course the performance gain will be small for this example, | ||
but can be intersting for bigger projects. |
Oops, something went wrong.