[SOLVED] COL226 Assignment 2-Lexical Analysis for Spreadsheet

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Part-1-Lexical-Analysis-for-Spreadsheet-Assignment-stbhyt.zip (308.8 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
πŸ”’ Securely Powered by:
Secure Checkout
5/5 - (2 votes)

Assignment 2: Lexical Analysis for Spreadsheet Assignment

Read the resource file describing assignments 2-4.

In Assignment 2: you only need to provide the lex specifications, and so do not need to concern yourself with the meaning and implementation of the operations and how they are used.

You need to write clear specifications of the OCaml functions which you implement, and document your code.

Tokens for OCamllex would be, but not limited to:

  • Float constants (with optional sign, no redundant initial zeroes before the decimal point or unnecessary trailing zeroes after the decimal point)
  • Parenthesis β€” ( and )
  • Brackets β€” [and ]
  • Comma β€” ,
  • Colonβ€” :
  • Indices I β€” [ i β€˜ j ]
  • Ranges 1)
  • Unary operators: SUM, AVG, MIN, MAX, COUNT, etc. (see below)
  • Binary operators: ADD (addition), SUBT (subtraction), MULT (multiplication), DIV (division)
  • Assignment operator
  • Formula termination ; (semicolon)

The function operations can be one of the following:

Type 1 (unary operations on ranges of cells):

  • COUNT
  • ROWCOUNT
  • COLCOUNT
  • SUM
  • ROWSUM

β€’ COLSIJM

  • AVG
  • ROWAVG

β€’ COLAVG

  • MIN
  • ROWMIN
  • COLMIN
  • MAX
  • ROWMAX
  • COLMAX

Type 2 (binary operations on ranges of cells):

  • ADD
  • SUBT
  • MULT

β€’ DIV

  • Part-1-Lexical-Analysis-for-Spreadsheet-Assignment-stbhyt.zip