19.04.2013 Views

Análise Sintática botton-up - Departamento de Informática

Análise Sintática botton-up - Departamento de Informática

Análise Sintática botton-up - Departamento de Informática

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.

<strong>Análise</strong> sintática Botton-<strong>up</strong><br />

Tenta construir a árvore gramatical começando pelas folhas e<br />

trabalhando em direção a raiz.<br />

Um bottom-<strong>up</strong> parser constroi uma <strong>de</strong>rivação da sentença <strong>de</strong><br />

entrada retornando ao simbolo inicial S<br />

S ⇒ γ 0 ⇒ γ 1 ⇒ γ 2 ⇒ … ⇒ γ n-1 ⇒ γ n ⇒ sentença<br />

Para <strong>de</strong>rivar γ i-1 a partir γ i, associa-se γ i = α β δ contra γ i,<br />

substitui-se β com sua parte correspon<strong>de</strong>nte lhs, N, para resultar γ<br />

1<br />

= α N δ . (assumindo N→β )<br />

Uma árvore sintática não precisa ser construída, mas po<strong>de</strong> ser<br />

simulada<br />

|parse tree no<strong>de</strong>s| = |words| + |reductions|

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

Saved successfully!

Ooh no, something went wrong!