Question: Programming Languages and Paradigms COMP 302, Winter 2018 Assignment 2 Due date: Wednesday, February 28, 2018 This assignment focuses on building and validating a parser

 Programming Languages and Paradigms COMP 302, Winter 2018 Assignment 2 Duedate: Wednesday, February 28, 2018 This assignment focuses on building and validatinga parser for the WML language within Scala. Your code must run

Programming Languages and Paradigms COMP 302, Winter 2018 Assignment 2 Due date: Wednesday, February 28, 2018 This assignment focuses on building and validating a parser for the WML language within Scala. Your code must run without error or modification using Scala 2.12 Note that you must follow the given naming, input, and output requirements precisely. All code should be well-commented, in a professional style, with appropriate variables names, indenting (uses spaces and avoid tabs), etc. The onus is on you to ensure your code is clear and readable. Marks will be very generousl;y deducted for bad style, lack of clarity, or failing to follow the required instructions. Your code should endeavour to follow a pure functional programming style. In particular, and unless specifically stated otherwise, all data types must be immutable, and data may not be modified once assigned or bound. Note that this means you may not use var declarations, while or do-loops, ArrayBuffers or other mutable structures, nor may you reassign Array element values after creation The goal of this assignment is to be able to successfully parse the WML language described in class, and presented as an explicit grammar in the accompanying grammar.txt file 1. (a) For each of the non-constant tokens in the WML grammar define a regular expression (Regex 8 object) that would match it precisely at the start of a string. Bind your regular expressions to val's, named as per the token name, with a capital starting letter and all other letters lowercase Note that "anything" in some of the token descriptions includes whitespace (and newlines too!) Answer this question by providing a file qla.scala that contains only the requested val defini- tions (as something you could cut-and-paste into the REPL), without any outer wrappers Programming Languages and Paradigms COMP 302, Winter 2018 Assignment 2 Due date: Wednesday, February 28, 2018 This assignment focuses on building and validating a parser for the WML language within Scala. Your code must run without error or modification using Scala 2.12 Note that you must follow the given naming, input, and output requirements precisely. All code should be well-commented, in a professional style, with appropriate variables names, indenting (uses spaces and avoid tabs), etc. The onus is on you to ensure your code is clear and readable. Marks will be very generousl;y deducted for bad style, lack of clarity, or failing to follow the required instructions. Your code should endeavour to follow a pure functional programming style. In particular, and unless specifically stated otherwise, all data types must be immutable, and data may not be modified once assigned or bound. Note that this means you may not use var declarations, while or do-loops, ArrayBuffers or other mutable structures, nor may you reassign Array element values after creation The goal of this assignment is to be able to successfully parse the WML language described in class, and presented as an explicit grammar in the accompanying grammar.txt file 1. (a) For each of the non-constant tokens in the WML grammar define a regular expression (Regex 8 object) that would match it precisely at the start of a string. Bind your regular expressions to val's, named as per the token name, with a capital starting letter and all other letters lowercase Note that "anything" in some of the token descriptions includes whitespace (and newlines too!) Answer this question by providing a file qla.scala that contains only the requested val defini- tions (as something you could cut-and-paste into the REPL), without any outer wrappers

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!