Bottom-Up Parsing/Example 4: LALR(1): Difference between revisions

From Wiki**3

Root (talk | contribs)
Created page with "{{TOCright}} = Problem = S -> L = R | R L -> * R | id R -> L Initial symbol: S Terminals: { =, *, id } Input: Compact. Is this an SLR(1) grammar? == Solution == [[cat..."
 
Root (talk | contribs)
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{TOCright}}
__NOTOC__
= Problem =
== Problem ==


S -> L = R | R
Initial symbol: '''S'''
L -> * R | id
R -> L


Initial symbol: S
Terminals: '''{ =, *, id }'''
<!--
Input: -->


Terminals: { =, *, id }
S → L = R | R
L → * R | id
R → L


Input:
Is this an SLR(1) grammar?


Compact.
Compute and compact the parse table.
 
Is this an SLR(1) grammar?


== Solution ==
== Solution ==


[[category:Teaching]]
[[category:Compiladores]]
[[category:Compilers]]
[[category:Ensino]]

Latest revision as of 09:42, 2 May 2024

Problem

Initial symbol: S

Terminals: { =, *, id }

S → L = R | R
L → * R | id
R → L

Is this an SLR(1) grammar?

Compute and compact the parse table.

Solution