aboutsummaryrefslogtreecommitdiffstats
path: root/BaseTypes.h
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-10-08 00:25:04 +0800
committerChristian <c@ethdev.com>2014-10-08 19:49:34 +0800
commit56e9cc8db71f8af949123e13e6a97cc056cf766d (patch)
tree6fc043aaa6b9562ab0d1de8f2aa51e6d99c8ab6b /BaseTypes.h
parentef59373871528ac72c447e5f014aa18a1f3776e5 (diff)
downloaddexon-solidity-56e9cc8db71f8af949123e13e6a97cc056cf766d.tar
dexon-solidity-56e9cc8db71f8af949123e13e6a97cc056cf766d.tar.gz
dexon-solidity-56e9cc8db71f8af949123e13e6a97cc056cf766d.tar.bz2
dexon-solidity-56e9cc8db71f8af949123e13e6a97cc056cf766d.tar.lz
dexon-solidity-56e9cc8db71f8af949123e13e6a97cc056cf766d.tar.xz
dexon-solidity-56e9cc8db71f8af949123e13e6a97cc056cf766d.tar.zst
dexon-solidity-56e9cc8db71f8af949123e13e6a97cc056cf766d.zip
Solidity parser, can not parse much yet.
Diffstat (limited to 'BaseTypes.h')
-rw-r--r--BaseTypes.h22
1 files changed, 22 insertions, 0 deletions
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;
+};
+
+} }