python-on-a-chip online compiler

Dependencies:   mbed TSI

Embed: (wiki syntax)

« Back to documentation index

frame.h File Reference

frame.h File Reference

VM Frame. More...

Go to the source code of this file.

Data Structures

struct  PmBlock_s
 Block. More...
struct  PmFrame_s
 Frame. More...
struct  PmNativeFrame_s
 Native Frame. More...

Typedefs

typedef enum PmBlockType_e PmBlockType_t
 Block Type.
typedef struct PmBlock_s PmBlock_t
 Block.
typedef struct PmFrame_s PmFrame_t
 Frame.
typedef struct PmNativeFrame_s PmNativeFrame_t
 Native Frame.

Enumerations

enum  PmBlockType_e { B_INVALID = 0, B_LOOP, B_TRY }
 

Block Type.

More...

Functions

PmReturn_t frame_new (pPmObj_t pfunc, pPmObj_t *r_pobj)
 Allocate space for a new frame, fill its fields with respect to the given function object.

Detailed Description

VM Frame.

VM frame header.

Definition in file frame.h.


Typedef Documentation

typedef struct PmBlock_s PmBlock_t

Block.

Extra info for loops and trys (others?) Frames use linked list of blocks to handle nested loops and try-catch blocks.

Block Type.

Numerical values to put in the 'b_type' field of the tPmBlockType struct.

typedef struct PmFrame_s PmFrame_t

Frame.

A struct that holds the execution frame of a function, including the stack, local vars and pointer to the code object.

This struct doesn't declare the stack. frame_new() is responsible for allocating the extra memory at the tail of fo_locals[] to hold both the locals and stack.

Native Frame.

A struct that holds the execution frame of a native function, including the args and single stack slot, and pointer to the code object.

This struct doesn't need an OD because it is only used statically in the globals struct. There's only one native frame, the global one. This happens because a native function is a leaf node in the call tree (a native func can't call python funcs).


Enumeration Type Documentation

Block Type.

Numerical values to put in the 'b_type' field of the tPmBlockType struct.

Enumerator:
B_INVALID 

Invalid block type.

B_LOOP 

Loop type.

B_TRY 

Try type.

Definition at line 33 of file frame.h.


Function Documentation

PmReturn_t frame_new ( pPmObj_t  pfunc,
pPmObj_t r_pobj 
)

Allocate space for a new frame, fill its fields with respect to the given function object.

Return pointer to the new frame.

Parameters:
pfuncptr to Function object.
r_pobjReturn value; the new frame.
Returns:
Return status.

Definition at line 25 of file frame.c.