21.06.2016 Views

Análisis Sintáctico

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Ejemplo 1:<br />

La siguiente gramática genera las cadenas del lenguaje L 1 = {wcw R / w ∈ {a, b}<br />

* }<br />

G 1 = ({A}, {a, b, c}, P 1 , S 1 ), y P 1 contiene las siguientes producciones<br />

S 1 → A<br />

A<br />

A<br />

A<br />

→ aAa<br />

→ bAb<br />

→ c<br />

Ejemplo 2:<br />

La siguiente gramática genera las cadenas del lenguaje L 2 = {0 i 1 i+k 2 k 3 n+1<br />

/ i, k, n ≥ 0 }<br />

Casos Cadenas de L 2<br />

si n, i, k > 0 0 i 1 i+k 2 k 3 n+1<br />

si n=0 y i, k > 0 0 i 1 i+k 2 k 3<br />

si i=0 y n, k >0 1 k 2 k 3 n+1<br />

si k=0 y n, i >0 0 i 1 i 3 n+1<br />

si n, i=0 y k >0 1 k 2 k 3<br />

si n, k=0 y i >0 0 i 1 i 3<br />

si i, k =0 y n >0 3 n+1<br />

si n,i,k=0 3<br />

G 2 = ({A, B, C}, {0, 1, 2, 3}, P 2 , S 2 ), y P 2 contiene las producciones<br />

7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!