aboutsummaryrefslogtreecommitdiff
path: root/calculator-java/src/main/java/ch/bfh/lexer/Token.java
diff options
context:
space:
mode:
authorMaël Gassmann <mael.gassmann@students.bfh.ch>2021-06-11 20:55:12 +0200
committerMaël Gassmann <mael.gassmann@students.bfh.ch>2021-06-11 20:55:12 +0200
commitfed70f3ac817ed4943a230cb901fcd65dc6fdd0c (patch)
treeaea4de81656c677d33e4af6eb11375303d1dfdda /calculator-java/src/main/java/ch/bfh/lexer/Token.java
parent3baa44f1c8459713a96f4db994ee9905cc4e8df1 (diff)
[~] First totaly functional Calculator, reorganised the files, verified and added error messages
Diffstat (limited to 'calculator-java/src/main/java/ch/bfh/lexer/Token.java')
-rw-r--r--calculator-java/src/main/java/ch/bfh/lexer/Token.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/calculator-java/src/main/java/ch/bfh/lexer/Token.java b/calculator-java/src/main/java/ch/bfh/lexer/Token.java
new file mode 100644
index 0000000..b021075
--- /dev/null
+++ b/calculator-java/src/main/java/ch/bfh/lexer/Token.java
@@ -0,0 +1,23 @@
+package ch.bfh.lexer;
+
+// Various Tokens for arithmetic expressions based on integers
+// with identifiers and assignments
+
+public class Token {
+ public int type; // token type
+ public double value; // numerical value for NUM
+ public String str; // token string
+
+ public static final int EOL=0;// // End Of Line
+ public static final int PAL=1;// // Left Parenthesis
+ public static final int PAR=2;// // Right Parenthesis
+ public static final int ADD=3;// // operators
+ public static final int SUB=4;//
+ public static final int MUL=5;
+ public static final int DIV=6;
+ public static final int NUM=7;// // number
+ public static final int EQU=8; // equal
+ public static final int LET=9; // let
+ public static final int ID=10;// // identifier
+ public static final int END=11; // exit
+} \ No newline at end of file