One obvious problem:
Line 52: You're attempting to call empty, but don;t include the () to indicate a function call. You're going to get the address of the function instead, which will always be non-zero (true).
Other than that, your program seems to work for the few trivial examples I tried.