cxlexer

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: BSD-1-Clause Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitProg

func InitProg() (*cxcore.CXProgram, error)

InitProg initiates program contained in 'actions.PRGRM'.

func ParseSourceCode

func ParseSourceCode(sourceCode []*os.File, fileNames []string) int

ParseSourceCode takes a group of files representing CX `sourceCode` and parses it into CX program structures for `PRGRM`.

func SetLogger

func SetLogger(log logrus.FieldLogger)

func Step0

func Step0(srcStrs, srcNames []string) int

Step0 performs a first pass for the CX parser. Globals, packages and custom types are added to `cxgo0.PRGRM0`.

Types

type ProgBytes

type ProgBytes struct {
	State []byte
	Heap  []byte
}

ProgBytes represents program bytes.

func LoadProgFromBytes

func LoadProgFromBytes(prog *cxcore.CXProgram, progS []byte) (*ProgBytes, error)

LoadProgFromBytes initializes the program structure `prog` with data from the program state stored on a CX chain. This is used for transaction/broadcast mode.

func (*ProgBytes) MergeChainHeap

func (pb *ProgBytes) MergeChainHeap() error

MergeChainHeap adds the heap `bcHeap` found in the program state of a CX chain to the program to be run `PRGRM` and updates all the references to heap objects found in the transaction code considering the data segment found in the serialized program `sPrgrm`.

Jump to

Keyboard shortcuts

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