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
Información del documento
- Subido en
- 1 de noviembre de 2022
- Número de páginas
- 3
- Escrito en
- 2022/2023
- Tipo
- Examen
- Contiene
- Preguntas y respuestas