From 56e9cc8db71f8af949123e13e6a97cc056cf766d Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 7 Oct 2014 18:25:04 +0200 Subject: Solidity parser, can not parse much yet. --- BaseTypes.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 BaseTypes.h (limited to 'BaseTypes.h') diff --git a/BaseTypes.h b/BaseTypes.h new file mode 100644 index 00000000..0cc7f853 --- /dev/null +++ b/BaseTypes.h @@ -0,0 +1,22 @@ +#pragma once + + +namespace dev { +namespace solidity { + +// Representation of an interval of source positions. +struct Location { + Location(int b, int e) : beg_pos(b), end_pos(e) { } + Location() : beg_pos(0), end_pos(0) { } + + bool IsValid() const { + return beg_pos >= 0 && end_pos >= beg_pos; + } + + static Location invalid() { return Location(-1, -1); } + + int beg_pos; + int end_pos; +}; + +} } -- cgit v1.2.3