Skip to content

Scientific calculator using Bison & Flex, with additional functionality implemented in C

Notifications You must be signed in to change notification settings

smtanbin/Bison-Flex-Calculator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bison-Flex-Calculator

CS Assignment - scientific calculator using Bison & Flex, with additonal functionality implemented in C

Functionality

  • Basic arithmetic following BODMAS rules e.g, 4 * (3 + 2) = 20
  • Standard functions (modulo, ceil, abs, floor)
  • Logarithmic functions (log2, log10)
  • Trig functions (cos, sin, tan)
  • Hyperbolic functions (cosh, sinh, tanh)
  • Conversions (currency, temperature, distance)
  • Variable stores (create and use your own variables. See example)
  • Can read input the command line or a file

Example

example screenshot

Requirements

  1. Bison (needs adding to PATH on windows)
  2. Flex (needs adding to PATH on windows)
  3. gcc compiler

Compile and execute

  1. bison -d gram.y
  2. flex lex.l
  3. gcc gram.tab.c lex.yy.c -lm -o scientific-calc
  4. scientific-calc

About

Scientific calculator using Bison & Flex, with additional functionality implemented in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Yacc 54.9%
  • Lex 23.0%
  • C 22.1%