/* SI 413 Fall 2011 * Lab 04 * This is a recursive descent parser AND INTERPRETER for the * "pat" language. * YOUR NAME * YOUR PARTNER'S NAME */ // Provided below are some helper functions for the interpreter. #include <vector> #include <string> using namespace std; vector<string> fold(const vector<string> &A, const vector<string> &B) { vector<string> res; unsigned long int i = 0; for (; i < A.size() && i < B.size(); ++i) { res.push_back(A[i]); res.push_back(B[i]); } for (; i < A.size(); ++i) res.push_back(A[i]); for (; i < B.size(); ++i) res.push_back(B[i]); return res; } vector<string> concat(const vector<string> &A, const vector<string> &B) { vector<string> res; unsigned long int i; for(i = 0; i < A.size(); ++i) res.push_back(A[i]); for(i = 0; i < B.size(); ++i) res.push_back(B[i]); return res; } vector<string> rev(const vector<string> &A) { vector<string> res; long int i; for(i = A.size() - 1; i >= 0; --i) res.push_back(A[i]); return res; } // After completing Part 1, copy your parser code into this file. // Make sure it works before starting to add interpreter features! int main(void) { // Currently does nothing! return 0; }