imporant note (the language of compiler and programming llanguage)
The home work is to do a survey comparing the following three programming language: COBOL , FOTRAN 77, and PASCAL regarding
: 1- Character set.
2- Reserved(key) words and special symbols.
3- Simple data types and data structures used.
4- Control structures used (selection and loop structures)
5- File structure used.
COBOL -
1 - Character set - The letters of the alphabet, digits, and special characters form the COBOL character set .
2 - Reserved(key) words and special symbols - A reserved word is a character-string with a predefined meaning in a COBOL source unit. They have a special meaning and cannot be redefined. There are 85 COBOL Standard reserved words.
3 - Simple data types and data structures used - Data types can be numeric, alphabetic, or alphanumeric. Numeric type consists of only digits 0 to 9. Alphabetic type consists of letters A to Z and spaces. Alphanumeric type consists of digits, letters, and special characters. A COBOL copybook is a selection of code that defines data structures. If a particular data structure is used in many programs, then instead of writing the same data structure again, we can use copybooks.
4 - Control structures used -
5 - File Structure used -
FORTRAN 77 -
1 - Character set - The character set consists of the following:
Uppercase and lowercase letters, A - Z and a - z
Numerals 0 - 9
Special characters
2 - Reserved(key) words and special symbols - In FORTRAN, no keywords are reserved in all contexts. Most statements begin with a keyword; the exceptions are the statement function and assignment statements.
3 - Simple data types and data structures used - Except for specifically typeless constants, any constant, constant expression, variable, array, array element, substring, or function usually represents typed data. On the other hand, data types are not associated with the names of programs or subroutines, block data routines, common blocks, namelist groups, or structured records. Data structures used are -
Singly linked lists
Ragged arrays
A perfectly balanced tree
A date data type
4 - Control structures used -
5 - File structure used - Fortran allows you to read data from, and write data into files. The OPEN, WRITE, READ and CLOSE statements allow you to achieve this.
PASCAL
1 - Character set - The Pascal character set consists of:
- All upper case letters (A-Z)
- All lower case letters (a-z) All digits (0-9)
- Special symbols - + * / := , . ;. () [] = {} ` white space.
2 - Reserved(key) words and special symbols - The statements in Pascal are designed with some specific Pascal words, which are called the reserved words. For example, the words, program, input, output, var, real, begin, readline, writeline and end are all reserved words.
3 - Simple data types and data structures used - Integer, real, Boolean and character types are referred as standard data types. Data types can be categorized as scalar, pointer and structured data types. Examples of scalar data types are integer, real, Boolean, character, subrange and enumerated. Structured data types are made of the scalar types, for example, arrays, records, files and sets. Data structures used are lists, trees and graphs.
4 - Control structures used -
1 - Loops - while-do, for-do, repeat-until, nested.
2 - control statements - break,continue,goto.
5 - File structure used - Pascal treats a file as a sequence of components, which must be of uniform type. A file's type is determined by the type of the componentsThe PASCAL language provides constructs for allocating or initializing, opening, reading, writing, and closing files. File addresses or references are expressed in terms of symbolic file handles, which are represented in PASCAL as names assigned to a given file.
Get Answers For Free
Most questions answered within 1 hours.