[SOLVED] CE305-Assignment 1 Expression Analyser

20.99 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (3 votes)

You are expected to provide a specification of the languages. The main features of your expression language should support integer number and variable, and also support assignment.

These should include:

  • The tokens of the expression
  • The syntax of the expression

 

The Implementation

You need to produce both pretty-print and evaluator by using Antlr and Java.

  • The pretty-print should display the internal representation of parsed expressions in an easily readable form, such as LISP-like text form (root children).
  • The evaluator should evaluate the value of given expressions.
  • Sensible error messages should be produced if ill-formed expressions are given.

 

Extended Features

  • Visual rendering of Abstract Syntax Tree (AST) using tools such as java swing or graphviz or similar tools. You will be expected to select and learn about the tools by yourself.
  • Handling of both integer and floating-point numbers.
  • Support for multiple statements and control flow for multiple statements with Boolean expressions.

 

The Report

The maximum length of the report is of 10 pages

(include the appendix). The report should include

  • A section that describes the specification.
  • A section that describes the implementation.
  • A section that describes how the tools were applied.
Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.