potion  0.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PNSource Struct Reference

#include <potion.h>

+ Collaboration diagram for PNSource:

Public Member Functions

static PN potion_source_size (Potion *P, PN cl, PN self)
 
static PN potion_source_name (Potion *P, PN cl, PN self)
 
static PN potion_source_file (Potion *P, PN cl, PN self)
 
static PN potion_source_lineno (Potion *P, PN cl, PN self)
 
static PN potion_source_line (Potion *P, PN cl, PN self)
 
static PN potion_source_string (Potion *P, PN cl, PN self)
 
static PN potion_source_loc (Potion *P, PN cl, PN self)
 
PN potion_source_compile (Potion *P, PN cl, PN self, PN source, PN sig)
 
PN potion_source_load (Potion *P, PN cl, PN buf)
 
PN potion_source_dumpbc (Potion *P, PN cl, PN proto, PN options)
 
PN potion_source_dump (Potion *P, PN cl, PN self, PN backend, PN options)
 

Data Fields

 PN_OBJECT_HEADER
 PNType vt; PNUniq uniq. More...
 
enum PN_AST part
 AST type, avoid -Wswitch (aligned access: 4+4+8+4+24) More...
 
struct PNSource *volatile a [3]
 PNTuple of 1-3 kids,. More...
 
struct {
   PNType   fileno:32
 
   PNType   lineno:32
 
loc
 bitfield of fileno and lineno More...
 
PN line
 PNString of src line. More...
 

Detailed Description

Definition at line 424 of file potion.h.

Member Function Documentation

static PN potion_source_size ( Potion P,
PN  cl,
PN  self 
)

"size" method

Returns
number of ast trees: 1,2 or 3

Definition at line 64 of file ast.c.

static PN potion_source_name ( Potion P,
PN  cl,
PN  self 
)

"name" method

Definition at line 71 of file ast.c.

static PN potion_source_file ( Potion P,
PN  cl,
PN  self 
)

"file" method

Returns
filename of associated AST

Definition at line 79 of file ast.c.

static PN potion_source_lineno ( Potion P,
PN  cl,
PN  self 
)

"lineno" method

Returns
line number of associated AST

Definition at line 87 of file ast.c.

static PN potion_source_line ( Potion P,
PN  cl,
PN  self 
)

"line" method

Returns
line string of associated AST

Definition at line 95 of file ast.c.

static PN potion_source_string ( Potion P,
PN  cl,
PN  self 
)

"string" method of the AST Note: Does not output the AST type, filename nor lineno

Definition at line 103 of file ast.c.

static PN potion_source_loc ( Potion P,
PN  cl,
PN  self 
)
Returns
file.c:lineno

Definition at line 149 of file ast.c.

PN potion_source_compile ( Potion P,
PN  cl,
PN  self,
PN  source,
PN  sig 
)

"compile" method for PNSource, an AST fragment. Typically to add a function definition, but also objects, blocks, ... (Almost everything is a PNClosure)

Parameters
sourcePNProto or PN_NIL of the current closure definition stored in f->source of each block
sigPNSource signature tree or PN_NIL or PNTuple in P2, parsed via yy_sig()
Returns
PNProto a closure

Definition at line 1039 of file compile.c.

PN potion_source_load ( Potion P,
PN  cl,
PN  buf 
)

Definition at line 1171 of file compile.c.

PN potion_source_dumpbc ( Potion P,
PN  cl,
PN  proto,
PN  options 
)

dump to bytecode

Definition at line 1244 of file compile.c.

PN potion_source_dump ( Potion P,
PN  cl,
PN  self,
PN  backend,
PN  options 
)

dump (compiler) methods, default "bc". loads compile-"backend" extension.

Parameters
backendPNString - load a compile-"backend" module and call its dump"backend" method
optionsoptional PNString TODO: serializable ascii, c, exe, jvm, .net

Definition at line 1265 of file compile.c.

Field Documentation

PNSource::PN_OBJECT_HEADER

PNType vt; PNUniq uniq.

Definition at line 425 of file potion.h.

enum PN_AST PNSource::part

AST type, avoid -Wswitch (aligned access: 4+4+8+4+24)

Definition at line 426 of file potion.h.

struct PNSource* volatile PNSource::a[3]

PNTuple of 1-3 kids,.

See also
ast.c

Definition at line 427 of file potion.h.

PNType PNSource::fileno

Definition at line 434 of file potion.h.

PNType PNSource::lineno

Definition at line 435 of file potion.h.

struct { ... } PNSource::loc

bitfield of fileno and lineno

PN PNSource::line

PNString of src line.

Definition at line 438 of file potion.h.


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