// ============================================================================ // Name: Bracket-matching example of stack usage File: brackets.hpp // Author: Michael and Alice Fischer Copyright: January 2009 // Modified September 2016 // ============================================================================ #ifndef BRACKETS_H #define BRACKETS_H #include "tools.hpp" #include "token.hpp" #include "stack.hpp" class Brackets { private: Stack& stk = *new Stack("brackets"); Token toptok; int lineno = 1; public: Brackets() =default; ~Brackets() { delete &stk; } void checkFile(istream& in); // Check bracket nesting and matching in file. bool checkChar( char ch ); // Check next character }; #endif