Project Title: Java Interpreter for defined subset of GO language Team member: Nutsa Chikhladze
This repository contains code for interpreter in java written for defined subset of GO language (GO_interpreter.java), along with an extra file(testcases.java) in which you can test given interpreter for given algorithms. All the files written in GO (files ending with .go) are implementations of given algorithms in GO language.
You can check the correctnes of given interpreter for defined algorithms by seeing the commit history of testcases.java. You can also write code in the interpreter but ONLY for the defined subset of GO language.
Here is a complete list of all expressions in defined subset of go language:
- variable type declaration - var n int (only int type)
- fmt.Print()
- fmt.Println() (note: print and println won't execute if theres no input, can only print String and variable inputs seperately, no concatination)
- assignment and declaration operators :=,=
- for loop with one condition to be checked: for (boolean expression) {}
- boolean operators >,<
- arithmetic operators +,-,/,*,%
- if, if-else conditions
- return statement that only exits the program, doesn't return any values
List of algorithms:
- factorial: works
- fibonacci: works
- GCD: works
- largest digit: works
- multiplication table: works
- reversing a number: works
- palindrome number: works
- prime number: works
- sum: works
- sum of digits: works