This repo contains a reference implementation for the Pattern Recognizer algorithm presented in the Chameleon paper.
Run dotnet build
in the root folder.
Run dotnet test
in the root folder.
The Example folder contains an example console app that creates a virtualizer class using the paper's virtual widget definitions.
Run dotnet run
in that folder to run the example.
The source code is organized as follows:
The Parser project defines the GeneralLRParser class which is a GLR parser. The parser receives a set of low-level states and rules and provides a parse method receiving a token sequence.
The ParserGenerator project defines the ParserGenerator class which allows to generate a GeneralLRParser from a higher-level grammar specified as a set of rules.
The PatternRecognizer project defines the PatternRecognizer class to create patter recognizers. These are a specialization of the grammar expected by the ParserGenerator class that better fits or domain where inputs are models (i.e. trees of objects).