diff options
author | Maël Gassmann <mael.gassmann@students.bfh.ch> | 2021-06-10 16:02:29 +0200 |
---|---|---|
committer | Maël Gassmann <mael.gassmann@students.bfh.ch> | 2021-06-10 16:02:29 +0200 |
commit | ee369b50b14ffe662e05355459f57c076680cd58 (patch) | |
tree | d9ee2f9af7b30f238dd0e9edf1edeb969dd26428 /calculator-java/src/main/java/Token.java | |
parent | a657a82b01d958cc8d8a30268b3febe1eb124a77 (diff) |
[+] Basic stucture of the java calculator
Diffstat (limited to 'calculator-java/src/main/java/Token.java')
-rw-r--r-- | calculator-java/src/main/java/Token.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/calculator-java/src/main/java/Token.java b/calculator-java/src/main/java/Token.java new file mode 100644 index 0000000..4fe8b23 --- /dev/null +++ b/calculator-java/src/main/java/Token.java @@ -0,0 +1,21 @@ +// 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 +} |