Documentation ¶
Index ¶
- Constants
- func IsWriteableFlag(flag uint32) bool
- type FlagDebugger
- type IndexError
- type State
- func (st *State) AppendCode(b []byte) error
- func (st *State) Depth() uint8
- func (st *State) Down(input string) error
- func (st *State) FlagBitSize() uint32
- func (st *State) FlagByteSize() uint8
- func (st *State) GetCode() ([]byte, error)
- func (st *State) GetFlag(bitIndex uint32) (bool, error)
- func (st *State) GetIndex(flags []byte) bool
- func (st *State) GetInput() ([]byte, error)
- func (st *State) MatchFlag(sig uint32, invertMatch bool) (bool, error)
- func (st *State) Next() (uint16, error)
- func (st *State) Previous() (uint16, error)
- func (st *State) ResetFlag(bitIndex uint32) (bool, error)
- func (st *State) Restart() error
- func (st *State) Same()
- func (st *State) SetCode(b []byte)
- func (st *State) SetFlag(bitIndex uint32) (bool, error)
- func (st *State) SetInput(input []byte) error
- func (st *State) Sides() (bool, bool)
- func (st State) String() string
- func (st *State) Top() (bool, error)
- func (st *State) Up() (string, error)
- func (st *State) Where() (string, uint16)
Constants ¶
const ( FLAG_READIN = iota FLAG_INMATCH FLAG_TERMINATE FLAG_DIRTY FLAG_WAIT FLAG_LOADFAIL FLAG_USERSTART = 8 )
Variables ¶
This section is empty.
Functions ¶
func IsWriteableFlag ¶
Types ¶
type FlagDebugger ¶
type FlagDebugger struct { }
type IndexError ¶
type IndexError struct { }
func (*IndexError) Error ¶
func (err *IndexError) Error() string
type State ¶
type State struct { Code []byte // Pending bytecode to execute ExecPath []string // Command symbols stack BitSize uint32 // size of (32-bit capacity) bit flag byte array SizeIdx uint16 Flags []byte // Error state Moves uint32 // Number of times navigation has been performed // contains filtered or unexported fields }
State holds the command stack, error condition of a unique execution session.
It also holds cached values for all results of executed symbols.
Cached values are linked to the command stack level it which they were loaded. When they go out of scope they are freed.
Values must be mapped to a level in order to be available for retrieval and count towards size ¶
It can hold a single argument, which is freed once it is read ¶
Symbols are loaded with individual size limitations. The limitations apply if a load symbol is updated. Symbols may be added with a 0-value for limits, called a "sink." If mapped, the sink will consume all net remaining size allowance unused by other symbols. Only one sink may be mapped per level.
Symbol keys do not count towards cache size limitations.
8 first flags are reserved.
func NewState ¶
NewState creates a new State object with BitSize number of error condition states in ADDITION to the 8 builtin flags.
func (*State) AppendCode ¶
Appendcode adds the given bytecode to the end of the existing code.
func (*State) FlagBitSize ¶
FlagBitSize reports the amount of bits available in the bit field index.
func (*State) FlagByteSize ¶
FlagBitSize reports the amount of bits available in the bit field index.
func (*State) GetFlag ¶
GetFlag returns the state of the flag at the given bit field index.
Fails if bit field index is out of range.
func (*State) GetIndex ¶
GetIndex scans a byte slice in same order as in storage, and returns the index of the first set bit.
If the given byte slice is too small for the bit field bitsize, the check will terminate at end-of-data without error.
func (*State) MatchFlag ¶
MatchFlag matches the current state of the given flag.
The flag is specified given its bit index in the bit field.
If invertMatch is set, a positive result will be returned if the flag is not set.
func (*State) Previous ¶
Previous moves to the next sink page index.
Fails if try to move beyond index 0.
func (*State) ResetFlag ¶
ResetFlag resets the flag at the given bit field index.
Returns true if bit state was changed.
Fails if bitindex is out of range.
func (*State) Restart ¶
Reset re-initializes the state to run from top node with accumulated client state.
func (*State) SetFlag ¶
SetFlag sets the flag at the given bit field index
Returns true if bit state was changed.
Fails if bitindex is out of range.
func (*State) Sides ¶
Sides informs the caller which index page options will currently succeed.
Two values are returned, for the "next" and "previous" options in that order. A false value means the option is not available in the current state.
func (*State) Top ¶
Top returns true if currently at topmode node.
Fails if first Down() was never called.