Skip to content
cokicatPublic

About

A minimal implementation of the eval function I made to learn C.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

eval

This is a minimal implementation of the eval function I made to learn C.
The code is probably shit since it's my first time finishing a project in C. The syntax is very simple: the parser only supports basic operations like +, -, * or /. Brackets and floating numbers are not supported and spaces or new lines are skipped.

Compiling

No dependencies, just run:

make

Usage

eval [EXPRESSION]

If started without arguments, eval will run in interactive mode, else it will evaluate the first argument.

Example

eval 1+1

... will print 2 to stdout.

TODO

  • Global cleanup
  • Add support for brackets (add better support for relative numbers)
  • Add support for floating numbers
  • Add dynamic tokens support - fix overflow caused by >32bits numbers (int -> long long)

About

A minimal implementation of the eval function I made to learn C.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages