Lexical analyzer for the EASY language
submitted by DANTIS, Aurel Jared C. (SN REMOVED)
in partial fulfillment of the requirements for the CS 155 course, second semester academic year 2022-2023
Ensure you have flex
and gcc
installed and available in your PATH
. For macOS, these are included with the Xcode Command Line Tools, which can be installed through
xcode-select --install
or through Homebrew:
brew install flex gcc
Linux users can install these through their package manager of choice. For Debian and Debian-based distributions such as Ubuntu, this can be done through:
sudo apt install flex gcc # or sudo apt install flex build-essential
If you have GNU Make installed, cd
into the repository directory and
make
Otherwise, you can compile the program using the following command:
# macOS
flex easy.lex && gcc -ll lex.yy.c -o easy
# Linux, Windows
flex easy.lex && gcc -lfl lex.yy.c -o easy
To run the analyzer against any of the sample EASY files, use the following command (assuming you are in the same directory as the built easy
binary):
./easy < samples/<filename>.easy