Usin the stack linked mplementation to count the simulate how methods are being run by java and also dtecting syntax errors.