Greetings,
The parser generates a wrong entry for an undeclared process, if an IIP is being sent to that name.
Minimal test program:
package main
import (
"github.com/oleksandr/fbp"
"fmt"
)
func main() {
var graph string = `
'5s' -> INTERVAL Ticker(core/ticker) OUT -> IN Forward(core/passthru)
Forward OUT -> IN Log(core/console)
'some IIP data' -> CONF Nonexistant`
parser := &fbp.Fbp{Buffer: graph}
parser.Init()
err := parser.Parse()
if err != nil {
fmt.Println("ERROR:", err)
return
}
parser.Execute()
if err = parser.Validate(); err != nil {
fmt.Println("ERROR:", err)
return
}
fmt.Println("Processes:", parser.Processes)
}
Note that the component Nonexistant was never declared, but an IIP sent to it.
Compile and run with, for example:
GOPATH=`pwd` go build parsertestiip.go && ./parsertestiip
Current output:
Processes: [Ticker(core/ticker) Forward(core/passthru) Log(core/console) Nonexistant(core/console)]
The component path core/console for component Nonexistant is wrong IMO, because that process was never declared and that component path never given.
Expected output:
Processes: [Ticker(core/ticker) Forward(core/passthru) Log(core/console) Nonexistant()]
= for example, the process component should be empty - or some other way to detect / know that the process Nonexistant was never declared. Then I check if fbp.Process.Component = component binary path is empty, and if it is, display an error message, e.g. "IIP to undeclared process X".
Greetings,
The parser generates a wrong entry for an undeclared process, if an IIP is being sent to that name.
Minimal test program:
Note that the component
Nonexistantwas never declared, but an IIP sent to it.Compile and run with, for example:
Current output:
The component path
core/consolefor componentNonexistantis wrong IMO, because that process was never declared and that component path never given.Expected output:
= for example, the process component should be empty - or some other way to detect / know that the process
Nonexistantwas never declared. Then I check iffbp.Process.Component= component binary path is empty, and if it is, display an error message, e.g. "IIP to undeclared process X".