Syntax Analysis MCQs January 8, 2026December 14, 2024 by u930973931_answers 10 min Score: 0 Attempted: 0/10 Subscribe 1. What is Syntax Analysis? (A) The process of checking the meanings of a program (B) The process of verifying the correctness of a program’s syntax (C) The process of optimizing a program’s code (D) The process of executing a program 2. Which of the following is NOT part of syntax analysis? (A) Parsing (B) Lexical analysis (C) Syntax tree generation (D) Tokenization 3. Which data structure is commonly used by parsers during syntax analysis? (A) Linked list (B) Queue (C) Stack (D) Binary tree 4. What is the primary function of a parser in syntax analysis? (A) To determine if the program follows the syntax rules of the programming language (B) To translate source code into machine code (C) To check if a program is semantically correct (D) To optimize the program’s code 5. Which type of grammar is typically used by parsers in syntax analysis? (A) Unrestricted Grammar (B) Regular Grammar (C) Context-Sensitive Grammar (D) Context-Free Grammar (CFG) 6. In a syntax tree, what does each internal node represent? (A) A non-terminal symbol (B) A terminal symbol (C) A statement (D) A function 7. Which of the following parsing techniques is based on recursive descent? (A) LALR Parsing (B) SLR Parsing (C) LL Parsing (D) LR Parsing 8. Which of the following is a characteristic of top-down parsing? (A) It does not require backtracking. (B) It parses the input from left to right. (C) It is always faster than bottom-up parsing. (D) It begins parsing from the root of the syntax tree. 9. In a Bottom-up parsing approach, what does a parser attempt to reduce? (A) Expressions (B) Terminal symbols (C) Sentences in the language (D) Non-terminal symbols 10. What does an ambiguity in a grammar mean in syntax analysis? (A) The grammar has infinite recursion. (B) The grammar cannot be parsed at all. (C) The grammar is not context-free. (D) The grammar can produce multiple correct parse trees for the same input.