Вы находитесь на странице: 1из 4

Lenguajes Formales y

Autómatas.
Jeison Andrés Maldonado
The lexical analyzer

The lexical analyzer is
a tool of a compiler the lexical components
that helps us to read represent:
the input characters - reserved words: if, while,
to form components do etc
and thus be able to -operators: = + - * / == >
identify them and < != ..
pass the information -standard constants.
to analyzed syntactic -Constant characters.

what is your function?


builds lexical elements called patterns that will be used later
by a syntactic analyzer. A pattern is an ordered pair composed
of a tokens and a lexeme. A lexeme is the sequence of
characters that match a token.
Syntactic analysis

• Syntactic Syntactic analysis is much more complex


analysis, in
than lexical analysis. Its function is to take
computer
science, is the the source program in the form of tokens,
process of which it receives from the lexical analyzer,
analyzing an and to determine the structure of the
input sequence sentences of the program. This process is
to determine similar to determining the structure of a
its grammatical sentence in Spanish, determining who the
structure
according to a subject is, the predicate, the verb and the
certain formal complements.
grammar.
The Semantic Analyzer
Principal functions:
• Semantic analysis, unlike
· Identify each type of
other phases, is not clearly
differentiated from the rest of instruction and its components
the tasks carried out by the · Complete the Table of
compiler, rather it could be Symbols
said that semantic analysis · Carry out different checks and
completes the previous two validations:
phases of lexical and * Type checks.
syntactic analysis * Control flow checks.
incorporating certain * Checks of uniqueness.
verifications that do
The Semantic not theyfinishes the* Compiler
Analyzer MatchingAnalysis
checks.
can be assimilated
phase to the
and begins the Synthesis phase, in which the
mereobject
recognition of a string
code begins to be generated. The specification of
within a language.
semantics can be done in two ways:
· Natural language
· Formal specification: Operational Semantics,
denotational semantics, Axiomatic semantics,

Вам также может понравиться