aboutsummaryrefslogtreecommitdiffstats
path: root/main/utils
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2016-06-13 23:16:54 +0300
committerJan Tuomi <jans.tuomi@gmail.com>2016-07-26 19:46:50 +0300
commit12eeefcdba1ee392f033f51e6b9826eaae3c4de6 (patch)
tree061f3472bfc924dfa05b46f3aeab76b788b86914 /main/utils
parent560e490ea44970edca22181cc2726f0b2ebb82c9 (diff)
Add tokenizer, parser and support for certain operations
Diffstat (limited to 'main/utils')
-rw-r--r--main/utils/Counter.java27
-rw-r--r--main/utils/Utilities.java17
2 files changed, 44 insertions, 0 deletions
diff --git a/main/utils/Counter.java b/main/utils/Counter.java
new file mode 100644
index 0000000..a0bf0fd
--- /dev/null
+++ b/main/utils/Counter.java
@@ -0,0 +1,27 @@
+package com.jantuomi.interpreter.main.utils;
+
+/**
+ * Created by jan on 13.6.2016.
+ */
+public class Counter {
+ private int value = 0;
+
+ public int advance() {
+ value = value + 1;
+ return value;
+ }
+
+ public int getValue() {
+ return value;
+ }
+
+ public void setValue(int value) {
+ this.value = value;
+ }
+
+ public Counter clone() {
+ Counter c = new Counter();
+ c.value = value;
+ return c;
+ }
+}
diff --git a/main/utils/Utilities.java b/main/utils/Utilities.java
new file mode 100644
index 0000000..396248f
--- /dev/null
+++ b/main/utils/Utilities.java
@@ -0,0 +1,17 @@
+package com.jantuomi.interpreter.main.utils;
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+/**
+ * Created by jan on 10.6.2016.
+ */
+public class Utilities {
+ private Utilities() {}
+
+ public static String getBasePath() {
+ Path currentRelativePath = Paths.get("");
+ String s = currentRelativePath.toAbsolutePath().toString();
+ return s;
+ }
+}