Envision
A visual programming IDE for object-oriented languages
|
This is a helper class for translation of types operators type arguments and similar simple constructs. More...
Public Types | |
enum class | OverloadKind : int { Unsupported , Unary , Binary , Assign , MethodCall , ReferenceExpr , Comma } |
Public Member Functions | |
CppImportUtilities (CppImportLogger *logger, ExpressionVisitor *visitor, ClangHelpers &clang) | |
OOModel::Expression * | createErrorExpression (const QString &reason, clang::SourceRange sourceRange) |
Creates an error expression which is clearly visible inside envision In envision it is represented as a red # and the reason string. More... | |
OverloadKind | getOverloadKind (const clang::OverloadedOperatorKind &overloadOpKind, unsigned numArgs) |
Determines the kind of an overload operation. More... | |
OOModel::ReferenceExpression * | setReferencePrefix (OOModel::ReferenceExpression *reference, clang::NestedNameSpecifierLoc nestedNameSpecifierLoc, clang::Expr *base=nullptr) |
OOModel::Modifier::ModifierFlag | translateAccessSpecifier (const clang::AccessSpecifier &acessSpecifier) |
OOModel::AssignmentExpression::AssignmentTypes | translateAssignOp (const clang::BinaryOperatorKind &assignOpKind) |
OOModel::AssignmentExpression::AssignmentTypes | translateAssignOverloadOp (const clang::OverloadedOperatorKind &overloadOpKind) |
OOModel::BinaryOperation::OperatorTypes | translateBinaryOp (const clang::BinaryOperatorKind &binaryOpKind) |
OOModel::BinaryOperation::OperatorTypes | translateBinaryOverloadOp (const clang::OverloadedOperatorKind &overloadOpKind) |
OOModel::MemberInitializer * | translateMemberInit (const clang::CXXCtorInitializer *initializer) |
OOModel::Expression * | translateNestedNameSpecifier (const clang::NestedNameSpecifierLoc nestedNameLoc, clang::Expr *base=nullptr) |
Translates nested name specifiers. More... | |
OOModel::Expression * | translateQualifiedType (clang::TypeLoc typeLoc) |
Translates a qualified type to the corresponding Envision type expression. More... | |
OOModel::Modifier::ModifierFlag | translateStorageSpecifier (const clang::StorageClass &storageClass) |
OOModel::Expression * | translateTemplateArgument (const clang::TemplateArgumentLoc &templateArgLoc) |
OOModel::UnaryOperation::OperatorTypes | translateUnaryOp (const clang::UnaryOperatorKind &unaryOpKind) |
OOModel::UnaryOperation::OperatorTypes | translateUnaryOverloadOp (const clang::OverloadedOperatorKind &overloadOpKind, const unsigned numArgs) |
Static Public Member Functions | |
static QString | overloadOperatorToString (const clang::OverloadedOperatorKind &overloadOpKind) |
Private Member Functions | |
clang::SourceRange | calculateSourceRangeWithQualifier (QString qualifier, clang::QualifiedTypeLoc qualifiedTypeLoc) |
OOModel::Expression * | translateBuiltInClangType (const clang::BuiltinTypeLoc typeLoc) |
Translates type to the nearest primitive OOModel type. More... | |
OOModel::Expression * | translateTypePtr (const clang::TypeLoc typeLoc) |
Private Attributes | |
ClangHelpers & | clang_ |
const QString | className_ {"CppImportUtilities"} |
ExpressionVisitor * | exprVisitor_ {} |
CppImportLogger * | log_ |
This is a helper class for translation of types operators type arguments and similar simple constructs.
|
strong |
CppImport::CppImportUtilities::CppImportUtilities | ( | CppImportLogger * | logger, |
ExpressionVisitor * | visitor, | ||
ClangHelpers & | clang | ||
) |
|
private |
OOModel::Expression * CppImport::CppImportUtilities::createErrorExpression | ( | const QString & | reason, |
clang::SourceRange | sourceRange | ||
) |
Creates an error expression which is clearly visible inside envision In envision it is represented as a red # and the reason string.
CppImportUtilities::OverloadKind CppImport::CppImportUtilities::getOverloadKind | ( | const clang::OverloadedOperatorKind & | overloadOpKind, |
unsigned | numArgs | ||
) |
Determines the kind of an overload operation.
e.g. an arrow will return ReferenceExpr
|
static |
OOModel::ReferenceExpression * CppImport::CppImportUtilities::setReferencePrefix | ( | OOModel::ReferenceExpression * | reference, |
clang::NestedNameSpecifierLoc | nestedNameSpecifierLoc, | ||
clang::Expr * | base = nullptr |
||
) |
OOModel::Modifier::ModifierFlag CppImport::CppImportUtilities::translateAccessSpecifier | ( | const clang::AccessSpecifier & | acessSpecifier | ) |
OOModel::AssignmentExpression::AssignmentTypes CppImport::CppImportUtilities::translateAssignOp | ( | const clang::BinaryOperatorKind & | assignOpKind | ) |
OOModel::AssignmentExpression::AssignmentTypes CppImport::CppImportUtilities::translateAssignOverloadOp | ( | const clang::OverloadedOperatorKind & | overloadOpKind | ) |
OOModel::BinaryOperation::OperatorTypes CppImport::CppImportUtilities::translateBinaryOp | ( | const clang::BinaryOperatorKind & | binaryOpKind | ) |
OOModel::BinaryOperation::OperatorTypes CppImport::CppImportUtilities::translateBinaryOverloadOp | ( | const clang::OverloadedOperatorKind & | overloadOpKind | ) |
|
private |
Translates type to the nearest primitive OOModel type.
OOModel::MemberInitializer * CppImport::CppImportUtilities::translateMemberInit | ( | const clang::CXXCtorInitializer * | initializer | ) |
OOModel::Expression * CppImport::CppImportUtilities::translateNestedNameSpecifier | ( | const clang::NestedNameSpecifierLoc | nestedNameLoc, |
clang::Expr * | base = nullptr |
||
) |
Translates nested name specifiers.
If there is abase specified it will be put as a prefix of the first namespecifier e.g. {
obj.A::ref } here obj would be the base and A the nestedName
OOModel::Expression * CppImport::CppImportUtilities::translateQualifiedType | ( | clang::TypeLoc | typeLoc | ) |
Translates a qualified type to the corresponding Envision type expression.
The location is used for warnings whenever translation fails, to report the file and line of the location.
OOModel::Modifier::ModifierFlag CppImport::CppImportUtilities::translateStorageSpecifier | ( | const clang::StorageClass & | storageClass | ) |
OOModel::Expression * CppImport::CppImportUtilities::translateTemplateArgument | ( | const clang::TemplateArgumentLoc & | templateArgLoc | ) |
|
private |
OOModel::UnaryOperation::OperatorTypes CppImport::CppImportUtilities::translateUnaryOp | ( | const clang::UnaryOperatorKind & | unaryOpKind | ) |
OOModel::UnaryOperation::OperatorTypes CppImport::CppImportUtilities::translateUnaryOverloadOp | ( | const clang::OverloadedOperatorKind & | overloadOpKind, |
const unsigned | numArgs | ||
) |
|
private |
|
private |
|
private |
|
private |