#include <istream> #include <deque> #include <locale> #include "Parser.h" /** * static functions */ //protptype the functions so compiler wont complain static void ignoreSpace(std::istream& in); static char getChar(std::istream& in); /** * $1 - an input stream * pre - none * post - all spaces up to the next non space char are removed */ static void ignoreSpace(std::istream& in) { while(isspace(in.peek())) { in.get(); } } /** * $1 - an input stream * pre - none * post - all preceding and following space is removed. 1 non-space char is removed */ static char getChar(std::istream& in) { ignoreSpace(in); //remove all preceding space char ret = in.get(); ignoreSpace(in); //remove all following space return ret; } /** * Production */ //dose nothing, if we don't need to override it we don't want to Production::~Production() {} ///ParseError const char* ParseError::what() const throw() { return "a parsing error occured"; }
Sunday, June 26, 2011
Browse » Home »
Algoritma dan Pemrograman
» OOP Recursive Decent Parsing II
OOP Recursive Decent Parsing II
Subscribe to:
Post Comments (Atom)
Comments :
0 comments to “OOP Recursive Decent Parsing II”
Post a Comment