Lenguaje Fuente
Download
1 / 3

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


  • 111 Views
  • Uploaded on
  • Presentation posted in: General

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

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.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 CTEtop := top + 1;

pila[top] := cte;

PUSHA dir.var.top := top + 1;

pila[top] := dir.var.

LOADpila[top] := mem[pila[top]]

STOREmem[pila[top-1]] := pila[top];

top := top-2;

NEGpila[top] := - pila[top];

ADDpila[top-1] := pila[top] + pila[top-1];

top := top-1;

Pila

Variables

Programa


ad
  • Login