Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

do this two sub-question with explanation 1. What do the bracket metasymbols [ ]

ID: 3606278 • Letter: D

Question

do this two sub-question with explanation

1. What do the bracket metasymbols [ ] indicate in EBNF? A. Choices separated by a bar | where a single element must be chosen B. The enclosed parts are optional C. The enclosed parts of the RHS are optional (can be left out) OR can be repeated (any number of times) The enclosed parts are mandatory D. 2. What is the purpose of a lexer? A. A lexer scans tokens to determine whether the tokens appear in an order that satisfies the grammar rules of a given language. A lexer produces a parse tree A lexer scans an input file and identifies or associates tokens with groups of characters that match a particular token category. A lexer is responsible for executing a left-most derivation B. C. D.

Explanation / Answer

Ans:

1.what do bracket metasymbol[] mean in EBNF?
Ans: B
Explaination:The items which are optional are enclosed between [ and ] which means
the item can be either included or discarded.

2.What is the purpose of lexer?
Ans:C

Explaination:
A lexer performs lexical analysis which takes an input characters stream one at a time and convert it into tokens .