import java.util.Stack; import java.io.FileInputStream; import java.io.FileOutputStream; // the data structure for the graph searching // method of edge linking. Graph = "{" List(GraphNode) *l "}" *l. GraphNode : EndNode | IntermediateNode common EdgeLoc NodeData . EndNode : SourceNode | TargetNode common . NodeData = int [ PathData ] . PathData = "path" int GraphNode. IntermediateNode = "inode" [NodeList] *l. SourceNode = "src" [NodeList] *l. TargetNode = *l "target" *l. NodeList = "list" ListP(GraphNode). PixelCoord = "(" int "," int ")". EdgeLoc = PixelCoord PixelCoord. List(S) ~ { S }. ListP(S) ~ "(" S {"," S } ")" . Main = String. ////////////////////////////////////////////////////////// // datastructures for generating the graph edges and nodes // from the source and target points. GraphGenerator = PixelCoord PixelCoord [ LineEquation ] [ Graph ]. LineEquation = float float int. ////////////////////////////////////////////////////////// // File IO classes Image = int int int.