Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate grammar for query syntax #14

Open
DrSensor opened this issue May 25, 2019 · 0 comments
Open

Separate grammar for query syntax #14

DrSensor opened this issue May 25, 2019 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@DrSensor
Copy link
Owner

Rather than having a bunch of helper function like this:

/// Filter by the current state
fn filter_from(self, state: &str) -> Self::Iter;
/// Filter by the target/next state
fn filter_to(self, state: &str) -> Self::Iter;
/// Group by the current state
fn group_by_from(self, state: &str) -> Self::Map;
/// Group by the target/next state
fn group_by_to(self, state: &str) -> Self::Map;
/// Remove duplicated current state
fn dedupe_from(self, state: &str) -> Self::Iter;
/// Remove duplicated target/next state
fn dedupe_to(self, state: &str) -> Self::Iter;

I think it would be efficient to create separate grammar specialize for querying the state machine. This might be handy when the declaration can be visualized and you want to filter it out using the query syntax.

The query syntax probably will rely on the globbing pattern and boolean operation. For example:

(* -> *) | (A -> * @ Power*) & (* -> C @ *)

☝️ Read as: seach all transient transition or all transition from state A with event name prefixed with Power and all transtition to state C on all event (including empty-event/transiten-transition)

@DrSensor DrSensor added the enhancement New feature or request label May 25, 2019
@DrSensor DrSensor added this to the v1.0 milestone May 25, 2019
DrSensor added a commit that referenced this issue May 25, 2019
@DrSensor DrSensor modified the milestones: v1.0, v2.0-dev Jun 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant