Giter Site home page Giter Site logo

kronsyc / state-machine Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 2.04 MB

Exposes a builder interface for building state-machines. Also supports the storage and subsequent retrieval of custom data-types at transition paths. The primary intended use case for this tool is lexer building, but it can really be used for anyting

License: MIT License

C++ 98.44% Meson 0.63% C 0.93%

state-machine's Introduction

regex-backend

A tool for creating custom state machines with optional arbitrary data storage

Documentation

All documentation related to the project is generated from source using doxygen

The documentation can be viewed On the github pages site

Building

This package uses meson as it's build management system, and exposes a simple dependency object regex_backend_dep. Consult the meson docs Here to learn more about how to pull dependencies from git, and Here to learn how to use these subproject dependencies

state-machine's People

Contributors

kronsyc avatar

Stargazers

 avatar Fearghal Desmond avatar

Watchers

Kostas Georgiou avatar  avatar

state-machine's Issues

Values not properly copied when merging colliding regexes

When merging colliding regexes, the values on the second regex are not written in, even if the node is free.

What should happen is that when the node is free, the value gets overwritten, or otherwise, we throw an error due to an ambiguous expression.

The ambiguity action may also be configurable with the options (Skip, overwrite, error)

TODO: Add actual documentation

The project currently has absolutely no documentation, apart from the comments on the builder methods, this should probably be fixed if the project is to gain any users

Bug: Loops not properly resolved

When a looped regex node is encountered during a non-basic merge, and wants to be overwritten, the current behavior is to simply skip the merge. What should happen is the following:

  • On original-only transitions: The transition should not loop, but instead write to a copy of the looped base node that existed before any transitions were written
  • On new-only transitions: The current handling is fine
  • On joint transitions: The current handling is fine

TODO: Implement actual regex lookup functions

We need to implement many of the common search functions used with regexes

  • bool matches(string) : Return true if the regex can match the entire string
  • source_range find(string): Return the first range of characters matched by the string
  • lookup_result lookup(string): Attempt to match the beginning of the string, or return an error if it cant
  • size_t find_and_replace(string) replace each party of the input string with the replacement string, returns the number of replacements made

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.