#ifndef DISPLAY_H #define DISPLAY_H ///////////////////////////////////////////////////////////////////// // display.h - generates formatted strings from semiExp objects // // ver 1.2 // // // // Language: Visual C++, ver 7.0 // // Platfrom: Dell Dimension 8300, Windows XP, SP 1.0 // // Application: Prototype for CSE687 Pr#2, Spring 2004 // // Author: Jim Fawcett, CST 2-187, Syracuse University // // (315) 443-3948, jfawcett@twcny.rr.com // ///////////////////////////////////////////////////////////////////// /* Module Operation: ================= The display module builds formatted strings from CSemiExp objects. Currently the display module provides formatting for function names and titles. Public Interface: ================= CSemiExp se(in); std::string name = display::functionName(se); std::string title = display::title<'='>(const std::string &t); */ ///////////////////////////////////////////////////////////////////// // Build Process // ///////////////////////////////////////////////////////////////////// // Required Files: // // display.h, display.cpp, CppSemiExp.h, CppSemiExp.cpp, // // CppToker.h, CppToker.cpp, grammar.h, grammar.cpp // // // // Compiler command: // // cl /DTEST_DISPLAY display.cpp semi.cpp tok.cpp // ///////////////////////////////////////////////////////////////////// /* Maintenance History: ==================== ver 1.2 : 29 Feb 04 - added calls to CToker::setDefaultFilters() and CSemiExp::setDefaultFilters() in test stub ver 1.1 : 08 Feb 04 - cosmetic changes to functionName ver 1.0 : 08 Feb 03 - first release */ // #include "CppSemiExp.h" namespace CodeAnal { class display { public: static std::string functionName(Scanner::CSemiExp &se); template static std::string title(const std::string &t); }; //----< display an underlined title >-------------------------- template std::string display::title(const std::string &t) { std::string underline(t.length()+2,ch); std::string temp = std::string("\n ") + t + std::string("\n ") + underline + std::string("\n"); return (temp); } } #endif