Question: Develop a Java application using Parboiled library to write a parser for a customer form. Your program should include a grammar for the parser and

Develop a Java application using Parboiled library to write a parser for a customer form. Your program should include a grammar for the parser and display the parse tree with no errors.

The customer form should include the following structure:

First name, middle name (optional), last name

Street address, city, state (or province), country

Phone number

Rules

First name, middle name and last name should start with an uppercase letter followed by lower case letters. Middle name is an optional input meaning such an input may or may not exist. The street address can include any type of letters or numbers. There is no lowercase/uppercase restriction either.

The city name should start with an uppercase letter followed by lowercase/uppercase letters.

The state or province should start with an uppercase letter followed by lowercase/uppercase letters.

The country name should start with an uppercase letter followed by lowercase/uppercase letters.

The phone number should begin with area code in parenthesis, followed by a space, three digits, a hyphen, and four digits.

Example:

John Doe

3609 Mynders Ave, Memphis, TN, United States of America

(901) 345-9834

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!