what is the hierarchical structure of programming languages in compiler design?


A programming language is an artificial language that can control the behaviour of a machine, specifically in computers. Programming language like natural languages is defined by syntactic and semantic rules which define their structure and meaning respectively. The hierarchical structure of programming languages is as follows −

Programs − Computer programs are instructions for a computer. A computer needed programs to function, generally executing the program’s instructions in the main processor. The program has an executable form that the computer can use directly to execute the instructions. The equivalent program in its human-readable source program form, from which executable programs are changed (example, compiled) allows a programmer to study and develop the algorithm.

Subroutine − A subroutine or subprogram (also known as a procedure, method, function, or routine) is an allocation of code within a larger program, which implements a definite task and is associatively independent of the remaining code. A subroutine is regularly coded so that it can be started (called) multiple times and from multiple places during an individual execution of the program, involving from other subroutines, and branch back (return) to the point after the call, once the task is completed.

Statement − In computer programming, a statement can be thought of as the smallest standalone element of an imperative programming language. A program is assembled by a sequence of one or more statements. A statement will have internal components such as expressions.

Expression − An expression in a programming language is a sequence of values, variables, operators, and functions that are interpreted (evaluated) according to the specific rules of precedence and of association for a specific programming language, which evaluates and then make (returns in a stateful environment) another value. The expression has computed that value.

Values − In computer science, a value is a sequence of bits that is interpreted according to various data types. The same sequence of bits can have several values, depending on the type can interpret its meaning. For instance, the value can be an integer or floating-point value, or string.

Variable − In computer programming, a variable is an identifier (generally a letter, word, or phrase) that is connected to a value saved in the system’s memory or an expression that can be computed.

Operator − Programming languages generally provide a set of operators that are equivalent to operators in mathematics. A language can include a fixed number of built-in operators such as +,-,*, = in C and C++.

Updated on: 23-Oct-2021

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements