1 / 3

Ejemplo Práctico de un compilador pequeño

Lenguaje Fuente. Análisis Léxico. Análisis Sintáctico. Generador de código objeto. Lenguaje Objeto. Ejemplo Práctico de un compilador pequeño. ASG VAR = EXP ;. EXP TER REX. REX + EXP | - EXP | VACIO. TER ( EXP ) | VAR | CTE. VAR A | ... | Z.

cassia
Download Presentation

Ejemplo Práctico de un compilador pequeño

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lenguaje Fuente Análisis Léxico Análisis Sintáctico Generador de código objeto Lenguaje Objeto Ejemplo Práctico de un compilador pequeño

  2. ASG VAR = EXP ; EXP TER REX REX + EXP | - EXP | VACIO TER ( EXP ) | VAR | CTE VAR A | ... | Z CTE 0 | ... | 9 Gramática

  3. Lenguaje Maquina Objeto: PUSHC CTE top := top + 1; pila[top] := cte; PUSHA dir.var. top := top + 1; pila[top] := dir.var. LOAD pila[top] := mem[pila[top]] STORE mem[pila[top-1]] := pila[top]; top := top-2; NEG pila[top] := - pila[top]; ADD pila[top-1] := pila[top] + pila[top-1]; top := top-1; Pila Variables Programa

More Related