Computer Knowledge

Programming Languages and Compilers

1,170 Questions

Programming languages and compilers involve the rules, syntax, and semantics used to write and execute software programs. Key areas include scripting languages, object oriented concepts, and parsing algorithms like top down parsers. Practice these computer science questions to build proficiency for technical and computer knowledge exams.

Object oriented languagesScripting languagesCompilers and parsersProgramming syntax

Programming Languages and Compilers Questions

Multiple choice
  1. Recognition of basic syntactic construction through reductions

  2. Creation of more optimal matrix

  3. Recognition of basic elements and creation of uniform symbols

  4. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Machine-independent optimization in compiler design refers to optimizations that can be applied to the intermediate code representation rather than being tied to a specific machine architecture. This involves analyzing and transforming code to create more efficient execution patterns without targeting any particular processor, often through techniques like creating optimal intermediate representations or improving algorithmic efficiency at the code structure level.

Multiple choice
  1. Compiler bootstrapping

  2. Software bootstrapping

  3. Program loading

  4. Symbol resolution

  5. Bootstrap loader

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Here, one can write a more complex text editor, and a simple compiler for a higher level language and so on, until one can have a graphical IDE and an extremely high level programming language.

Multiple choice
  1. Syntax analysis

  2. Lexical analysis

  3. Byte code verifier

  4. Code verification

  5. Code generation

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The parser checks that the tokens appearing in its input, which is the output of the lexical analyzer, occur in patterns that are permitted by the specification for the source language.

Multiple choice
  1. Assembling

  2. Compiling

  3. Translating

  4. Uploading

  5. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Compiling is the process of converting source code written in a high-level programming language into machine code or intermediate code that can be executed by a computer. Assembling works with assembly language, translating is a general term, and uploading refers to transferring files to a server.

Multiple choice
  1. Functionally, both are same.

  2. Both are used to preprocesse the assembler directives.

  3. Both are used to preprocess the compiler directives.

  4. Both provide subroutine facility to language processor.

  5. Both are different, they do not have any similarity.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Both processes are performed before the actual conversion of source program is done. Macro processor puts the actual assembly code in place of Macro symbol, wherever these are used or defined. Compiler pre processor preprocesses the header files and other predefined terms.

Multiple choice
  1. Both converts high level language file in to object file.

  2. Both uses pre-processors before processing main program of the source program.

  3. Both converts the source program into machine language program.

  4. Both uses symbol table in second pass to convert the source into machine language.

  5. Both option 3 and option 4 are correct.

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

Yes, both option 3 and 4 are correct.

Multiple choice
  1. The target machine on which it is being executed.

  2. The target machine other than the machine on which it is being executed.

  3. By default, the target is server machine of the node on which it is being executed.

  4. Cross compiler does not generate machine code.

  5. Both 2 and 3

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Cross compiler generates code for some other target machine defined by user. It can be some other processor or microcontrller or micro processors etc.