{"id":15069567,"url":"https://github.com/soundlygifted/scriptlanguage","last_synced_at":"2026-01-03T02:33:13.873Z","repository":{"id":203612751,"uuid":"589671764","full_name":"SoundlyGifted/ScriptLanguage","owner":"SoundlyGifted","description":"This is an educational console app that executes a script written on a custom script language from an external text file","archived":false,"fork":false,"pushed_at":"2023-01-17T11:16:35.000Z","size":75,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T09:16:06.256Z","etag":null,"topics":["ant","java","javacollections","javacore","javaexceptionhandling","javaio","javase","scripting-language"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SoundlyGifted.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-01-16T17:00:22.000Z","updated_at":"2023-10-01T06:46:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"1c573af0-fe79-4016-8bd1-81d2fd391581","html_url":"https://github.com/SoundlyGifted/ScriptLanguage","commit_stats":null,"previous_names":["soundlygifted/scriptlanguage"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoundlyGifted%2FScriptLanguage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoundlyGifted%2FScriptLanguage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoundlyGifted%2FScriptLanguage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoundlyGifted%2FScriptLanguage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SoundlyGifted","download_url":"https://codeload.github.com/SoundlyGifted/ScriptLanguage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243847056,"owners_count":20357317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ant","java","javacollections","javacore","javaexceptionhandling","javaio","javase","scripting-language"],"created_at":"2024-09-25T01:43:14.388Z","updated_at":"2026-01-03T02:33:13.821Z","avatar_url":"https://github.com/SoundlyGifted.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Script Language Interpreter\n### Project description\nThis Java console app is a script language interpreter that interprets and executes a script written on a custom script language.\n\n### Purpose\nThe project is made to practice Java Collections, I/O, and other Java SE standard package features.\n\n### Key feature description\nThe script is loaded from a text file (.txt) and **_executed line by line_**. The name of the file to be loaded is passed either as a command line argument or entered by the user from the keyboard (if there is no argument provided).\nThe **key features** are:\n- perform calculations using whole numbers\n- save numbers or calculation results in user-defined variables\n- use variables in calculations (resolving variables into numbers stored in the variables)\n- print text strings or values of user-defined variables on the screen\n- use script documenting comments that are ignored by the script interpreter\n- check the script and print errors with the problem description\n\n#### Calculation operations\nCalculations are performed in whole numbers. The following operations can be performed:\n- addition\n- subtraction\n- multiplication\n- division\n\nThe expression for evaluation can contain **opening `(` and closing `)` brackets** to determine the order of operations.\n\n#### Script operators\nThe user script should contain the following operators (each one on a separate line):\n- `set` operator calculates the given expression and assigns result to the named variable. The variable name must start with “`$`” and can include Latin letters, numbers and underscore mark only. The expression must be a number, other variable or must consist of numbers, other variable(s) and calculation operations named above\n- `print` operator prints the specified list of strings and variables to the screen: strings and variables in the list are separated by commas; strings are enclosed in double quotes\n- `#` operator determines a comment. Any line that starts with `#` will be ignored\n- blank lines are ignored\n\n### Usage example\nThe demo script file can be found in the root directory of the project (**DemoScript.txt**). It contains the following script.\n```\n# Printing some string\nprint \"Hi, Alexey!\"\n\n# Performing \"set\" operations\nset $n1 = 21\nset $n2 = 121\nset $sum = ($n1 - ($n2 - 42)) * (4 - 42 / $n1)\n\n# Printing the script\nprint\nprint \"You entered this script:\"\nprint \"set $n1 = \", $n1\nprint \"set $n2 = \", $n2\nprint \"$sum = \", \"($n1 - ($n2 - 42)) * (4 - 42 / $n1) = \", $sum\n```\nThe user passes the file name as a command line argument when launching the jar-file, or enters it from the keyboard after the corresponding request from the program (if the argument was not entered). The program displays the following result on the screen:\n```\nHi, Alexey!\n\nYou entered this script:\nset $n1 = 21\nset $n2 = 121\n$sum = ($n1 - ($n2 - 42)) * (4 - 42 / $n1) = -116\n\n[ScriptLanguage] Program finished running. Press Enter to finish...\n```\nAfter the user presses Enter, the program will exit.\n### Project structure\nThis is a simple Ant-based Java application. The diagram of modules and classes is shown in the figure below.\n\n![](images/ScriptLanguage_Classes.PNG)\n\n- `main` package contains `ScriptLanguage.java` class which is the main Application class. It addresses to the classes of the underlying packages (to read and interpret a script) and handles the incoming exceptions\n  - `main.io` package contains classes that read external data from different sources\n    - `KeyboardInputReader.java` class reads user keyboard input (e.g., when user inputs script file name)\n    - `ScriptReader.java` class reads script file for further script interpretation / execution\n    - `main.io.exceptions` package contains custom exception class (`FileReadingException.java`) that is used to throw exceptions connected with I/O operations\n  - `main.process` package contains classes for the script interpretation which includes script parsing and validation, as well as performing related calculations and processing\n    - `ScriptInterpreter.java` class is designed to interpret the script and return the final result. It addresses to other classes contained in the sub-packages of `main.process` package to perform the job.\n    - `main.process.operations` package contains classes each one of which performs a separate script operation\n      - `OperationPeformer.java` is an abstract class that represents performance of an abstract operation\n      - `PrintOperationPerformer.java` class extends `OperationPeformer.java` class. It is designed to perform `print` script operation\n      - `SetOperationPerformer.java` class extends `OperationPeformer.java` class. It is designed to perform `set` script operation\n    - `main.process.exceptions` package contains custom exception classes (`UnsupportedScriptOperationException.java`, `WrongScriptExpressionExeption.java`) that are used to throw exceptions connected with the script interpretation and execution\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoundlygifted%2Fscriptlanguage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoundlygifted%2Fscriptlanguage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoundlygifted%2Fscriptlanguage/lists"}