compiler

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compiler

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

Compiler is used to transpile .ygl source files to wasm

func NewFromFile

func NewFromFile(filePath string) *Compiler

func NewFromString

func NewFromString(source string) *Compiler

func (*Compiler) Compile

func (compiler *Compiler) Compile() error

Compile runs the lexer, parser and code generator

func (*Compiler) ConvertWat2Wasm

func (compiler *Compiler) ConvertWat2Wasm(outputFilePath string)

ConvertWat2Wasm converts a .wat file into a .wasm file and writes a .wasm file at the specified path

func (*Compiler) WriteJsonFile

func (compiler *Compiler) WriteJsonFile(outputFilePath string)

func (*Compiler) WriteOutputToBuffer

func (compiler *Compiler) WriteOutputToBuffer(outputBuffer *bytes.Buffer) (int, error)

WriteOutputToBuffer copies the output webassembly text buffer to another buffer, returns the amount of bytes written

func (*Compiler) WriteWatFile

func (compiler *Compiler) WriteWatFile(outputFilePath string)

WriteWatFile writes the code generated webassembly into a .wat file at the specified path

type Scanner

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

func NewScanner

func NewScanner(tokens []*token.Token) *Scanner

func (*Scanner) Scan

func (s *Scanner) Scan() *token.Token

Jump to

Keyboard shortcuts

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