Skip to content

A simple infix to postfix expressions conversion program, written in C

Notifications You must be signed in to change notification settings

etrian-dev/infix-to-postfix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infix to postfix expression converter

This program converts between an infix expression to the equivalent postfix expression
(also called reverse polish notation or RPN). This is useful especially because it's easier to
evaluate with a program (such as the one I wrote).

compile using gcc *.c -o execname
To run it, just type ./execname "expr", where expr MUST be quoted, so that it's passed as argv[1]

  • Expressions can be written in the usual form, such as "1*3-(7+4/4)"
  • Unary operators are not supported yet, so "-(-10)" would produce wrong RPN expressions
  • Supported operations are the following: +, -, *, /, %, ^(note on exp)

Note:The operator actually has left to right associativity, but parentheses can force certain patterns if needed

Releases

No releases published

Packages

No packages published

Languages