You are on page 1of 4

Application of Automata theory in Compiler Design

Dr. Osman Ahmed Abdullah


By: Ryan Khalaf Al-Mahmoud

Abstract :
Computers are nothing but a mix of software and hardware. Hardware
is just a piece of mechanical device and software is what controls its
functions. Hardware takes in instructions in the form of electronic
pulses, which can also be represented in the form of binary language
while programming software. Binary language only consists of 0 and
1. To send instructions to the hardware, codes written must be in
binary format, which is simply a series of 1s and 0s. It won’t just be
difficult, it will be near too impossible for programmers to write such
codes as this way of writing code will be very hard to keep track of
while coding, which is why we need a ‘middle-man’ to write such
codes.
Computing Theory:
In computer science and mathematics, computing theory is a branch
that deals with problems that can be solved by a model of
computation or a mathematical abstraction of computing machine
(such as Turing machine). Much of the computing theory is based on
the results of halting problems. The machine cannot process an input
string, and it may not finish and keep running forever (cannot finish
or exit).
Automata Theory:
Automata theory is the study of abstract machines and the
computational problems that can be solved by these abstract
machines. Automata theory is related to formal language theory, they
are often classified as class of formal languages that they are able to
recognize. Automata are used as theoretical models for computing
machines to prove the computability [1].
Formal Language Theory :
Language theory concerns with the describing languages as a set of
operations over an alphabet. The field of formal language theory
focuses primarily on syntactical aspects of the languages, their
internal structure patterns. In computer science, formal languages are
used as the basis for defining grammar of the programming
languages. While automata are used to generate and recognize formal
languages, and each class of formal language corresponds to a class of
automata which recognize it. Automata are used as models of
computation, and formal languages are the mode of specification for
any problem to compute [2].
AUTOMATA:
An automaton is an abstract model of a computer system. It has a
mechanism to read input a string of characters over a given alphabet,
such as ASCII or Unicode character sets. The input is created on an
“input file” which can be read by the automaton but cannot change it.

Figure 1 Automaton
From Fig. 1 above, input file contains cells and each cell can hold
only one character or symbol. We assume, the automaton can store
(has storage) unlimited number of cells, which contents can be
changed by the automaton. The automaton also has a control unit and
must me in one of “internal states”, and it can change (or move) from
state to state in a defined way.
There are two types of automata, deterministic and non-deterministic.
A deterministic automaton is the one in which each move (from one
to another state) is not equally determined by the current
configuration.
If the internal state, input and the contents of the storage are known,
then it is possible to tell the behavior of the automaton. This
automaton is called deterministic, otherwise it is non deterministic
automata.
Automata in the working of Compilers:
The concept of Finite Automata is used in two of the three phases of
the process of compilation.
The first one is being Lexical Analysis:
, uses Regular Expressions to tokenize the input. Generally, Finite
Automata are required to implement regular expressions.
Being the first phase of the compiler, its job is to read one character at
a time from the source program and to generate Lexemes.
second phase is Parsing:
Our goal here is to build what’s known as an Abstract Syntax Tree (or
AST or just Syntax Tree). An AST is formed when you take a piece
of code written in a formal language and represent its abstract
syntactic structure of it. Constructs occurring in the text are denoted
by nodes.
Language Processing System:
From what we know the hardware half of a machine understands a
type of language, which humans cannot understand. So, we have
come up with a solution for this, what we can do is that we can write
programs in a high-level language, which is easier for us to
understand and remember. This set of codes can be sent to a piece of
software that is programmed to take in this said high-level code and
convert it into the low-level code counterpart that a machine can
understand. This is what is known as Language Processing System in
Theory of Computation.
CONCLUSION:
In the theory of automata, formal languages are seen as a system for
expression of certain ideas facts, and concepts. This formalization
covers varieties of human languages as well as computer
programming languages. Generally, a language is a collection of
sentences (or statements in programming languages), a sentence is a
sequence of words, and a word is compounded of symbols of its
alphabet.
The theory of each automaton will determine to accept a language or
not, and this concept is very important in the designing of grammars
that generate input strings belong to the language in lexical, syntactic
analysis phases of a compiler.
REFERENCES:
[1] https://en.wikipedia.org/wiki/Theory_of_computation
downloaded 07/23/2020 at 12:35pm.
[2] https://en.wikipedia.org/wiki/Formal_language downloaded
12/04/2021 at 11:00am

You might also like