Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Coursework One Infix expression to Prefix expression The coursework is worth 1 5 % of the total mark for this module. In this coursework, you

Coursework One
Infix expression to Prefix expression
The coursework is worth 15% of the total mark for this module. In this coursework, you are
required to specify and build an expression converter that can convert Infix expression to
Prefix expression. You are also required to produce both pretty-print and evaluator by
using Antlr and Java. The main features of your expression analyser should support both
integer number and variable, hence support coursework statement. The final program should
produce sensible error messages given ill-formed expressions. Finally, you are required to
submit a report which describes the specification of the language, and the implementation of
main and extended features.
The Specification
Infix expression: The expression of the form a operator b (a + b). When an operator is in-
between every pair of operands.
Prefix expression: The expression of the form a b operator (+ab). When an operator
precede the two operands that they work on.
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
coursework. These should include:
The tokens of the expression language.
The syntax of the expression language.
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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions

Question

u = 5 j , v = 6 i Find the angle between the vectors.

Answered: 1 week ago

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago