#ifndef DISPLAY_H #define DISPLAY_H ///////////////////////////////////////////////////////////////////// // display.h - generates formatted strings from semiExp objects // // ver 1.0 // // // // Language: Visual C++, ver 7.0 // // Platfrom: Dell Dimension 8100, Windows 2000, SP 2.0 // // Application: Prototype for CSE687 Pr#2, Spring 2003 // // Author: Jim Fawcett, CST 2-187, Syracuse University // // (315) 443-3948, jfawcett@twcny.rr.com // ///////////////////////////////////////////////////////////////////// /* Module Operation: ================= The display module builds formatted strings from semiExp objects. Currently the display module provides formatting for function names and titles. Public Interface: ================= semiExp 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, semi.h, semi.cpp, tok.h, tok.cpp, // // grammar.h, grammar.cpp // // // // Compiler command: // // cl /DTEST_SCANNER display.cpp semi.cpp tok.cpp // ///////////////////////////////////////////////////////////////////// /* Maintenance History: ==================== ver 1.0 : 02/08/03 - first release */ // #include "semi.h" class display { public: static std::string functionName(semiExp &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); return (string("\n ") + t + string("\n ") + underline + string("\n")); } #endif