AvailCompilerBipartiteRendezvous

class AvailCompilerBipartiteRendezvous

An AvailCompilerBipartiteRendezvous comes at parsing from both sides to maximize the freedom of implementation of the parser. It uses dynamic programming to avoid parsing the same subexpression multiple times. When a new continuation needs to run against all possible subexpressions, it looks up the current parser state in a map to get the bipartite rendezvous. That contains the list of subexpressions that have been parsed so far. They are all run against the new continuation. The continuation is then added to the bipartite rendezvous's list of actions. When a new complete subexpression is found it is run against all waiting actions and added to the list of subexpressions.

These two cases ensure each continuation runs with each subexpression – without requiring any particular order of execution of the continuations. That allows us to reorder the continuations arbitrarily, including forcing them to run basically in lock-step with the lexical scanner, avoiding scanning too far ahead in the cases of dynamic scanning rules and power strings. It also allows parallel execution of the parser.

Author

Mark van Gulik

Constructors

Link copied to clipboard
fun AvailCompilerBipartiteRendezvous()