Está en la página 1de 25

SEMANTIC

ANALYZER

By: Jesus, Emanuel, Jovanni, Luis

WHAT IS SEMANTICS?

The semantics corresponds to the meaning


associated with formal structures (syntax) of the
language.

QU ES LA SEMNTICA?

La semntica corresponde al significado asociado


a las estructuras formales (sintaxis) dellenguaje.

PHASES OF SEMANTIC ANALYSIS


The semantic analysis phase of a speech
processor is one that computes the additional
information necessary to process language, once
the syntactic structure of a program has been
obtained.
It is therefore the phase following the parsing
and the last in the process of synthesis of a
programming language.

FASES DEL ANALIZADOR


SEMNTICO

La fase de anlisis semntico de un procesador


de lenguaje es aqulla que computa la
informacin adicional necesaria para el
procesamiento de un lenguaje, una vez que la
estructura sintctica de un programa haya sido
obtenida. Es por tanto la fase posterior a la de
anlisis sintctico y la ltima dentro del proceso
de sntesis de un lenguaje de programacin.

WHAT IS THE MAIN OBJETIVE?

The main objective of the semantic analyzer of a


speech processor is to ensure that the program
meets analyzed the rules required by the
language specification to ensure its proper
implementation.

CUL ES EL OBJETIVO PRINCIPAL?

El objetivo principal del analizador semntico de


un procesador de lenguaje es asegurarse de que
el programa analizado satisfaga las reglas
requeridas por la especificacin del lenguaje, para
garantizar su correcta ejecucin.

WHAT IS THE MAIN OBJETIVE?

The type and dimension of semantic analysis


required varies greatly from one language to
another.

CUL ES EL OBJETIVO PRINCIPAL?

El tipo y dimensin de anlisis semntico


requerido vara enormemente de un lenguaje a
otro.

WAYS TO DESCRIBE THE


SEMANTICS
There are two ways to describe the semantics of a
programming language: by
Natural or formal
and
Informal specification.

EXISTEN DOS FORMAS DE


DESCRIBIR LA SEMNTICA

De un lenguaje de programacin: mediante


especificacin informal o natural y formal.

THE INFORMAL DESCRIPTION


Of a programming language is carried out using
natural language.
This specification makes intelligible (in principle)
to anyone. Experience tells us that it is a very
complex task, if not impossible, to describe all the
features of a programming language precisely.

LA DESCRIPCIN INFORMAL
De un lenguaje de programacin es llevada a cabo
mediante el lenguaje natural.
Esto hace que la especificacin sea inteligible (en
principio) para cualquier persona. La experiencia
nos dice que es una tarea muy compleja, si no
imposible, el describir todas las caractersticas de
un lenguaje de programacin de un modo preciso.

THE FORMAL DESCRIPTION

Of the semantics of programming languages is


the rigorous description of the meaning or
behavior of programs, programming languages,
abstract machines or even any hardware device.

LA DESCRIPCIN FORMAL

De la semntica de lenguajes de programacin es


la descripcin rigurosa del significado o
comportamiento de programas, lenguajes de
programacin, mquinas abstractas o incluso
cualquier dispositivo hardware.

THE FORMAL DESCRIPTION


-Disclose potential ambiguities of language
processors implementations or descriptive
documents of programming languages.
-The semantic specification of a language, as a
reference document clarifies the language and
behavior of various constructions.
-Estandarizar Languages by publishing the
semantics of an unambiguous way. Programs
need to be processed in another implementation
of the same language processor exhibiting the
same behavior.

LA DESCRIPCIN FORMAL
Revelar posibles ambigedades existentes
implementaciones de procesadores de lenguajes o
en documentos descriptivos de lenguajes de
programacin.
-El Especificacin semntica de una lengua, como
documento de referencia aclara el lenguaje y el
comportamiento de diversas construcciones.
Idiomas -Estandarizar mediante la publicacin
de la semntica de una manera inequvoca. Los
programas deben ser procesados en otra
aplicacin del mismo procesador de lenguaje que
presenta el mismo comportamiento.

TYPE CHECKING EXPRESSIONS


System Types
Rules language types that map to different parts of
a program and verify its correctness.
Formed by the definitions and rules that let you
check the domain identifier, and in what contexts
can be used.
Each language has its own system of types,
although it can vary from one to another
implementation.
Type checking is part of semantic analysis.

VERIFICACIN DE TIPOS DE
EXPRESIONES
Sistema de Tipos
Reglas de un lenguaje que permiten asignar tipos a
las distintas partes de un programa y verificar su
correccin.
Formado por las definiciones y reglas que
permiten comprobar el dominio de un
identificador, y en qu contextos puede ser usado.
Cada lenguaje tiene un sistema de tipos propio,
aunque puede variar de una a otra
implementacin.
La comprobacin de tipos es parte del anlisis
semntico.

MAIN FUNCTIONS:
Rules language types that map to different parts of
a program and verify its correctness.
Inference: calculate and maintain information
about data types.
Type checking: ensuring that parts of a program
make sense according to the type of language
rules.

FUNCIONES PRINCIPALES
Reglas de un lenguaje que permiten asignar tipos a
las distintas partes de un programa y verificar su
correccin.
Inferencia de tipos: calcular y mantener la
informacin sobre los tipos de datos.
Verificacin de tipo: asegurar que las partes de
un programa tienen sentido segn las reglas de
tipo del lenguaje.

ERROR HANDLING

It is one of the most important missions of the


compiler. It is used more in the analysis but
errors can occur at any stage. Error handling is a
difficult task for two reasons:

MANEJO DE ERRORES

Es una de las misiones ms importantes del


compilador. Se utiliza ms en el anlisis pero los
errores pueden darse en cualquier fase. El
manejo de errores es una tarea difcil por dos
motivos:

ERROR HANDLING
1.A some mistakes sometimes hide other
2. A mistake can cause an avalanche of errors
that are solved with the first
Criteria to follow when handling errors
1.Pararse to detect the first error (suitable for an
interactive compiler)
2.Detectar all errors in one pass (suitable for line
compile

MANEJO DE ERRORES
1.A veces algunos errores ocultan otros
2.Un error puede provocar una avalancha de
errores que se solucionan con el primero
Criterios a seguir a la hora de manejar errores
1.Pararse al detectar el primer error (conveniente
para un compilador interactivo)
2.Detectar todos los errores de una pasada
(conveniente para un compilador de lnea)

También podría gustarte