package
0.0.0-20250112020414-b7d121007f5a
Repository: https://github.com/tim-hardcastle/pipefish.git
Documentation: pkg.go.dev

# README

README for the initializer

The initializer package supplies an Initializer struct which contains the data and supplies the methods necessary to initialize a Pipefish script, by creating and directing a parser and a compiler to operate on a VM. The Initializer returns a Compiler capable of dealing with runtime compilation of requests from the REPL: the Initializer can then be discarded together with its data.

There is one Initializer per module, as with compilers and parsers: an Initializer can spawn further Intitializers recursively to initialize modules and external services.

The initializer package consists of:

  • deserializer.go, which is used to deserialize the APIs of external services.
  • initializer.go, the main file directing initialization.
  • getters.go, which supplies some miscellaneous utility functions for getting and transforming data.
  • gohandler.go which does housekeeping for the Go interop.
  • gogen.go which generates Golang source files.

Fields of note in the Initializer struct are its compiler (naturally); its parser (a shortcut to the parser of the compiler); Common, a bindle of data that all the initializers of all the modules need to share; and GoBucket, which is used to accumulate the miscellaneous data swept up during parsing that we need to generate Go source files.

# Functions

Initializes the `CommonInitializerBindle`.
Makes a new initializer.
TODO --- malformed data would crash the deserializer with e.g.
We begin by manufacturing a blank VM, a `CommonParserBindle` for all the parsers to share, and a `CommonInitializerBindle` for the initializers to share.
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
The maximum value of a `uint32`.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

But list, set, pair, and map can't go in here because of the recursion.
No description provided by the author
No description provided by the author
Tokens to return when no token is available.

# Structs

The CommonInitializerBindle contains information that all the initializers need to share.
For indexing the functions in the common function map, to prevent duplication.
This struct type is used to accumulate the various data encountered during parsing that we need to build a `.go` file or files.

# Type aliases

Types and functions to assist the `MakeParserndTokenizedProgram` method.
Stores pretokenized chunks of code for later parsing.