Egg Language utility. Translates egg programs into ASTs.
npm install git@github.com:ULL-ESIT-PL-2324/egg-parser-thomas_edward-bradley-alu0101408248.git
const { parseFromFile } = require('@alu0101408248/egg-lang')
const example_file = "./testFile.txt"
console.log("Original Code: \n", example_code);
console.log("AST generated from code: \n", parseFromFile(example_code));
An input file must be specified. You also may or may not specify an output file. If not given, it will default to the original file's name, with a .json extension.
npx eggc input_file --o output_file
You can check various examples in the examples/ directory.
alu0101408248 (name: Thomas Edward Bradley) - GitHub Profile
npm run test
1.0.0 Initial Release
1.0.1 Small Documentation Change
AI was used in order to understand how to properly use nearley in index.js
as I couldn't find information on the correct
workflow online, however it was just used as a guideline for this purpose as I then wrote the final code myself.
I declare that I will not use AI to cheat the practical exercises and copy code blocks.