acc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: BSD-3-Clause Imports: 12 Imported by: 2

Documentation

Overview

Package acc implements the "addition chain calculator" language: a domain-specific language (DSL) for addition chain computation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(p *ir.Program) (*ast.Chain, error)

Build AST from a program in intermediate representation.

func Decompile

func Decompile(p addchain.Program) (*ir.Program, error)

Decompile an unrolled program into concise intermediate representation.

func LoadFile

func LoadFile(filename string) (p *ir.Program, err error)

LoadFile is a convenience for loading an addition chain script from a file.

func LoadReader

func LoadReader(filename string, r io.Reader) (*ir.Program, error)

LoadReader is a convenience for loading and evaluating an addition chain script.

func LoadString

func LoadString(src string) (*ir.Program, error)

LoadString is a convenience for loading and evaluating an addition chain script from a string.

func Save

func Save(filename string, p *ir.Program) (err error)

Save is a convenience for writing a program to a file.

func String

func String(p *ir.Program) (string, error)

String is a convenience for obtaining a program as an addition chain script in string form.

func Translate

func Translate(c *ast.Chain) (*ir.Program, error)

Translate converts an abstract syntax tree to an intermediate representation.

func Write

func Write(w io.Writer, p *ir.Program) error

Write is a convenience for writing a program as an addition chain script.

Types

This section is empty.

Directories

Path Synopsis
Package ast declares abstract syntax tree types for acc programs.
Package ast declares abstract syntax tree types for acc programs.
Package ir declares an intermediate representation for acc programs.
Package ir declares an intermediate representation for acc programs.
Package parse implements a parser for acc programs.
Package parse implements a parser for acc programs.
Package pass implements analysis and processing passes on acc programs.
Package pass implements analysis and processing passes on acc programs.
Package printer implements printing of acc AST nodes.
Package printer implements printing of acc AST nodes.

Jump to

Keyboard shortcuts

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