Skip to content
forked from katef/libfsm

DFA regular expression library & friends

License

Notifications You must be signed in to change notification settings

dkegel-fastly/libfsm

 
 

Repository files navigation

libfsm and friends: NFA, DFA, regular expressions and lexical analysis

; re -cb -pl dot '[Ll]ibf+(sm)*' '[Ll]ibre' | dot

libfsm.svg

Getting started:

Lexing is the process of categorising a stream of items by their spellings. The output from this process is a stream of tokens, each of a specific lexeme category, which are most commonly input to a parser responsible for asserting the order of these tokens is valid.

lx is an attempt to produce a simple, expressive, and unobtrusive lexer generator which is good at lexing, does just lexing, is language independent, and has no other features.

You get:

  • libfsm — library for manipulating FSM (NFA and DFA)
  • libre — library for compiling regular expressions to NFA
  • fsm(1) — command line interface for FSM
  • re(1) — command line interface for executing regular expressions
  • lx(1) — lexer generator

Clone with submodules (contains required .mk files):

; git clone --recursive https://github.com/katef/libfsm.git

To build and install:

; pmake -r install

To build on Linux, you may need to install bmake, and use it instead of pmake in the commands mentioned here.

You can override a few things:

; CC=clang PREFIX=$HOME pmake -r install

Building depends on:

  • Any BSD make. This includes OpenBSD, FreeBSD and NetBSD make(1) and sjg's portable bmake (also packaged as pmake).

  • A C compiler. Any should do, but GCC and clang are best supported.

  • ar, ld, and a bunch of other stuff you probably already have.

Fuzzing depends on the theft property-based testing library:

Ideas, comments or bugs: kate@elide.org

Running the test suite

To run the tests:

; bmake -r LX=./build/bin/lx test

About

DFA regular expression library & friends

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 88.4%
  • Makefile 5.2%
  • Awk 2.0%
  • XSLT 1.2%
  • Perl 0.9%
  • CSS 0.6%
  • Other 1.7%