






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Phases of a Compiler and Interfaces between them
Environs
Lex
Parse
ParsingActions
Source Program
Tokens
Reductions
Tables SemanticAnalysis Abstract Syntax
Translate Translate^ Frame^ FrameLayout
Canon-icalize IR Trees
InstructionSelection IR Trees
Assem
ControlFlow Assem Analysis
DataFlowAnalysis
RegisterAlloc
CodeEmission
Assembler
Flow Graph
Interface Graph
Linker
Register Assignment
Assembly Language
Relocatable Object Code
Machine Language
-^
abstractions– context-free grammar (for parsing)
-^
-^
during compilation – intermediate representationsof the program which often take form of a treewith multiple nodes– can be described with grammars– tree representations more easy to manipulate than
Vocabulary
lexical: 1.
refers to information associated with words or symbols in a dictionary or symbol table.
refers to information that can be determined by static examination
of a program,
i.e.
, at compile time, without running the program.
lexical analysis:
parsing and conversion to internal form of the simplest elements of a
language, usually specified by a regular grammar, such as variable names,numbers, etc. parser:
a program that determines how a given statement in a language could be derived from the grammar of the language, producing a parse tree or otherinformation about the statement as output. parser generator:
a program that constructs a parser from a specification of the
grammar of a language and actions that are to be taken when phrases of thelanguage are recognized. parse tree:
a data structure that shows how a statement in a language is derived from
the context-free grammar of the language; it may be annotated with additionalinformation,
e.g.
for compilation purposes.
parsing:
the process of reading a source language, determining its structure, and producing intermediate code for it. semantics:
the meaning of a statement in a language.
cf.
syntax.