aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis/ReferencesResolver.h
diff options
context:
space:
mode:
authorLianaHus <liana@ethdev.com>2015-10-27 00:31:35 +0800
committerLianaHus <liana@ethdev.com>2015-11-07 01:45:06 +0800
commit1a27bf8a39309a1d777276e8a7c3514d80c01a5f (patch)
tree8f9cc3cce2044f5f6ee94b5770f3dd3e825467fb /libsolidity/analysis/ReferencesResolver.h
parent48ffa087837e19fd1cfa006ccb0737f07e735f0b (diff)
downloaddexon-solidity-1a27bf8a39309a1d777276e8a7c3514d80c01a5f.tar.gz
dexon-solidity-1a27bf8a39309a1d777276e8a7c3514d80c01a5f.tar.zst
dexon-solidity-1a27bf8a39309a1d777276e8a7c3514d80c01a5f.zip
added errors tu ReferencesResolver
Diffstat (limited to 'libsolidity/analysis/ReferencesResolver.h')
-rw-r--r--libsolidity/analysis/ReferencesResolver.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.h b/libsolidity/analysis/ReferencesResolver.h
index 4276adaa..13d5a47a 100644
--- a/libsolidity/analysis/ReferencesResolver.h
+++ b/libsolidity/analysis/ReferencesResolver.h
@@ -43,12 +43,25 @@ class ReferencesResolver: private ASTConstVisitor
{
public:
ReferencesResolver(
- ASTNode& _root,
+ ErrorList& _errors,
NameAndTypeResolver& _resolver,
ContractDefinition const* _currentContract,
ParameterList const* _returnParameters,
bool _resolveInsideCode = false
- );
+ ):
+ m_errors(_errors),
+ m_resolver(_resolver),
+ m_currentContract(_currentContract),
+ m_returnParameters(_returnParameters),
+ m_resolveInsideCode(_resolveInsideCode)
+ {}
+
+ /// @returns true if no errors during resolving
+ bool resolve(ASTNode& _root)
+ {
+ _root.accept(*this);
+ return m_errors.empty();
+ }
private:
virtual bool visit(Block const&) override { return m_resolveInsideCode; }
@@ -59,6 +72,13 @@ private:
TypePointer typeFor(TypeName const& _typeName);
+ /// Adds a new error to the list of errors.
+ void typeError(std::string const& _description);
+
+ /// Adds a new error to the list of errors and throws to abort type checking.
+ void fatalTypeError(std::string const& _description);
+
+ ErrorList& m_errors;
NameAndTypeResolver& m_resolver;
ContractDefinition const* m_currentContract;
ParameterList const* m_returnParameters;