Thursday, 4 April 2013

Explain the significance of Lexical analysis and Syntax analysis.


Q.n.2 Explain the significance of Lexical analysis and Syntax analysis.

lexical analysis is the process of converting a sequence of characters into a sequence of tokens. A program or function which performs lexical analysis is called a lexical analyzer, laxer or scanner. A laxer often exists as a single function which is called by a parser or another function. The lexical analysis or scanning of a program breaks it into a Sequence of tokens. For example, a sequence of letters and digits May be transformed into a single token representing an identi_er. Similarly, numbers of various types are tokens. Some tokens may correspond to individual symbols in the original string. For Example, the character + may generate a single token. Even in thisCase, the resulting token has been recognized as an operator and The token will normally carry this information. Each type of token is denned by a regular language. The lexical Analysis of a program basically simulates a _niter state machine.

Syntax analysis: syntax analysis or parsing is about discovering structure in text and is used to determine whether or not a text conforms to an expected format. "Is this a textually correct Java program?" or "Is this bibliographic entry textually correct?" are typical questions that can be answered by syntax analysis. We are mostly interested in syntax analysis to determine that the source code of a program is correct and to convert it into a more structured representation (parse tree) for further processing like semantic analysis or transformation.
Syntax analysis is one of the very mature areas of language theory and many methods have been proposed to implement parsers. Giving even a brief overview of these techniques is beyond the scope of this paper, but sees the references in the section called “Further reading”. In the Meta-Environment we use a parsing method called Scanner less Generalized Left-to-Right parsing or SGLR for short. The least we can do is explain what this method is about. The method depends on writing a separate parsing procedure for each kind of syntactic structure, such as if statement, assignment statement, expression and so on, and each of these is only responsible for analysing its own kind of structure. If any structure contains another structure then the parsing procedure can call the procedure for this contained structure.

What is MASM? Explain its features.


Q.n.1 What is MASM? Explain its features.


MASM: Microsoft Macro Assembler
The Microsoft Macro Assembler (MASM) is an assembler for the x86 family of microprocessors, originally produced Microsoft MS-DOS operating system.
The features of MASM are listed below:
1.     It supported a wide variety of macro facilities and structured programming idioms, including high-level constructions for looping, procedure calls and alternation (therefore, MASM is an example of a high-level assembler).
2.     MASM is one of the few Microsoft development tools for which there was no separate 16-bit and 32-bit version.
3.   Assembler affords the programmer looking for additional performance a three pronged approach to performance based solutions.
4.   MASM can build very small high performance executable files that are well suited where size and speed matter.
5.      When additional performance is required for other languages, MASM can enhance the performance of these languages with small fast and powerful dynamic link libraries.
6.   For programmers who work in Microsoft Visual C/C++, MASM builds modules and libraries that are in the same format so the C/C++ programmer can build modules or libraries in MASM and directly link them into their own C/C++ programs. This allows the C/C++ programmer to target critical areas of their code in a very efficient and convenient manner, graphics manipulation, games, very high speed data manipulation and processing, parsing at speeds that most programmers have never seen, encryption, compression and any other form of information processing that is processor intensive.
7.    MASM32 has been designed to be familiar to programmers who have already written API based code in Windows. The invoke syntax of MASM allows functions to be called in much the same way as they are called in a high level compiler.