Regular expression Compressing Parser
lassenielsen/librcp
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
INTRODUCTION: This is the Regular expression Compressing Parser library. Most regular expression based tools offer matching, which allows certain substrings to be identified. Parsing gives an entire parsetree with respect to the given grammar, which holds more information. This library considers a regular expression as a (regular) parsing grammar, and the result og 'matching' is thus not a fixed set of substrings, but a parsetree. The parsetree is given in a compressed format called a bit-code, which uses the information in the regular expression, to compactly represent the parsetree. Often this representation will be more compact than the ASCII represnetation of the string. There are multiple approaches to regular expression based parsing, and this library offers the most efficient known algorithms. - frca is a version of the table based algorithm by Frisch and Cardelli. - dfa is a version of the DFA based algorithm by Dubé and Feeley. - dfasim is a veriant of dfa, where the DFA nodes and edges are generated by need. Also two versions of the backtracking algorithm are implemented This software is written by Lasse Nielsen(lasse.nielsen.dk<at>gmail<dot>com), and distributed under the GNU GPL v.3 or later. This means that it is perfectly legal to obtain, use, study and develop this software, as long as the same rights are given for the derived products. Information about the GNU GPL can be found at the Free Software Foundation (www.fsf.org) or more specifically at http://www.gnu.org/licenses/gpl.html INSTALLATION: To install the library, make sure the dependancies are installed, and then type -make config -make build -sudo make install This will install the library. To build the test-application go to the programs folder and write -make config -make build This will build the test-application rcpmatch. To test the installation simply write -./rcpmatch dfasim compress '(a*b)*+a*a' 'aaaa' This should use the dfasim algorithm to parse the string 'aaaa' wrt. the regular expression '(a*b)*+a*a'. If you wish to try the backtracking algorithm which is used by most regular expression engines, simply try -./rcpmatch re compress '(a*b)*+a*a' 'aaaa' but be warned, that if the number of a's is increased, the algorithm quickly becomes slow.
About
Regular expression Compressing Parser
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published