1.0.1 • Published 2 months ago
@alu0101408248/egg-lang v1.0.1
Egg Parser
Egg Language utility. Translates egg programs into ASTs.
Installation
npm install git@github.com:ULL-ESIT-PL-2324/egg-parser-thomas_edward-bradley-alu0101408248.git
Usage from code:
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));
Usage as executable:
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
Examples
You can check various examples in the examples/ directory.
Author
alu0101408248 (name: Thomas Edward Bradley) - GitHub Profile
Tests
npm run test
Version History
1.0.0 Initial Release
1.0.1 Small Documentation Change
Usage of AI
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.