Documentation ¶
Overview ¶
package printer prints out sysl datamodels back to source code using the Printer struct. Source code does not have complete fidelity, and elements will be printed out in alphabetical order.
Index ¶
- Constants
- func GetPatterns(attrs map[string]*sysl.Attribute) []string
- type Printer
- func (p *Printer) ParamType(param *sysl.Param) string
- func (p *Printer) PrintAction(a *sysl.Action)
- func (p *Printer) PrintApplication(a *sysl.Application)
- func (p *Printer) PrintAttrs(key string, a *sysl.Attribute, indentNum int)
- func (p *Printer) PrintCall(c *sysl.Call)
- func (p *Printer) PrintEndpoint(e *sysl.Endpoint)
- func (p *Printer) PrintModule(mod *sysl.Module)
- func (p *Printer) PrintParam(params []*sysl.Param)
- func (p *Printer) PrintPatterns(attrs map[string]*sysl.Attribute)
- func (p *Printer) PrintReturn(r *sysl.Return)
- func (p *Printer) PrintStatement(s *sysl.Statement)
- func (p *Printer) PrintTypeDecl(key string, t *sysl.Type)
Constants ¶
const ( APPLICATIONINDENT = 4 ENDPOINTINDENT = 8 MAXLINE = 80 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Printer ¶
Printer prints sysl data structures out to source code
func NewPrinter ¶
NewPrinter returns a printer that can be used to print out sysl source code from data structures
func (*Printer) PrintAction ¶
PrintAction prints actions: lookup data
func (*Printer) PrintApplication ¶
func (p *Printer) PrintApplication(a *sysl.Application)
PrintApplication prints applications: App:
func (*Printer) PrintAttrs ¶
PrintAttrs prints Attributes: @owner="server"
func (*Printer) PrintEndpoint ¶
PrintEndpoint prints endpoints: Endpoint:
func (*Printer) PrintModule ¶
PrintModule Prints a whole module
func (*Printer) PrintParam ¶
PrintParam prints Parameters: Endpoint(This <: ParamHere):
func (*Printer) PrintPatterns ¶
Prints patterns in square brackets: [~foo, ~bar]
func (*Printer) PrintReturn ¶
PrintReturn prints return statements: return foo <: type
func (*Printer) PrintStatement ¶
PrintAttrs prints different statements: return string My <- call lookup db