Unic is a universal compiler/interpreter that reads a custom syntax configuration file (.cfg.json) and processes .unic files, converting them into Java or Python based on the user-defined rules.
✅ Customizable syntax – Define language rules via .cfg.json.
✅ Compiles or interprets based on config settings.
✅ Works from any directory – Finds config in the source .unic file's directory.
✅ Cross-platform – Works on Linux, Windows, and macOS.
unic/ # Root directory
│── bin/ # Compiled binary directory
│ └── unic # Compiled executable
│── examples/ # Example test cases
│ ├── hello.unic # Sample source file
│ ├── hello.cfg.json # Config file for hello.unic
│── include/ # Header files
│ ├── config_parser.h # Handles config file parsing
│ ├── code_processor.h # Processes alias replacements
│ ├── executor.h # Runs the output
│ ├── unic.h # Main header file
│── obj/ # Compiled object files
│── src/ # Source files
│ ├── main.cc # Main program
│ ├── config_parser.cc # Reads JSON config
│ ├── code_processor.cc # Processes the input code
│ ├── executor.cc # Executes the converted output
│── Makefile # Build script
│── README.md # Project documentation
git clone https://github.com/IC7400A/UniversalCompiler.git
cd unicmake./bin/unic path/to/source.unicExample:
./bin/unic examples/hello.unicA .unic file is a custom language script that uses config-based aliasing.
print("Hello, World!");
{
"aliases": {
"print": "System.out.println"
},
"output_language": "java"
}- The compiler reads
hello.unic. - It replaces
print()withSystem.out.println()(Java syntax). - It generates and runs Java or Python based on the config.
System.out.println("Hello, World!");print("Hello, World!")make cleanThis project is licensed under the MIT License.