input file and generates the GUI that it defines

Project 1

The first programming project involves writing a program that parses, using recursive descent, a GUI

definition language defined in an input file and generates the GUI that it defines. The grammar for this

language is defined below:

gui ::=

Window STRING ‘(‘ NUMBER ‘,’ NUMBER ‘)’ layout widgets End ‘.’

layout ::=

Layout layout_type ‘:’

layout_type ::=

Flow |

Grid ‘(‘ NUMBER ‘,’ NUMBER [‘,’ NUMBER ‘,’ NUMBER] ‘)’

widgets ::=

widget widgets |


widget ::=

Button STRING ‘;’ |

Group radio_buttons End ‘;’ |

Label STRING ‘;’ |

Panel layout widgets End ‘;’ |

Textfield NUMBER ‘;’

radio_buttons ::=

radio_button radio_buttons |


radio_button ::=

Radio STRING ‘;’

In the above grammar, the red symbols are nonterminals, the blue symbols are tokens and the black

punctuation symbols are BNF metasymbols. Among the tokens those in title case are keywords. The

character literals are punctuation tokens.

Below is an explanation of the meaning of some of the symbols in the above productions that should

help you understand the actions that are to be performed when each of the productions is parsed:

 In the window production the string is the name that is to appear in the top border of the

window and the two numbers are the width and height of the window

 In the production for layout_type that define the grid layout, the first two numbers represent

the number of rows and columns, and the optional next two the horizontal and vertical gaps

 In the production for widget that defines a button, the string is the name of the button

 In the production for widget that defines a label, the string is text that is to be placed in the label

 In the production for widget that defines a text field, the number is the width of the text field

 In the production for radio_button, the string is the label of the button

You parser should properly handle the fact that panels can be nested in other panels. Recursive

productions must be implemented using recursion. Syntactically incorrect input files should detect and

report the first error.


Below is an example of an input file:

Window “Calculator” (200, 200) Layout Flow:

Textfield 20;

Panel Layout Grid(4, 3, 5, 5):

Button “7”;

Button “8”;

Button “9”;

Button “4”;

Button “5”;

Button “6”;

Button “1”;

Button “2”;

Button “3”;

Label “”;

Button “0”;




Calculate the price of your order

Simple Order Process

Fill in the Order Form

Share all the assignment information. Including the instructions, provided reading materials, grading rubric, number of pages, the required formatting, deadline, and your academic level. Provide any information and announcements shared by the professor. Choose your preferred writer if you have one.

Get Your Order Assigned

Once we receive your order form, we will select the best writer from our pool of experts to fit your assignment.

Share More Data if Needed

You will receive a confirmation email when a writer has been assigned your task. The writer may contact you if they need any additional information or clarifications regarding your task

Let Our Essay Writer Do Their Job

Once you entrust us with your academic task, our skilled writers embark on creating your paper entirely from the ground up. Through rigorous research and unwavering commitment to your guidelines, our experts meticulously craft every aspect of your paper. Our process ensures that your essay is not only original but also aligned with your specific requirements, making certain that the final piece surpasses your expectations.

Quality Checks and Proofreading

Upon the completion of your paper, it undergoes a meticulous review by our dedicated Quality and Proofreading department. This crucial step ensures not only the originality of the content but also its alignment with the highest academic standards. Our seasoned experts conduct thorough checks, meticulously examining every facet of your paper, including grammar, structure, coherence, and proper citation. This comprehensive review process guarantees that the final product you receive not only meets our stringent quality benchmarks but also reflects your dedication to academic excellence.

Review and Download the Final Draft

If you find that any part of the paper does not meet the initial instructions, send it back to us with your feedback, and we will make the necessary adjustments.