Skip to content

takkyu2/simple-re-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-re-compiler

This is a simple (and presumably very slow) compiler of regular expressions. It supports minimal numbers of regex operators: ?, *, +, |.

CAUTION: The code is at very early stage, so it may not work properly.

Usage

  1. make
  2. ./comp "input string" "regex" (ex: ./comp "abcabcabc" "(abc)*")

references

The transformation from the regex to the nondeterministic finite automaton with ε-moves is based on the Thompson algorithm, the details of which are clearly explained in this article by Russ Cox.

The implementation of the parser and tokenizer mimics the one used in the early version of chibicc by Rui Ueyama.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published