Skip to content

An interpretor for a theoretical programming language called CATGETMOUSE for simulating cat/mouse games.

Notifications You must be signed in to change notification settings

DukeAidanHall/cat-mouse-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cat-mouse-interpreter

An interpreter for a theoretical programming language called CATGETMOUSE for simulating cat/mouse games.

Dev in Four Stages:

Stage 1: Building a scanner to identify different tokens within the program. Significant tokens would be entered into the symbol table for later use.

Stage 2: Implementating an SLR(1)-parsing method across multiple stacks managed by shift and reduce operations from a deterministic finite automaton (DFA) created in JFLAP.

Stage 3: Designing a method to recursively produce a singular tree in parallel to the parser using complex polymorphism for a range of node classes implemented in NodeFile.java.

Stage 4: Creating a graphical interpretation of the user's input. Catching null reference, out-of-bounds, and collision exceptions before runtime and displaying them to the user.

Grid Symbols Key

C --> Current location of the cat
c --> Path of the cat
M --> Current location of the mouse
m --> Path of the mouse
H --> Location of a hole

Included Tests

ptest1.txt --> Demonstrates the ability for the interpreter to hide a mouse within a hole and display a cat over a hole simultaneously (along with other basic movement).

p2test2.txt --> Demonstrates a "winning state" of the game, where a mouse is eaten by a cat.

ptesterrors.txt --> Provides all the possible different types of errors that could occur during the interpretation of a program.

For more information, refer to comments within Interpreter.java.

About

An interpretor for a theoretical programming language called CATGETMOUSE for simulating cat/mouse games.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages