Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Latest commit

 

History

History
52 lines (34 loc) · 1.25 KB

README.md

File metadata and controls

52 lines (34 loc) · 1.25 KB

cs155-easyscanner

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

Prerequisites

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

Compilation

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

Usage

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