Question: Using Plait ( a sub extension of racket ) , write the grammar of a language that accepts valid phone numbers with the area codes
Using Plaita sub extension of racket write the grammar of a language that accepts valid phone numbers with the area codes or A valid phone number has the formar xxxxxxxxxx The xs are digits
Define a type digits that can be any digit from Define another type threedigits that is a sequence of digits and another type, fourdigits that is a sequence of digits. Additionally define the type area code that can be or
Lastly create a function that validates if the phone number inputed is valid. Note: This should not be a program but a language. There must be parsing involved defining the types
use this BNF as reference:
::
Val Val Val Val
::
Val or
::
Val Val Val Val
::
Val Val Val Val Val
::
Val to corresponding to the digit value
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
