Skip to content

rishenko/shunting_yard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shunting-Yard Algorithm

This is a basic implementation of the shunting-yard algorithm in the elixir programming language. The ShuntingYard module converts infix (algebraic) notation to postfix (reverse-polish) notation, including dice rolling (d) and modulo (%) operators.

Usage

iex> ShuntingYard.to_rpn("(1+2)*(3+4)")
[1, 2, "+", 3, 4, "+", "*"]

iex> ShuntingYard.to_ast("(1+2)*(3+4)")
{"*", {"+", 1, 2}, {"+", 3, 4}}

Copyright (c) 2018 Kevin McAbee

About

Bare-bones implementation of a shunting-yard algorithm for parsing algebraic equations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages