Question: (15 points) Write code that that lets you know if a string is an integer literal or not. Based on the definition from problem 6.


(15 points) Write code that that lets you know if a string is an integer literal or not. Based on the definition from problem 6. An integer constant is a decimal (base 10), octal (base 8), or hexadecimal (base 16) number that represents an integral value. Use integer constants to represent integer values that can't be changed. If an integer constant begins with 0x or 0X, it's hexadecimal. If it begins with the digit 0 , it's octal. Otherwise, it's assumed to be decimal. No white-space characters can separate the digits of an integer constant. These examples show some valid decimal, octal, and hexadecimal constants. 6. (15 points) Create a regular expression, DFA, and Regular Grammar for the integer constant
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
