Knowee
Questions
Features
Study Tools

From the following table: Whether the Grammar is SLR(1) parser or not?*UndecidableThe Grammar is not SLR(1) ParserThe Grammar is SLR(1) ParserNon of the mentioed

Question

From the following table: Whether the Grammar is SLR(1) parser or not?*UndecidableThe Grammar is not SLR(1) ParserThe Grammar is SLR(1) ParserNon of the mentioed

🧐 Not the exact question you are looking for?Go ask a question

Solution

Para determinar si una gramática es un parser SLR(1), se deben seguir los siguientes pasos:

  1. Construcción de la gramática aumentada: Añadir una nueva producción S' → S, donde S es el símbolo inicial de la gramática original.

  2. Construcción del autómata LR(0): Crear el autómata de estados LR(0) a partir de la gramática aumentada. Cada estado representa un conjunto de elementos LR(0).

  3. Cálculo de los conjuntos de seguimiento (Follow sets): Para cada no terminal en la gramática, calcular el conjunto de símbolos terminales que pueden seguir inmediatamente después de ese no terminal en alguna derivación.

  4. Construcción de la tabla de análisis SLR(1): Utilizar los estados del autómata LR(0) y los conjuntos de seguimiento para construir la tabla de análisis SLR(1). La tabla tiene dos partes: acciones (shift, reduce, accept, error) y transiciones de estado.

  5. Verificación de conflictos: Revisar la tabla de análisis para asegurarse de que no haya conflictos shift/reduce o reduce/reduce. Un conflicto ocurre cuando una celda de la tabla tiene más de una acción posible.

Si la tabla de análisis SLR(1) no tiene conflictos, entonces la gramática es un parser SLR(1). Si hay conflictos, la gramática no es un parser SLR(1).

Por lo tanto, la respuesta correcta es: La Gramática no es SLR(1) Parser o La Gramática es SLR(1) Parser, dependiendo de si se encuentran o no conflictos en la tabla de análisis.

This problem has been solved

Similar Questions

In LR(0) parser the reduce term is written in__________.*Only goto part of parsing tableOnly action part of the parsing tableNone of the mentionedAll columns of the parsing table

What is the similarity between LR, LALR and SLR?*Their Parsing tables and algorithm are similar but uses top down approachSame parsing table, but different algorithmUse same algorithm, but different parsing tableBoth Parsing tables and algorithm are different

Consider the following grammar G G: S → EF   E → a|∈F → abF|ac                  Which of the following is true about the grammar G?1. G is a LL(1) grammar2. G is a regular Grammar                                                                 1 only2 only1 and 2 bothNone of these

Whether or not is the following grammar LL(1)? Why (State the reasons.)? If thegrammar is not LL(1), then convert it to an LL(1) grammar. Next, present thetransition table and show the parsing process by parsing the string “ababbbb”according to the prepared transition table.• S->aAbB | bS• A->AbB|λ• B->Bb|a

A grammar that produces more than one parse tree for some sentence iscalled ____ a) Ambiguous b) Unambiguous c) Regular d) None of the mentioned

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.