4 Pts Consider Following Grammar Identifiers Id Letter B Z Grammar Allows B Abc Legal Ide Q43892097

(4 pts) Consider the following grammar of identifiers: (id) ::= (letter) := A | B | .. | Z This grammar allows A, A B, and A_B_C as legal identifiers, but not A_, A B, and _B. Change the grammar so that sequences of – are allowed in the middle of an identifier (as in A B_CD), although the identifier must not start or end with a (letter) (id) | (letter)-(id) | (letter) Z Show transcribed image text (4 pts) Consider the following grammar of identifiers: (id) ::= (letter) := A | B | .. | Z This grammar allows A, A B, and A_B_C as legal identifiers, but not A_, A B, and _B. Change the grammar so that sequences of – are allowed in the middle of an identifier (as in A B_CD), although the identifier must not start or end with a (letter) (id) | (letter)-(id) | (letter) Z
Expert Answer
Answer to (4 pts) Consider the following grammar of identifiers: (id) ::= (letter) := A | B | .. | Z This grammar allows A, A B, a…
OR