#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"; }
Artikel Terkait:
Algoritma dan Pemrograman
- Class Inheritance
- OOP Recursive Decent Parsing III
- OOP Recursive Decent Parsing I
- Calculate Sequebce by Using Iterative Function
- A Comparison of Sorting Algorithms
- Typical data sequences for testing sorting algorithms
- Quicksort Algorithm
- Vector
- Function to reverse an integer array
- Array
- String Contains function
- RECCURENCE RELATION
- Recursion
- Recursion Shortest Function to Reverse a String
- Calculator (C++)
- Recursive Format numbers with commas
- Calling functions with Inline Assembly
- Recursive Function
- Algoritma Menentukan Tahun Kabisat
- Algoritma dan Class Bilangan Prima
- Class Luas Lingkaran dan Volume Bola With Jeliot
- Class Bilangan [Bahasa C++]
- Struktur Perulangan (Lanjutan)
- Struktur Perulangan
Comments :
0 comments to “OOP Recursive Decent Parsing II”
Post a Comment