Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oleksandr/fbp
A Go parser for .FBP DSL language from NoFlo
https://github.com/oleksandr/fbp
Last synced: 6 days ago
JSON representation
A Go parser for .FBP DSL language from NoFlo
- Host: GitHub
- URL: https://github.com/oleksandr/fbp
- Owner: oleksandr
- License: mit
- Created: 2014-06-20T12:24:21.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-16T21:41:41.000Z (over 10 years ago)
- Last Synced: 2024-08-02T20:46:21.873Z (3 months ago)
- Language: Go
- Size: 195 KB
- Stars: 14
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
NoFlo's FBP DSL parser for Go
===A Go parser for .FBP DSL language from NoFlo
Dependencies
---This is optional. If you want to update the parser's code based on the grammer.peg you need to install the following dependency:
go get github.com/pointlander/peg
This will download and compile _peg_ binary, which you can use later to generate the parser.
The following command will generate the parser:
peg -switch -inline grammar.peg
Installation
---Use regular _go install_ or _go get_ command to download and install the _fbp_ library:
go get github.com/oleksandr/fbp
The library already includes the generated parser.
Basic usage
---import "github.com/oleksandr/fbp"
var graph string = `
'5s' -> INTERVAL Ticker(core/ticker) OUT -> IN Forward(core/passthru)
Forward OUT -> IN Log(core/console)`parser := &fbp.Fbp{Buffer: graph}
parser.Init()
err := parser.Parse()
if err != nil {
t.Log(err.Error())
t.Fail()
}
parser.Execute()
if err = parser.Validate(); err != nil {
t.Log(err.Error())
t.Fail()
}// At this point you have parser.Processes, parser.Connections,
// parser.Inports and parser.Outports data structures...