Skip to content

omeedcs/SyntaxSage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SyntaxSage: The EEL Expression Interpreter

Overview

The EEL (Extended Expression Language) Interpreter is a C implementation of an interpreter for a custom expression language developed as part of the CS 429 course. This project provides a command-line interface (CI) that allows users to evaluate expressions written in the EEL language.

Project Structure

  • Core Components:

    • Lexer: Tokenizes input strings into lexemes (lex.c)
    • Parser: Builds abstract syntax trees from tokens (parse.c)
    • Evaluator: Evaluates parsed expressions (eval.c)
    • Variable Management: Handles variable definitions and lookups (variable.c)
    • Error Handler: Provides robust error handling (err_handler.c)
  • Support Files:

    • ci.h: Main header file with function declarations and shared variables
    • token.h: Token definitions for the lexer
    • node.h: Node structure for the abstract syntax tree
    • value.h & type.h: Value and type system definitions
    • Makefile: Build configuration

Features

  • Arithmetic operations
  • String manipulation
  • Comparison operators
  • Ternary conditional expressions
  • Variable assignment and retrieval
  • Robust error handling

Language Elements

The EEL language supports various operations including:

  • String operations (concatenation, repetition, comparison)
  • Numeric operations (addition, subtraction, multiplication, division)
  • Type conversion
  • Boolean operations

Building & Running

To build the interpreter:

make ci

To run the interpreter:

./ci

To run tests:

make test

To check for memory leaks:

make memtest

Testing

The tests/ directory contains various test files to verify different aspects of the interpreter:

  • test_string.txt: String operations
  • test_binary.txt: Binary operations
  • test_ternary.txt: Ternary conditional expressions
  • test_variable.txt: Variable assignment and usage
  • test_unary.txt: Unary operations

License

Copyright (c) 2021. S. Chatterjee, X. Shen, T. Byrd. All rights reserved. May not be used, modified, or copied without permission.

About

The EEL Expression Interpreter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors