Computer Knowledge
Programming Languages and Compilers
2,284 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
-
Recognised only by a Turing machine
-
Context-sensitive
-
Regular
-
Unrestricted
-
Context-free
E
Correct answer
Explanation
C is a context-free language.
-
Linker
-
Assembler
-
Compiler
-
Loader
-
Interpreter
A
Correct answer
Explanation
In computer science, a linker or link editor is a computer program that takes one or more object files generated by a compiler and combines them into a single executable program.
-
High-level language
-
Microcode
-
Interrupt
-
Computer organization
-
Instruction set architecture
E
Correct answer
Explanation
An instruction set, or instruction set architecture (ISA), is the part of the computer architecture related to programming, including the native data types, instructions, registers, addressing modes, memory architecture, interrupt and exception handling, and external I/O. An ISA includes a specification of the set of opcodes (machine language), and the native commands implemented by a particular processor.
-
assembler
-
compiler
-
interpreter
-
operating system
-
both 2 and 3
B
Correct answer
Explanation
A compiler reads the entire program and converts it to the object code. It provides error, not of one line but error of the entire program. It takes more time for converting the lengthy programs. So this option is correct.
-
Machine language
-
Assembly language
-
Object code
-
Source code
-
Spaghetti code
A
Correct answer
Explanation
Yes, it is correct. Machine code or machine language is a set of instructions executed directly by a computer's central processing unit (CPU).
-
Both are procedural
-
Both are based on lambda calculus
-
Both are declarative
-
Both use Horn Clause
-
Both are imperative
C
Correct answer
Explanation
Declarative programming is a non-imperative style of programming in which programs describe their desired results without explicitly listing commands or steps that must be performed. Functional and logical programming languages are characterized by a declarative programming style.
-
Software bootstrapping
-
Compliler bootstrapping
-
Absolute loader
-
Linker
-
Program loading
A
Correct answer
Explanation
Here, the simplest environment will be, perhaps, a very basic text editor and an assembler program.
-
Compiler
-
Interpreter
-
YACC
-
Byte code verifier
-
Compiler bootstrapping
D
Correct answer
Explanation
It permits only some byte code sequences in valid programs.
-
MASM32 assembler
-
SPARC assembler
-
MASM assembler
-
YACC
-
The object code
C
Correct answer
Explanation
It supported a wide variety of macro facilities and structured programming idioms, including high level constructions for looping, procedure calls and alternation.
-
Lexical analysis
-
Syntax analysis
-
Compiler
-
Code generation
-
Byte code verifier
B
Correct answer
Explanation
It is to make explicit the hierarchical structure of the incoming token stream by identifying which parts of the token stream should be grouped together.
-
YACC
-
LEX
-
LALR
-
MASM32 assembler
-
SPARC assembler
B
Correct answer
Explanation
A LEX source program is consisting of a set of regular expressions together with an action for each regular expression.
-
Language processor
-
Execution gap
-
Semantic gap
-
Semantics
-
Specification gap
E
Correct answer
Explanation
It is the gap between the application domains and programming language domains.
-
Type-1 grammars
-
Type-0 grammars
-
Type-2 grammars
-
Left regular grammars
-
Right regular grammars
B
Correct answer
Explanation
Their productions permit arbitrary substitution of string during derivation or reduction, hence they are not relevant to specification of programming languages.
-
Assembly
-
FORTRAN
-
C
-
JAVA
-
None of the above
C
Correct answer
Explanation
Writing a compiler requires modular and structured functions to execute compiler operations. One may also require to access the hardware directly, so such facility is required in the language. The language must also provide facility to handle complex data bases and structures with ease. C language provides all such facilities. So, it will be picked.
-
JAVA
-
C++
-
PROLOG
-
ASP.NET
-
None of these
C
Correct answer
Explanation
Prolog is a general purpose logic-programming language specially used for artificial intelligence.