Skip to content

JonahRileyHuggins/ReactionParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReactionParser

A simple C program that evaluates arithmetic expressions using the Shunting Yard algorithm. Supports:

  • +, -, *, /, %, ^
  • Parentheses for grouping
  • Unary minus
  • Floating-point numbers (doubles)

Sources and Attribution

Single-File vs. Header/Source Implementation

A standalone, single-file version of the library is available on the single-file branch for easy integration. It is also included in release v1.0.

Build Instructions

mkdir build
cd build
cmake ..
cmake --build .

This will create the executable ReactionParser in the build directory.

Usage

./ReactionParser "3 + 4 * 2"

Example output:

11.000000

Unit Tests

A test suite is provided in tests/test_reactionparser.c:

./test_reactionparser

About

Basic implementation of Shunting yard algorithm

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors