lang: Add edges to lexer and parser

This adds some initial syntax for external edges to the language.

There are still improvements which are necessary for send/recv.
This commit is contained in:
James Shubin
2018-02-10 11:22:18 -05:00
parent 80784bb8f1
commit 6370f0cb95
14 changed files with 354 additions and 11 deletions

View File

@@ -836,6 +836,7 @@ func (obj *StmtProg) Graph() (*pgraph.Graph, error) {
// called by this Output function if they are needed to produce the output.
func (obj *StmtProg) Output() (*interfaces.Output, error) {
resources := []resources.Res{}
edges := []*interfaces.Edge{}
for _, stmt := range obj.Prog {
output, err := stmt.Output()
@@ -844,13 +845,13 @@ func (obj *StmtProg) Output() (*interfaces.Output, error) {
}
if output != nil {
resources = append(resources, output.Resources...)
//edges = append(edges, output.Edges)
edges = append(edges, output.Edges...)
}
}
return &interfaces.Output{
Resources: resources,
//Edges: edges,
Edges: edges,
}, nil
}