p2  0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PNProto Struct Reference

a prototype is compiled source code, a closure block (lambda) non-volatile. More...

#include <potion.h>

+ Collaboration diagram for PNProto:

Public Member Functions

PN potion_proto_tree (Potion *P, PN cl, PN self)
 
PN potion_proto_call (Potion *P, PN cl, PN self, PN args)
 
PN potion_proto_string (Potion *P, PN cl, PN self)
 
PN potion_proto_clone (Potion *P, PN cl, PN self)
 
long potion_proto_dumpbc (Potion *P, PN proto, PN out, long pos)
 
#define PN_PROTO(x)   ((struct PNProto *)(x))
 

Data Fields

 PN_OBJECT_HEADER
 PNType vt; PNUniq uniq. More...
 
PN source
 program name or enclosing scope More...
 
PN sig
 argument signature More...
 
PN stack
 size of the stack More...
 
PN paths
 paths (instance variables) More...
 
PN locals
 local variables More...
 
PN upvals
 variables in upper scopes More...
 
PN values
 numbers, strings, etc. More...
 
PN protos
 nested closures More...
 
PN debugs
 tree parts More...
 
PN tree
 abstract syntax tree More...
 
PN_SIZE pathsize
 
PN_SIZE localsize
 
PN_SIZE upvalsize
 
PN asmb
 assembled instructions More...
 
PN_F jit
 jit function pointer More...
 
int arity
 cached sig arity (number of args) More...
 
PN name
 PNString. More...
 

Detailed Description

a prototype is compiled source code, a closure block (lambda) non-volatile.

Definition at line 454 of file potion.h.

Member Function Documentation

PN potion_proto_tree ( Potion P,
PN  cl,
PN  self 
)

tree method of PNProto

Returns
the original PNSource AST for the closure

Definition at line 48 of file compile.c.

PN potion_proto_call ( Potion P,
PN  cl,
PN  self,
PN  args 
)

call method of PNProto. i.e. apply - bind args to a closure.

Parameters
args

Definition at line 55 of file compile.c.

PN potion_proto_string ( Potion P,
PN  cl,
PN  self 
)

string method of PNProto. ascii dump of a function definition

Definition at line 98 of file compile.c.

PN potion_proto_clone ( Potion P,
PN  cl,
PN  self 
)

clone method of PNProto shares name, tree. copies the rest

Definition at line 1191 of file compile.c.

long potion_proto_dumpbc ( Potion P,
PN  proto,
PN  out,
long  pos 
)

compile to bytecode

Parameters
protoPNProto
outPNBytes output buffer
poslong where to add at out
Returns
char* ptr - start

Definition at line 1337 of file compile.c.

Field Documentation

PNProto::PN_OBJECT_HEADER

PNType vt; PNUniq uniq.

Definition at line 455 of file potion.h.

PN PNProto::source

program name or enclosing scope

Definition at line 456 of file potion.h.

PN PNProto::sig

argument signature

Definition at line 457 of file potion.h.

PN PNProto::stack

size of the stack

Definition at line 458 of file potion.h.

PN PNProto::paths

paths (instance variables)

Definition at line 459 of file potion.h.

PN PNProto::locals

local variables

Definition at line 460 of file potion.h.

PN PNProto::upvals

variables in upper scopes

Definition at line 461 of file potion.h.

PN PNProto::values

numbers, strings, etc.

Definition at line 462 of file potion.h.

PN PNProto::protos

nested closures

Definition at line 463 of file potion.h.

PN PNProto::debugs

tree parts

Definition at line 464 of file potion.h.

PN PNProto::tree

abstract syntax tree

Definition at line 465 of file potion.h.

PN_SIZE PNProto::pathsize

Definition at line 466 of file potion.h.

PN_SIZE PNProto::localsize

Definition at line 466 of file potion.h.

PN_SIZE PNProto::upvalsize

Definition at line 466 of file potion.h.

PN PNProto::asmb

assembled instructions

Definition at line 467 of file potion.h.

PN_F PNProto::jit

jit function pointer

Definition at line 468 of file potion.h.

int PNProto::arity

cached sig arity (number of args)

Definition at line 469 of file potion.h.

PN PNProto::name

PNString.

Definition at line 470 of file potion.h.


The documentation for this struct was generated from the following files: