09.05.2013 Views

análisis sintáctico descendente sin retroceso - Blearning

análisis sintáctico descendente sin retroceso - Blearning

análisis sintáctico descendente sin retroceso - Blearning

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Análisis <strong><strong>sin</strong>táctico</strong> <strong>descendente</strong> <strong>sin</strong> <strong>retroceso</strong><br />

Gramáticas LL(1)<br />

Algoritmo para calcular el conjunto de iniciales<br />

Repetir hasta que no se puedan añadir más símbolos terminales o λ al conjunto<br />

1. Si X es un terminal o λ, entonces INICIALES (X) = {X}<br />

2. Si X es un no-terminal, entonces para cada producción de la forma<br />

X→X 1 X 2 ...X n , INICIALES (X) contiene a INICIALES (X 1 ) – {λ}. Si<br />

también para algún i < n todos los conjuntos INICIALES (X 1 ) ...<br />

INICIALES (X i ) contienen a λ, entonces INICIALES (X) contiene a<br />

INICIALES (X i+1 ) – {λ}. Si todos los conjuntos INICIALES (X 1 ) ...<br />

INICIALES (Xn) contiene λ, entonces INICIALES (X) también contiene a<br />

λ.<br />

Página 18

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

Saved successfully!

Ooh no, something went wrong!