Question: Q2. Suppose that in a programming language decimal, binary and hexadecimal literals can be assigned to an unsigned integer variable. Decimal literals consist of one


Q2. Suppose that in a programming language decimal, binary and hexadecimal literals can be assigned to an unsigned integer variable. Decimal literals consist of one or more digits, and do not begin with zero (O). To specify a binary literal, the prefix Ob or OB is added to the binary number. To specify a hexadecimal literal, the prefix Ox or OX is added to the hexadecimal number. Any length constraint specifying the number of digits in literals should not be taken into consideration in your solution. The following are examples: 20, 105, 68930, .... are decimal literals. 0b101, 060101, 0B101, .... are binary literals. 0x9A4, 0xE3F, 0X87C, .... are hexadecimal literals. a) Define the syntax for those literals using BNF (Backus-Naur Form) notation. (Bu literaller iin szdizimi BNF notasyonu ile tanmlaynz.) b) Build a deterministic finite state machine that will recognize those literals. (Bu literalleri tanyacak bir deterministik sonlu durum makinesi oluturunuz.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
