КАТЕГОРИИ:
АстрономияБиологияГеографияДругие языкиДругоеИнформатикаИсторияКультураЛитератураЛогикаМатематикаМедицинаМеханикаОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРиторикаСоциологияСпортСтроительствоТехнологияФизикаФилософияФинансыХимияЧерчениеЭкологияЭкономикаЭлектроника
|
Lexical structure of the programProgram construction consideration principles
There are two program construction consideration principles:
- encapsulation,
- multilevel representation.
The process of shell creating around substances is called encapsulation. The shell is called the capsule. Encapsulated substances are characterized by high internal and low external coupling. Program encapsulation
Using capsule allows to achieve the following purposes: - to consider program capsules as complete parts; - to manipulate program capsules while the program is being written, debugged and read; - to indicate the capsule usage method; - to indicate the capsule processing values; - to limit access to capsule parts; - to hide implementation of the capsule parts; - to use capsules inside other capsules. Multilevel representation
Because of abstraction using in software engineering representation levels of software exist and are widely used. These levels correspond to appropriate phases of software life cycle or reflect different views on it. Encapsulation levels
There are six types of encapsulation levels: - lexical level, - statement level, - subroutine level, - module level, - class level, - megamodule level.
Encapsulation levels
On the lexical level, alphabet characters are encapsulated. Capsule is called the lexeme.
On the statement level lexemes and expressions are encapsulated. Capsule is called the structural statement.
On the subroutine level, statements are encapsulated. Capsules are called subroutines, macros, procedures and functions.
Encapsulation levels
On the module level, types and subroutines are encapsulated. capsules are called modules or packages. They use information hiding and separate compilation.
On the class level, types and subroutines are encapsulated. The capsules are called classes. They use inheriting and polymorphism concepts. On the megamodule level, knowledge and behavior are encapsulated. The capsule is an association of modules and classes. It is called megamodule. Lexical level
The lexical level is the first encapsulation level. It is the simplest level and the background for another encapsulation level.
There are two basic constructions on the lexical level: characters and lexeme. Lexeme
The lexeme is capsule witch encapsulates the alphabet characters. The lexeme is a design, which is limited by special characters or other lexeme. Lexical structure of the program
On the lexical level, the program text consists of the following designs: - Blank characters; - comment statements; - Lexemes (denotations).
Blank characters are used for separating lexemes and improving program understanding. The comment statements are the chains, explaining descriptions in a program text.
|