printer

package
v0.0.0-...-7ee513c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package printer provides a human-readable printer for the semantic tree nodes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Printer

type Printer struct {
	// contains filtered or unexported fields
}

Printer exposes methods for appending string representations of semantic Statements, Expressions and Types. While the strings generated closely match the syntax of the API file, the Printer has been written to aid in debugging, and may not produce parseable output.

func New

func New() *Printer

New returns a new Printer.

func (Printer) String

func (p Printer) String() string

func (*Printer) WriteExpression

func (p *Printer) WriteExpression(n semantic.Expression) *Printer

WriteExpression appends the string representation of n to the Printer's buffer.

func (*Printer) WriteFunction

func (p *Printer) WriteFunction(f *semantic.Function) *Printer

WriteFunction appends the string representation of f to the Printer's buffer.

func (*Printer) WriteRune

func (p *Printer) WriteRune(r rune)

WriteRune appends r cto the Printer's buffer.

func (*Printer) WriteStatement

func (p *Printer) WriteStatement(n semantic.Node) *Printer

WriteStatement appends the string representation of n to the Printer's buffer.

func (*Printer) WriteString

func (p *Printer) WriteString(s string)

WriteString appends s to the Printer's buffer.

func (*Printer) WriteType

func (p *Printer) WriteType(n semantic.Type) *Printer

WriteType appends the string representation of n to the Printer's buffer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL