Skip to content
This repository has been archived by the owner on Apr 4, 2018. It is now read-only.

Commit

Permalink
Update/improve documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
threedaymonk committed Mar 23, 2012
1 parent 35b8a64 commit de8eb09
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
23 changes: 21 additions & 2 deletions README.md
Expand Up @@ -6,6 +6,7 @@ challenges with our current embedded Ruby implementations, specifically:

* Verifying correctness: no cycles, dead ends, or unreachable nodes
* Retaining readability and terseness
* Have some kind of form that we can share over an API

It's named after the prophets of antiquity. Why Sibyl? Well, I could hardly
call it Oracle or Delphi, could I?
Expand All @@ -15,7 +16,9 @@ Syntax

The syntax is relatively simple, and consists of metadata, steps, and outcomes.
The grammar is specified in the file `lib/sibyl/parser.rb`; some examples
follow:
follow. Note that white space is not really significant (the indentation and
line breaks are just a convention) and that anything between `{` and `}` is
evaluated as Ruby against a context object.

-- Metadata
metadata need 1660
Expand Down Expand Up @@ -46,8 +49,13 @@ follow:
otherwise -> "step i"
option quux -> "step j"

-- Reject values that fail a logical test
step number "step k"
reject { input.odd? }
go -> "step l"

-- Define final steps
outcome "step j"
outcome "step l"

Usage
-----
Expand All @@ -56,3 +64,14 @@ Usage
graph = Sibyl::Graph.new(source)
graph.validate! # raises an exception if the graph is incorrect
step = graph.walk(["yes", "a", "1"])

Validation
----------

Validation checks that:

* There are steps
* Each step is valid
* No step is unreachable
* Every possible exit leads somewhere
* The graph is acyclic
2 changes: 1 addition & 1 deletion TODO.txt
@@ -1,2 +1,2 @@
* Create input classes for input types to deserialise numbers, dates, etc.
* Expose expected input for use by web side.
* Syntax check expressions (use Ripper.lex from standard library?)

0 comments on commit de8eb09

Please sign in to comment.