ll1.cpp CS 421
#includeiostream #includestdlib.h #includefstream #includevector #includestring #includestack using namespace std; //--------------------------------------- // CS421 File for HW3A LL1 Table-Driven Parser // Your name: Lewis Shine //--------------------------------------- const int ROW = 3; const int COL = 2; vectorchar M[ROW][COL]; // the table of rules :: 3 rows for S, A, B :: 2 rows for 0, 1 :: Each slot contains a rule's right side :: which is a vector of characters stackchar stacc; // ------- conversion functions ------------------------ // to convert non-terms S, A, B to table rows 0, 1, 2 int toRow(char C) { if(C == 'S') return 0; else if(C == 'A') return 1; else if(C == 'B') return 2; else { cout "Error
Written for
- Institution
- California State University - Bakersfield
- Course
- CS 421
Document information
- Uploaded on
- November 1, 2022
- Number of pages
- 3
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
san marcos cs 421
-
ll1cpp california state university