This is the second portion of the two-part project and the last assignment for the whole semester. In this portion, we are now allowed to generate .bs2 code and in turn, run it on the Scribbler robot whereas in the first portion we simply had an introduction and produced results based largely on theory. Once I had completed this small project, I had the strong feeling to take an eventual compiler course at UMass. I didn't so much enjoy working with the Scribbler robot, but I felt I got a strong grasp on lexing and parsing fundamentals and the overall development of a compiler. However, this isn't the first time I've worked with lexers and parsers; I originally took Professor Bill Moloney's Computing IV course a year previous, but had to drop it due to financial constraints of an extreme nature. In that short time I worked with the flex and bison tools within C/C++ and learned a great deal. Frankly, to me, the fundamentals of compiler construction are more easily understood from a C/C++ perspective than from Java's perspective. I feel it has to do with the shielding Java provides versus the low level nature C/C++ allows.
This is the first portion in a two-part project involving the construction of a small compiler for the scribbler robot. The professor had already written up most of the front and back ends and required us to simply adjust the given code to incorporate new functions, namely an unconditional loop, for loop and a break statement. This largely involved playing around and adding to the lexer and parser source code. Upon a successful build, the program should be able to evaluate these statements and perform the necessary actions.
To me, this assignment was a little bit of fun. We were tasked with reading an input file and evaluating what was found in the file, much the same way a compiler does for source code(albeit extremely basic). This evaluation was elementary in that we created a global variable, if you will, named Environment, that stored the name:value pairs found in the file. Once we had the program understand what was in the data input file, we simply output our choice of varying arithmetic expressions and solve. This marked the beginning of a later two-part project which involved developing a small compiler based around the Scribbler robot.
This assignment once again builds on the previous, this time with the addition of the Filter and FilterTest classes. The former compares the input number to the numbers in the list and responds with those elements in the list less than the input given. The latter was our first look at JUnit testing, of which I found to be very useful and is something that I will definitely be using in future projects. All required tasks to be performed on the list
required by the specification were implemented successfully.
This assignment introduced us to the concept of the object oriented linked list, originally developed in this variation at Rice University. Here, I once again customized the code a bit for randomness and for it's output interface. The requirement for this assignment simply stated to populate the list and perform the computations and output the result. All methods on the list required by the specification were implemented successfully.
This assignment required manipulating a turtle implementation, found in the library of the book for this course. We were tasked with having the turtle move to output its path in an output window. Of the requirements, we were to output a rectangle, hexagon, a house, my first name and a circular drop of pictures. The first four parts are pretty straightforward, but the last part I customized a bit. I put together a set of pictures of Tux, the Linux mascot, and had the five different pictures drop randomly into the invisible circle(of varying sizes), of which you can see in four different pictures posted in the wiki.
This program and the next(the final program for this course) are
essentially the same in that they contain the same user interface
features and produce the same results. While offering identical options
the final program is written in Java instead of C++. The goal was to
create a more efficient university list of professors via the Standard
Template Library and the total amount of code is a little above 800
lines, as a result it is relatively short. I had wished to have had
utilized the STL in the previous program where C-style lists were used
but it wasn't allowed. This program and the next, although they are the
same in nature but differ only in languages are my favorite from this
course as they are feature rich. Also, per order of the instructor, I
have tried to make these two programs as error free as possible as
there is a lot of error checking that was implemented. So feel free to
compile them, run them and even try to break them. If you find a bug
please let me know. Features include adding elements to the list,
current number in the list, maximum the list can hold via your system,
print all elements, order elements in reverse, update information on an
element, sort the list, delete duplicates, delete an element, and clear
the entire list.
Enjoy!
This version contains more methods to manipulate polynomials. Three
arithmetic operations are employed; addition, subtraction and
multiplication. Finding the derivative is also employed. And, one that
I like, for any value of x the computation of the polynomial is
produced. So if your value of x is 2 and the numbers entered are 3 4 5,
which represents the polynomial 3x^2 + 4x + 5, then the answer is 3(4)
+ 4(2) + 5 = 25. Finally, returning the degree of a polynomial and
comparing two polynomials for equality is implemented. Please read
main.cpp's extensive comments for more details on the methods and their
operations. Enjoy!
This is a simple program(also the first version) that accepts as input
int's or double's and produces output in the form of a polynomial
expression. The input is inserted into an array and the index value of
an input is represented as the power of that term. For example, the
input: 3 5 6 19 4.2 produces the output: 3x^4 + 4x^3 + 6x^2 + 19x +
4.2. Likewise, for the input: 4 -7.1 0 0 8.59 2 produces the output:
4x^5 - 7.1x^4 + 8.59x + 2. In the second version more methods are added
to manipulate the array; addition, subtraction and multiplication to
name a few.
Here is the second version of the university database program. The main
difference in this version is the use of C++ classes rather than the
first version's C-style structs. The menu display in this version is
also different in that it is presented all at once whereas the first
version displayed submenus upon valid user input.
This program is similar to Notation Translation in that they both
require postfix expressions. Expression Eval differs in that it
utilizes tree data structures. This program also allows the user to
enter an expression and give its variables values in which the program
will manipulate and calculate.
Nice program that showcases jobs as they are entered into a queue and
run. The output is their time spent in the queue and/or time waiting
for other jobs to finish their operations as each job is given a 15
second window to complete then each is pushed on the stack to wait.
Mathematical Notation Translation, adapted from "Data Structures - An Advanced Approach Using" by Esakov & Weiss
This is another implementation from the book required in the course and
is the partial subject of chapter 4, polynomial addition.
This is an implementation from the book required in the course and is
the partial subject of chapter 4 and is not fully functional, if I
recall correctly.