Skip to content

Make a visual syntax tree from c-like expression

License

Notifications You must be signed in to change notification settings

bjcooke/exprtree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

exprtree

Reads a c-like expression from standard input and prints a visual depiction of the syntax tree.

How to Build

Build Commands

./autogen.sh
./configure
make

Cleanup

make clean

or

make distclean

Build Dependencies

  • gnu make
  • autoconf

How to run

Argument

./exprtree -e '6+7*8/2+*a'

File

./exprtree -f example.txt

Output

                                       (+)
                                        |
                    ----------------------------------------
                    |                                      |
                   (+)                                    (*)
                    |                                      |
          --------------------                            (a)
          |                  |
         (6)                (/)
                             |
                        ----------
                        |        |
                       (*)      (2)
                        |
                     ------
                     |    |
                    (7)  (8)

Limitations

  • No checking of left operand of assignment operator.
  • No checking of left operand of accessor operator
  • No checking of operand of increment/decrement operator
  • No checking of operand of reference operator
  • No type checking of array subscript
  • No typecasting
  • No sizeof macro

About

Make a visual syntax tree from c-like expression

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published