pulumi/pkg/compiler/core/backend.go
joeduffy e02921dc35 Finish dependency and type binding
This change completes the implementation of dependency and type binding.
The top-level change here is that, during the first semantic analysis AST walk,
we gather up all unknown dependencies.  Then the compiler resolves them, caching
the lookups to ensure that we don't load the same stack twice.  Finally, during
the second and final semantic analysis AST walk, we populate the bound nodes
by looking up what the compiler resolved for us.
2016-11-23 07:26:45 -08:00

21 lines
553 B
Go

// Copyright 2016 Marapongo, Inc. All rights reserved.
package core
import (
"github.com/marapongo/mu/pkg/ast"
)
// Backend represents the last phase during compilation; it handles code-generation and emission.
type Backend interface {
Phase
// CodeGen lowers and emits code for the given target and stack.
CodeGen(comp Compiland)
}
// Compiland contains all of settings passed from front-end to back-end compiler phases.
type Compiland struct {
Cluster *ast.Cluster // the target cluster.
Stack *ast.Stack // the root stack to compile.
}