So as part of my Language Design and Implementation module I had to create a language. Well my language is going to be used as the “dummy object” i mentioned before.
The language has been called “Pathy” and is a logical language designed for checking routes and states of a world. The idea is that the user declares their world, then queries it. The world is made up of Nodes, Links, Junctions, Actions and Entities.
Nodes are places in the world where actions can happen and can link to other nodes and junctions; junctions are places in the world that simply act as a means of linking multiple links together. Links are the routes from node-to-node, junction to junction, or node to junction. Entities are then put in the world and are used to check distances (or weights as they’re known to Pathy)
It’s important to note that Pathy has no concept of location, only a position in the world relative to other objects. It’s like the London Underground map: you know what stations are on what lines, and can use it to plan a series of connections. You don’t actually care where the station’s physical location in London is while you’re planning your route, only that you can take the Jubilee line from Baker St to Canning Town in order to connect with the DLR and get to Custom House for Excel – a trip I’ve done a few times.
Granted Pathy isn’t complete, and when it is complete (or at least at version 1.0 when I hand it in) it’ll not be able to compute a route as complex as that, but it should provide the tools for another program to do so.
Pathy is written in Antlr4 and Java and the code can be found in my GitHub repository.