I am having issues with a Backus Naur assignment
I want to define rules that allow for an integer named x to have one of the following:
0-F followed by “h” to define a hex value,
0-1 to define a binary value, or
0-9 followed by a “d” to define a decimal value.
For example, int x = 3d would be a legal statement
On the other hand, int x= 4b would not be legal (binary numbers can only be 0 r 1
I would like to know how to go about doing that.
Check out the algorithm for solving the problem.
Get Answers For Free
Most questions answered within 1 hours.