Please enable JavaScript.
Coggle requires JavaScript to display documents.
Introduction To Programming Paradigm PART2 :warning: - Coggle Diagram
Introduction To Programming Paradigm PART2 :warning:
Language Definition
Language
Language Syntax
Refer to the structure of the language(
Cara tulis language tu
)
Like a grammar in natural language
Combine a few part of syntax, akan jadi statement
LS is a small part of Language Definition
Lexical Structure
Also known as tokens
Example: If, Else, Identifiers, Names, Specail Puntuation Symbols and Symbols for Operation
Definition
Language Semantic
Meaning of the language(
Meaning behind the syntax
)
Design to ensure bila kita buat language(Macam guideline)
Example of Language yang use ANSI & ISO = C, C++, LISP, Prolog
Language Translation
Types of translator: Interpreter & Compiler
Interpreter
Executes program directly (Masukkan source code, terus execute)
One step process
Compiler
Two step process
Produce a machine code
Compilation Process
Pseudointerpreter
Intermediate between interpreter and compiler.
Translation Process
Lexical Analyzer
Groupkan character into tokens,keyword, identifiers/operators.
Syntax Analyzer
Is known as parse, takes the lexical units(dapat dari scanner), and construct a hierarchical tree.
Semantical Analyzer
Tengok derive the parse tree, nak tengok ada meaning atau tak & check for errors also.
Language Translation maintain:
Runtime environment
Suitable memory space for program data is allocated and that
record the progress of the execution of the program
Interpreter
usually maintain the runtime environment
internally
Compiler
must maintain the runtime environment indirectly
Prepocessor
What is LT?
Must have a translator to translate the program writer into the form which understandable by a machine
Properties of Programming Language
Static Properties: Reffering to a situation where both to a type and to an object. We have to deterimine the properties before we execute.
Example: int x
Dynamic Properties: Tak perlu declaration. Just straight away guna.Determine properties during execution.
Example: Phyton
Errors : :red_cross:
Types of Errors:
Lexical Errors
Occurs during lexical analyzer. Penggunaan character yang salah.
Example: X@ = 2
Syntax Errors
Including missing tokens (symbols)
Example: cin
Logic Errors
Errors that a programmer made, Example: Missing variable in an output statement.
Semantic Errors
Can be either static or dynamic
Example: b+c=a (Right side patutnya variable)
Language Design
Readability
Abstraction
Complexcity Control
Programming Language Evolution
First Generation (1951 – 1957)
Machine Language, Basic Language
Second Generation (1958 – 1963)
Assembly Language, Using abbreviations or easy to remember words.
Third Generation (1964 – 1969)
High Level, FOTRAN, COBOL, Pascal, C
Forth Generation(1970 – 1990)
Very High Level Language, Problem Oriented Language
Fifth Generation (1991 – 2000
and beyond)
Natural Language