Revert "Try to fix the type rewriter."

This reverts commit 33b19f0210.
This commit is contained in:
Roberto Raggi
2010-07-20 14:23:46 +02:00
parent 99e862cfc9
commit c9bc1e7c64
4 changed files with 61 additions and 122 deletions

View File

@@ -51,27 +51,51 @@ public:
class CPLUSPLUS_EXPORT SubstitutionEnvironment
{
Q_DISABLE_COPY(SubstitutionEnvironment)
QList<Substitution *> substs;
public:
SubstitutionEnvironment();
SubstitutionEnvironment() {}
FullySpecifiedType apply(const Name *name, Rewrite *rewrite) const;
FullySpecifiedType apply(const Name *name, Rewrite *rewrite) const
{
if (name) {
for (int index = substs.size() - 1; index != -1; --index) {
const Substitution *subst = substs.at(index);
void enter(Substitution *subst);
void leave();
FullySpecifiedType ty = subst->apply(name, rewrite);
if (! ty->isUndefinedType())
return ty;
}
}
Scope *scope() const;
Scope *switchScope(Scope *scope);
return FullySpecifiedType();
}
const LookupContext &context() const;
void setContext(const LookupContext &context);
void enter(Substitution *subst)
{
substs.append(subst);
}
void leave()
{
substs.removeLast();
}
};
class CPLUSPLUS_EXPORT ContextSubstitution: public Substitution
{
public:
ContextSubstitution(const LookupContext &context, Scope *scope);
virtual ~ContextSubstitution();
virtual FullySpecifiedType apply(const Name *name, Rewrite *rewrite) const;
private:
QList<Substitution *> _substs;
Scope *_scope;
LookupContext _context;
Scope *_scope;
};
class CPLUSPLUS_EXPORT SubstitutionMap: public Substitution
{
public:
@@ -85,17 +109,6 @@ private:
QList<QPair<const Name *, FullySpecifiedType> > _map;
};
class CPLUSPLUS_EXPORT UseQualifiedNames: public Substitution
{
public:
UseQualifiedNames();
virtual ~UseQualifiedNames();
virtual FullySpecifiedType apply(const Name *name, Rewrite *rewrite) const;
};
CPLUSPLUS_EXPORT FullySpecifiedType rewriteType(const FullySpecifiedType &type,
SubstitutionEnvironment *env,
Control *control);