Skip to content

toasa/regexp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

regexp

演算子 *, | とカッコ () のみ対応した正規表現エンジンです。

機能は以下の3つです。

  • パースした構文木の出力
  • NFAの状態遷移図の出力
  • 正規表現の受理判定

DEMO

受理判定

$ go run main.go -regexp "(a|bc)*" -input "aabcabcbca"
(a|bc)* accepts aabcabcbca.

状態遷移図

(a|bc)*

state diagram

Requirement

  • Golang
  • Graphviz処理ツール

Usage

パースした構文木の出力

$ go run main.go -regexp <Regular expression> -ast

NFAの状態遷移図の出力

$ go run main.go -regexp <Regular expression> -state-diagram

正規表現の受理判定

$ go run main.go -regexp <Regular expression> -input <Input string>

License

MIT license

About

自作正規表現エンジン

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages