|
Envision
A visual programming IDE for object-oriented languages
|
holds the clang::SourceManager and clang::Preprocessor during macro import. More...
Public Member Functions | |
| ClangHelpers (OOModel::Project *rootProject, QString rootProjectPath) | |
| QList< QString > | argumentNames (const clang::MacroDirective *definition) const |
| void | associateNodeWithPresumedFileLocation (Model::Node *node, clang::SourceLocation location) |
| associate node with the presumed filename at location. More... | |
| void | associateNodeWithPresumedFileLocation (Model::Node *node, Model::Node *from) |
| use the stored filename information of from and copy it to be the filename information of node. More... | |
| void | attachDeclarationComments (clang::NamedDecl *namedDecl, Model::Node *receiver) const |
| QList< Comment * > & | comments () |
| template<typename NodeType , typename ... ConstructorArgTypes> | |
| NodeType * | createNamedNode (clang::NamedDecl *namedDecl, ConstructorArgTypes &&... constructorArgs) |
| template<typename NodeType , typename ... ConstructorArgTypes> | |
| NodeType * | createNode (clang::SourceRange sourceRange, ConstructorArgTypes &&... constructorArgs) |
| OOModel::ReferenceExpression * | createReference (clang::SourceRange sourceRange) |
| void | deleteNode (Model::Node *node) |
| EnvisionToClangMap & | envisionToClangMap () |
| void | exportMergeMapToJson (QString filename) |
| export the node to filename map to a file. More... | |
| clang::SourceRange | getUnexpandedRange (clang::SourceRange sourceRange) const |
| given a source range calculates the source range corresponding to the code expanded there. More... | |
| clang::SourceLocation | immediateMacroLocation (clang::SourceLocation location) const |
| void | immediateSpellingHistory (clang::SourceLocation location, QList< clang::SourceLocation > &result) const |
| void | insertDeclarationInFolder (OOModel::Declaration *declaration, clang::SourceLocation location, OOModel::Declaration *parentNonFolderDeclaration) |
| bool | isMacroRange (clang::SourceRange range) const |
| const clang::Preprocessor * | preprocessor () const |
| QString | presumedFilenameWithExtension (clang::SourceLocation location) const |
| QString | presumedFilenameWithoutExtension (clang::SourceLocation location) const |
| void | printMacroDefinitionForDebug (const clang::MacroDirective *macroDirective) const |
| OOModel::Project * | projectByName (const QString &name) |
| OOModel::Project * | projectForLocation (clang::SourceLocation location) |
| QString | projectNameFromPath (QString path) |
| OOModel::Project * | rootProject () |
| const QString & | rootProjectPath () |
| void | setPreprocessor (const clang::Preprocessor *preprocessor) |
| void | setSourceManager (const clang::SourceManager *sourceManager) |
| const clang::SourceManager * | sourceManager () const |
| QString | spelling (clang::SourceRange sourceRange) const |
| QString | unexpandedSpelling (clang::SourceLocation start, clang::SourceLocation end) const |
| QString | unexpandedSpelling (clang::SourceRange range) const |
Private Member Functions | |
| OOModel::Declaration * | folderForLocation (clang::SourceLocation location, OOModel::Declaration *parentNonFolderDeclaration) |
| QStringList | folderNamesFromPath (QString path) |
Static Private Member Functions | |
| static QString | jsonEscape (QString string) |
Private Attributes | |
| QList< Comment * > | comments_ |
| EnvisionToClangMap | envisionToClangMap_ |
| QHash< Model::Node *, QString > | nodeToFilenameMap_ |
| used for exporting an automatically generated merge map More... | |
| const clang::Preprocessor * | preprocessor_ {} |
| QHash< QString, OOModel::Project * > | projects_ |
| OOModel::Project * | rootProject_ {} |
| QString | rootProjectPath_ {} |
| const clang::SourceManager * | sourceManager_ {} |
holds the clang::SourceManager and clang::Preprocessor during macro import.
it provides helper methods that only depend on the SourceManager and Preprocessor.
| CppImport::ClangHelpers::ClangHelpers | ( | OOModel::Project * | rootProject, |
| QString | rootProjectPath | ||
| ) |
| QList< QString > CppImport::ClangHelpers::argumentNames | ( | const clang::MacroDirective * | definition | ) | const |
| void CppImport::ClangHelpers::associateNodeWithPresumedFileLocation | ( | Model::Node * | node, |
| clang::SourceLocation | location | ||
| ) |
associate node with the presumed filename at location.
used to automatically generate a merge map.
| void CppImport::ClangHelpers::associateNodeWithPresumedFileLocation | ( | Model::Node * | node, |
| Model::Node * | from | ||
| ) |
use the stored filename information of from and copy it to be the filename information of node.
used to automatically generate a merge map.
| void CppImport::ClangHelpers::attachDeclarationComments | ( | clang::NamedDecl * | namedDecl, |
| Model::Node * | receiver | ||
| ) | const |
|
inline |
|
inline |
| NodeType * CppImport::ClangHelpers::createNode | ( | clang::SourceRange | sourceRange, |
| ConstructorArgTypes &&... | constructorArgs | ||
| ) |
|
inline |
| void CppImport::ClangHelpers::deleteNode | ( | Model::Node * | node | ) |
|
inline |
| void CppImport::ClangHelpers::exportMergeMapToJson | ( | QString | filename | ) |
export the node to filename map to a file.
|
private |
|
private |
| clang::SourceRange CppImport::ClangHelpers::getUnexpandedRange | ( | clang::SourceRange | sourceRange | ) | const |
given a source range calculates the source range corresponding to the code expanded there.
Example: Macro argument:
start| |end
1+2 == 3
| |
| \
Condition
out_start| |out_end
Example: Concatenated tokens:
start| |end (start != end)
Door::open
/ \
/ \
Do##or::##open
|out_start |out_end
start||end (start == end)
Door
/\___
| \
Do##or
out_start| |out_end
| clang::SourceLocation CppImport::ClangHelpers::immediateMacroLocation | ( | clang::SourceLocation | location | ) | const |
| void CppImport::ClangHelpers::immediateSpellingHistory | ( | clang::SourceLocation | location, |
| QList< clang::SourceLocation > & | result | ||
| ) | const |
| void CppImport::ClangHelpers::insertDeclarationInFolder | ( | OOModel::Declaration * | declaration, |
| clang::SourceLocation | location, | ||
| OOModel::Declaration * | parentNonFolderDeclaration | ||
| ) |
|
inline |
|
staticprivate |
|
inline |
| QString CppImport::ClangHelpers::presumedFilenameWithExtension | ( | clang::SourceLocation | location | ) | const |
| QString CppImport::ClangHelpers::presumedFilenameWithoutExtension | ( | clang::SourceLocation | location | ) | const |
| void CppImport::ClangHelpers::printMacroDefinitionForDebug | ( | const clang::MacroDirective * | macroDirective | ) | const |
|
inline |
| OOModel::Project * CppImport::ClangHelpers::projectForLocation | ( | clang::SourceLocation | location | ) |
| QString CppImport::ClangHelpers::projectNameFromPath | ( | QString | path | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| QString CppImport::ClangHelpers::spelling | ( | clang::SourceRange | sourceRange | ) | const |
|
inline |
| QString CppImport::ClangHelpers::unexpandedSpelling | ( | clang::SourceRange | range | ) | const |
|
private |
|
private |
|
private |
used for exporting an automatically generated merge map
|
private |
|
private |
|
private |
|
private |
|
private |