Linker and loader are the two system programs that play a vital role in the execution of a program. A linker combines the target program generated by the language translator with all the external references mentioned in the program. Linker produces a machine language program that does not contain any unresolved external references. This machine language code is an executable … [Read more...] about Linker and Loader in System Programming
Compiler Design
Macro in System Programming
Macro in system programming is a feature of a programming language that allows programmers to define an abbreviation for a piece of code. The programmer uses this abbreviation wherever he/she has to repeat the corresponding piece of code in the program. The macro processor scans this source program with macros. Wherever the processor comes across the macro abbreviations, it … [Read more...] about Macro in System Programming
Assembler in Computer
An assembler in a computer is a kind of language processor. It translates the assembly language into machine language. However, the program in assembly language may have some pseudo instructions. These instructions cannot be directly translated to the equivalent machine instruction. In this case, we need to scan the assembly code two or multiple times through the … [Read more...] about Assembler in Computer
Language Processor
A language processor is a processor that processes a language and translates it into another language. In system programming, a language processor processes a program in the source language and translates it into the target language. Usually, the source language is a programming language, and the target language is a machine language. While translating, it even identifies the … [Read more...] about Language Processor
Specification of Tokens
Specification of tokens depends on the pattern of the lexeme. Here we will be using regular expressions to specify the different types of patterns that can actually form tokens. Although the regular expressions are inefficient in specifying all the patterns forming tokens. Yet it reveals almost all types of pattern that forms a token. Content: Specification of Tokens … [Read more...] about Specification of Tokens
Intermediate Code Generation
Intermediate code generation is a phase in the compiler. In our earlier content ‘Compiler in Computer’, we have discussed Intermediate code generation. It gets its input from the semantic analysis phase and serves its output to the code optimizer phase. The intermediate code generator generates some intermediate representation. And from this intermediate … [Read more...] about Intermediate Code Generation
Bottom-Up Parsing in Compiler Design
Bottom-Up parsing is applied in the syntax analysis phase of the compiler. Bottom-up parsing parses the stream of tokens from the lexical analyzer. And after parsing the input string it generates a parse tree. The bottom-up parser builds a parse tree from the leaf nodes and proceeds towards the root node of the tree. In this section, we will be discussing bottom-up parsing … [Read more...] about Bottom-Up Parsing in Compiler Design
Top-Down Parsing in Compiler Design
Top-down parsing processes the input string provided by a lexical analyzer. And generate a parse tree for that input string using leftmost derivation. The top-down parsing first creates the root node of the parse tree. And it continues creating its leaf nodes. Remember the top-down parsing cannot handle the grammar with left recursion and ambiguity. In this section, we … [Read more...] about Top-Down Parsing in Compiler Design
Context-free Grammar
Context-free grammar (CFG) is a set of production rules that generates context-free language. In this context, we will be learning about the ambiguity in the CFG, its simplification, and its applications. Content: Context-free Grammar What is Context-free Grammar? Notational Conventions of CFG Ambiguity in Context-free Grammar Simplification of Context-free … [Read more...] about Context-free Grammar
Syntax Directed Translation (SDT)
In syntax-directed translation, the translation of source language to destination language is completely directed by the parser or the syntax analysis phase. The syntax-directed translation produces an annotated parse tree. Let us learn more about syntax-directed translation. Content: Syntax Directed Translation (SDT) What Syntax Directed Translation? Syntax Directed … [Read more...] about Syntax Directed Translation (SDT)