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.

Construcción de analizadores <strong><strong>sin</strong>táctico</strong>s <strong>descendente</strong>s<br />

Analizadores <strong><strong>sin</strong>táctico</strong>s <strong>descendente</strong>s recursivos<br />

void terminal(int token, char *mensCasoError){<br />

if(tokenActual==token)<br />

tokenActual=yylex();<br />

else hayError(mensCasoError);<br />

instruccion →<br />

}<br />

identificador = exp ;<br />

void instruccion(){<br />

terminal(IDENTIFICADOR,”Se esperaba ID”);<br />

terminal(ASIGNACION,”Se esperaba ‘=‘”);<br />

expresion();<br />

terminal((int) ‘;’,”Se esperaba ‘;’”);<br />

}<br />

void expresion(){ exp → termino<br />

termino();<br />

mastermino<br />

mastermino();<br />

}<br />

Página 52<br />

SDescendente.c

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

Saved successfully!

Ooh no, something went wrong!