aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-10-13 21:07:21 +0800
committerChristian <c@ethdev.com>2014-10-13 23:02:21 +0800
commit3e72f3d455951c447a92501d05380efe394f42f5 (patch)
tree765f53c22f1a28bf6eb2e3e1a80859a72078e956 /main.cpp
parent7ece4e4ed1b81f2c0410a7195efcde77842dcd31 (diff)
downloaddexon-solidity-3e72f3d455951c447a92501d05380efe394f42f5.tar
dexon-solidity-3e72f3d455951c447a92501d05380efe394f42f5.tar.gz
dexon-solidity-3e72f3d455951c447a92501d05380efe394f42f5.tar.bz2
dexon-solidity-3e72f3d455951c447a92501d05380efe394f42f5.tar.lz
dexon-solidity-3e72f3d455951c447a92501d05380efe394f42f5.tar.xz
dexon-solidity-3e72f3d455951c447a92501d05380efe394f42f5.tar.zst
dexon-solidity-3e72f3d455951c447a92501d05380efe394f42f5.zip
Name resolution.
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 6fca11a6..a92f466e 100644
--- a/main.cpp
+++ b/main.cpp
@@ -8,11 +8,12 @@
#include <libsolidity/Scanner.h>
#include <libsolidity/Parser.h>
#include <libsolidity/ASTPrinter.h>
+#include <libsolidity/NameAndTypeResolver.h>
namespace dev {
namespace solidity {
-ptr<ASTNode> parseAST(std::string const& _source)
+ptr<ContractDefinition> parseAST(std::string const& _source)
{
ptr<Scanner> scanner = std::make_shared<Scanner>(CharStream(_source));
Parser parser;
@@ -70,9 +71,12 @@ int main(int argc, char** argv)
std::cout << "Parsing..." << std::endl;
// @todo catch exception
- dev::solidity::ptr<dev::solidity::ASTNode> ast = dev::solidity::parseAST(src);
+ dev::solidity::ptr<dev::solidity::ContractDefinition> ast = dev::solidity::parseAST(src);
std::cout << "Syntax tree for the contract:" << std::endl;
dev::solidity::ASTPrinter printer(ast, src);
printer.print(std::cout);
+ std::cout << "Resolving identifiers..." << std::endl;
+ dev::solidity::NameAndTypeResolver resolver;
+ resolver.resolveNamesAndTypes(*ast.get());
return 0;
}