Introduction to The First Programming Project

Added on - 13 Sep 2019

  • Dissertation


  • 3


  • 758


  • 92


  • 0


Showing pages 1 to 1 of 3 pages
InstructionsThe first programming project involves writing a program that parses, usingrecursive descent, a GUI definition language defined in an input file andgenerates the GUI that it defines. The grammar for this language is definedbelow:gui::=Window STRING '(' NUMBER ',' NUMBER ')'layout widgetsEnd '.'layout::=Layoutlayout_type':'layout_type::=Flow '('[align]')'|Border '('[NUMBER ',' NUMBER]')'|Grid '(' NUMBER ',' NUMBER[',' NUMBER ',' NUMBER]')'align::=LEFT|RIGHT|CENTERwidgets::=widget widgets|widgetwidget::=Button STRING ';'|Groupradio_buttonsEnd ';'|Label STRING ';'|Panellayout widgetsEnd ';'|Textfield NUMBER ';'radio_buttons::=radio_button radio_buttons|radio_buttonradio_button::=Radio STRING ';'In the above grammar, the red symbols are nonterminals, the blue symbolsare tokens and the black punctuation symbols are BNF metasymbols.Among the tokens those in title case are keywords. The character literalsare punctuation tokens.Below is an explanation of the meaning of some of the symbols in the aboveproductions that should help you understand the actions that are to beperformed when each of the productions is parsed:In thewindowproduction the string is name that is to appear in the topborder of the window and the two numbers are the width and height of thewindowIn the production forlayout_typethat define the grid layout, the firsttwo numbers represent the number of rows and columns, and the optionalnext two the horizontal and vertical gaps
You’re reading a preview

To View Complete Document

Become a Desklib Library Member.
Subscribe to our plans

Unlock This Document