Lenguaje Fuente
Download
1 / 3

Ejemplo Práctico de un compilador pequeño - PowerPoint PPT Presentation


  • 128 Views
  • Uploaded on

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.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Ejemplo Práctico de un compilador pequeño' - cassia


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

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

CTE 0 | ... | 9

Gramática


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


ad