aboutsummaryrefslogtreecommitdiffstats
path: root/typesystem.h
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2009-10-20 10:08:26 -0200
committerLuciano Miguel Wolf <luciano.wolf@indt.org.br>2009-10-21 16:34:20 -0300
commit73f6ac4faafed5c8c275ff01a22a53bfbc7fc515 (patch)
treec69bcb1929325b040b3983a24fc349577ec79ab3 /typesystem.h
parentac27d38d44bef714b08d8b675ae105ac41047bfa (diff)
Implemented a signature parser for the AddedFunction class.
Diffstat (limited to 'typesystem.h')
-rw-r--r--typesystem.h35
1 files changed, 20 insertions, 15 deletions
diff --git a/typesystem.h b/typesystem.h
index 8a8f7277b..7f232ac93 100644
--- a/typesystem.h
+++ b/typesystem.h
@@ -35,7 +35,6 @@ class Indentor;
class AbstractMetaType;
class QTextStream;
-class TypeEntry;
class EnumTypeEntry;
class FlagsTypeEntry;
@@ -440,22 +439,27 @@ struct FieldModification: public Modification
QString name;
};
+
typedef QList<FieldModification> FieldModificationList;
struct AddedFunction
{
-
enum Access {
Private = 0x1,
Protected = 0x2,
Public = 0x3
};
- // ArgumentPair.first: argument name
- // ArgumentPair.second: default value
- typedef QPair<QString, QString> ArgumentPair;
+ struct TypeInfo {
+ TypeInfo() : isConst(false), indirections(0), isRef(false) {}
+ QString name;
+ bool isConst;
+ int indirections;
+ bool isRef;
+ QString defaultValue;
+ };
- AddedFunction(QString signature, TypeEntry* returnType = 0);
+ AddedFunction(QString signature, QString returnType);
QString name() const
{
@@ -472,12 +476,7 @@ struct AddedFunction
return m_access;
}
- void setReturnType(TypeEntry* returnType)
- {
- m_returnType = returnType;
- }
-
- TypeEntry* returnType() const
+ TypeInfo returnType() const
{
return m_returnType;
}
@@ -497,16 +496,21 @@ struct AddedFunction
m_codeSnips << codeSnip;
}
- QList<QPair<ArgumentPair, const TypeEntry*> > arguments()
+ QList<TypeInfo> arguments() const
{
return m_arguments;
}
+ bool isConst() const
+ {
+ return m_isConst;
+ }
private:
QString m_name;
Access m_access;
- QList<QPair<ArgumentPair, const TypeEntry*> > m_arguments;
- TypeEntry* m_returnType;
+ QList<TypeInfo> m_arguments;
+ TypeInfo m_returnType;
+ bool m_isConst;
CodeSnipList m_codeSnips;
};
typedef QList<AddedFunction> AddedFunctionList;
@@ -595,6 +599,7 @@ public:
ArrayType,
TypeSystemType,
CustomType,
+ TargetLangType
};
enum CodeGeneration {