World Languages, asked by amitkumar2342, 1 year ago

Explain the issuses in language translation with steps

Answers

Answered by Neeraj23051
0
Programming Language Syntax

The syntax of a programming language describes the structure of programs 
without any consideration of their meaning.

Examples of syntax features:

statements end with ';' (C,C++, Pascal), with'.' (Prolog), or do not have an ending symbol (FORTRAN)

variables must start with any letter (C, C++, Java), or only with a capital letter (Prolog).

the symbol for assignment statement is '=', or ':=' , or something else.

Key criteria concerning syntax

Readability – a program is considered readable if the algorithm and data are apparent by inspection.

Writeability – ease of writing the program.

Verifiability – ability to prove program correctness (very difficult issue)

Translatability – ease of translating the program into executable form.

Lack of ambiguity – the syntax should provide for ease of avoiding ambiguous structures..

Basic syntactic concepts in a programming language

Character set – the alphabet of the language. 
Several different character sets are used: ASCII, EBCIDIC, Unicode.

Identifiers – strings of letters of digits usually beginning with a letter

Operator Symbols – +-*/

Keywords or Reserved Words – used as a fixed part of the syntax of a statement.

Noise words – optional words inserted into statements to improve readability.

Comments – used to improve readability and for documentation purposes. 
Comments are usually enclosed by special markers.

Blanks – rules vary from language to language. Usually only significant in literal strings.

Delimiters – used to denote the beginning and the end of syntactic constructs.

Expressions – functions that access data objects in a program and return a value

Statements – these are the sentences of the language, describe a task to be performed.

Overall Program-Subprogram Structure

Separate subprogram definitions: separate compilation, linked at load time. 
Advantages: easy modification.

Separate data definitions: Group together all definitions that manipulate a data object. 
General approach in OOP.

Nested subprogram definitions: Subprogram definitions appear as declarations within the main program or other subprograms. Not used in many contemporary languages. Provides for static type checking in non-local referencing environments.

Separate interface definitions: Subprogram interface - the way programs and subprograms interact by means of arguments and returned results. A program specification component may be used to describe the type of information transferred between separate components of the program. 
E.G. C/C++ use header files as specification components.

Data descriptions separated from executable statements. A centralized data division contains all data declarations. E.G. COBOL. Advantage - logical data format independent on algorithms.

Unseparated subprogram definitions: No syntactic distinction between main program statements and subprogram statements. Allows for run-time translation and execution.

Similar questions
Math, 7 months ago