Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

AnalisadorSintatico

Analisador Sintático

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

Trabalho de Compiladores - 2022

Emanoel Lucas Fortuna

GitHub: https://github.com/EmanoelFrt/AnalisadorSintatico

Gramática:

S ::= bBc | cCa

A ::= Cb | aBd

B ::= aCc | ε

C ::= bAc |

First:

S ::= { b, c }

A ::= { a }

B ::= { a, ε }

C ::= { b }

Follow:

S ::= { $ }

A ::= { c }

B ::= { c, d }

C ::= { c, a }

Tabela:

- A B C D $
S - S➔bBc S➔cCa - -
A A➔aBd - - - -
B B➔aCc - B➜ε B➜ε -
C - C➔bAc - -
  • Sentenças Corretas:

cbaabadccdca - Aceito em 20 Iterações.

babadccc - Aceito em 14 Iterações.

cbaca - Aceito em 11 Iterações.

babaabaccdccc - Aceito em 23 Iterações.

  • Sentenças Incorretas:

cbaaababd - Erro em 10 Iterações

badc - Erro em 6 Iterações.