Skip to content
Menu
Timeless College
  • Alex Cavazzoni
  • Art Classes Near Me
  • AWS Training in Virginia
  • Bad Influence On Children
  • BROWZ safety compliance
  • Clarence McClendon
  • Digital Marketing Consultancy Kelowna
  • Freedom of speech on social media
  • Https://timelesscollege.xyz/
  • Https://timelesscollege.xyz/ – Timelesscollege.xyz
  • Https://www.timelesscollege.xyz/
  • Https://www.timelesscollege.xyz/ – Timelesscollege.xyz
  • In Home Tutoring
  • Integrated Atpl
  • Jewish Intimacy
  • Learn to play guitar online
  • Online Baseball Hitting Trainer
  • Prince George School
  • Quickbooks Classes
  • Sample Page
  • Schreibwettbewerb
  • STOCKS CRYPTO FOREX Trading
  • Timeless College
  • Timeless College – Timelesscollege.xyz
  • Timelesscollege.xyz/
  • Timelesscollege.xyz/ – Timelesscollege.xyz
  • Training as a Pilot
  • Website Creation Atlanta
Timeless College
an abstract syntax tree | My Assignment Tutor

an abstract syntax tree | My Assignment Tutor

October 30, 2021 by seo_automation_owner

pretty Description You must complete the implementation of the pretty program in the file pretty.cpp. The pretty.cpp program reads an XML representation of an abstract syntax tree of a Jack class from standard input and writes the equivalent Jack source code to standard output formatted to a specific coding standard. All output must be written using the write_to_output() function described in iobuffer.h. Startup Files The main function in the pretty.cpp file reads the abstract syntax tree for a Jack class from standard input using the function ast_parse_xml(). It then passes the tree to the function print_class() that uses the functions described in abstract-syntax-tree.h to walk over the abstract syntax tree of the class. You must modify the print_*() functions to add code that will output the equivalent Jack source code to standard output formatted to the specific coding standard described below. Any code that walks the abstract syntax tree of a class will be very similar in structure so the startup files should save you a lot of typing. However, you do not need to follow this structure if you do not want to. You must not modify the main() function but you can modify the remainder of the code as much as you like. Compiling and Running pretty When the Makefile attempts to compile the program pretty, it will use the file pretty.cpp. The program can be compiled and run against the provided tests using the command: % make test 5pretty make will only compile the program if it has not yet been compiled or the source files have changed since it was last compiled. Note: Do not modify the provided Makefile or the sub-directories bin, includes or lib. These will be replaced during testing by the web submission system. Pretty Not every program is laid out to suit individual taste and some programming styles may be difficult for others to read. If you ever have to maintain a program written by others and they have used a coding style you are not familiar with, or worse, the style randomly changes from line to line, your job may become very unpleasant. One way of addressing this problem is to have a pretty printer program that will reformat programs to suit your preferred style. The specific formatting rules that the pretty program must implement are as follows: The indentation level starts at 0.When a line is output, it must start with 2 spaces for each level of indentation.Left curly brackets “{” must be on their own line and the level of indentation is incremented after the line is output.Right curly brackets “}” must be on their own line and the level of indentation count is decremented before the line is outputIf a subroutine contains local variable declarations, there must be an empty line after the last variable declaration.All static, field and local variable declarations must be displayed one variable per line. The lines must be in the order the variables were declared.All static variable declarations must be displayed before field variable declarations.If a class contains both static and field variable declarations, there must be an empty line after the last static variable declaration.If a class contains subroutine declarations and either static or field variable declarations, there must be an empty line after the last variable declaration.All subroutine declarations in a class, except the last, must be followed by an empty line.If a class contains static or field variable declarations, the first declaration must be preceded by the line “// private:“.If a class contains subroutine declarations, the first declaration must be preceded by the line “// public:“.Every if statement and while statement must be followed by a blank line unless they are immediately followed by “}“.Unless otherwise noted, all tokens within a line must be separated by a single space character.There must be no whitespace characters after the last token on a line.Commas “,” and dots “.” do not have any white space before or after them.Left round brackets “(” do not have any white space before them unless the previous token is if, while, =, or an infix operator.Left round brackets “(” do not have any white space after them.Right round brackets “)” do not have any white space before them.Infix expressions in the form X = Y should be displayed as the infix expression X == Y.Unary expressions in the form ~(X < Y) should be displayed as the infix expression (X >= Y). Unary expressions in the form ~(X >= Y) should be displayed as the infix expression (X < Y). Unary expressions in the form ~(X > Y) should be displayed as the infix expression (X

  • Assignment status: Already Solved By Our Experts
  • (USA, AUS, UK & CA PhD. Writers)
  • CLICK HERE TO GET A PROFESSIONAL WRITER TO WORK ON THIS PAPER AND OTHER SIMILAR PAPERS, GET A NON PLAGIARIZED PAPER FROM OUR EXPERTS
QUALITY: 100% ORIGINAL PAPER – NO PLAGIARISM – CUSTOM PAPER

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • QUESTION 1 Which of the following is/are not examples of areas society has been –
  • In finance, one example of a derivative is a financial asset whose value is determined (derived) from a bundle of various assets, such as mortgages.
  • The goal of this assignment is to have you reflect on ageism and how it can harm –
  • nursing shortage – Essay Blazers
  • Project – Essay Blazers

Recent Comments

  • A WordPress Commenter on Hello world!

Archives

  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021

Categories

  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2022 Timeless College | Powered by WordPress and Superb Themes!