code.c File Reference

#include <../../nrnconf.h>
#include <errno.h>
#include "hoc.h"
#include "hocstr.h"
#include <stdio.h>
#include "parse.h"
#include <math.h>
#include <stdlib.h>
#include <nrnmpi.h>
Include dependency graph for code.c:
This graph shows which files directly or indirectly include this file:

Classes

struct  Frame

Defines

#define BBSPOLL
#define STACKCHK
#define USEMACROS   1
#define pushxm(d)   ((stackp++)->val = (d));((stackp++)->i = NUMBER)
#define pushsm(d)   ((stackp++)->sym = (d));((stackp++)->i = SYMBOL)
#define xpopm()   (tstkchk((--stackp)->i, NUMBER), (--stackp)->val)
#define spopm()   (tstkchk((--stackp)->i, SYMBOL), (--stackp)->sym)
#define nopopm()   (stackp -= 2)
#define tstkchk(i, j)   (((i)!=(j))?tstkchk_actual(i,j):0)
#define EPS   hoc_epsilon
#define NSTACK   1000
#define nstack   hoc_nstack
#define NPROG   5000
#define NFRAME   200
#define nframe   hoc_nframe
#define DEBUG_GARBAGE   1
#define TOBJ_POOL_SIZE   50
#define MAXINITFCNS   10
#define relative(pc)   (pc + (pc)->i)

Typedefs

typedef struct Frame Frame

Functions

double chkarg ()
char * hoc_object_name ()
int tstkchk_actual (int i, int j)
Object ** hoc_temp_objptr (Object *obj)
 hoc_tobj_unref (Object **p)
 hoc_unref_defer ()
 hoc_pop_defer ()
 hoc_stkobj_unref (Object *o)
 hoc_init_space ()
 hoc_prstack ()
 hoc_on_init_register (Pfri pf)
 initcode ()
 oc_save_code (Inst **a1, Inst **a2, Datum **a3, Frame **a4, int *a5, int *a6, Inst **a7, Frame **a8, Datum **a9, Symlist **a10, Inst **a11, int *a12)
 oc_restore_code (Inst **a1, Inst **a2, Datum **a3, Frame **a4, int *a5, int *a6, Inst **a7, Frame **a8, Datum **a9, Symlist **a10, Inst **a11, int *a12)
int hoc_strgets_need ()
char * hoc_strgets (char *cbuf, int nc)
int hoc_ParseExec (int yystart)
int hoc_xopen_run (Symbol *sp, char *str)
char ** hoc_temp_charptr ()
int hoc_stack_type ()
 pushx (double d)
 hoc_pushobj (Object **d)
 hoc_push_object (Object *d)
 hoc_pushstr (char **d)
 hoc_push_string ()
 hoc_pushpx (double *d)
 pushs (Symbol *d)
 pushi (int d)
int hoc_stacktype ()
int hoc_argtype (int narg)
int hoc_is_double_arg (int narg)
int hoc_is_pdouble_arg (int narg)
int hoc_is_str_arg (int narg)
int hoc_is_object_arg (int narg)
int hoc_is_tempobj_arg (int narg)
Datumhoc_look_inside_stack (int i, int type)
Object * hoc_obj_look_inside_stack (int i)
int hoc_inside_stacktype (int i)
double xpop ()
double * hoc_pxpop ()
Symbolspop ()
Object ** hoc_objpop ()
Object * hoc_pop_object ()
char ** hoc_strpop ()
int ipop ()
 nopop ()
 constpush ()
 pushzero ()
 varpush ()
 forcode ()
 shortfor ()
 hoc_iterator ()
 hoc_iterator_object (Symbol *sym, int argcount, Inst *beginpc, Inst *endpc, Object *ob)
 hoc_iterator_stmt ()
 for_segment ()
 for_segment1 ()
 ifcode ()
 Break ()
 Continue ()
 Stop ()
 hoc_define (Symbol *sp)
 frame_debug ()
 push_frame (Symbol *sp, int narg)
 pop_frame ()
 call ()
 hoc_fake_call (Symbol *s)
double hoc_call_func (Symbol *s, int narg)
 ret ()
 funcret ()
 procret ()
 hocobjret ()
 hoc_Numarg ()
 hoc_Argtype ()
int ifarg (int narg)
Object ** hoc_objgetarg (int narg)
char ** hoc_pgargstr (int narg)
double * hoc_pgetarg (int narg)
double * getarg (int narg)
int hoc_argindex ()
 arg ()
 hoc_stringarg ()
double hoc_opasgn (int op, double dest, double src)
 argassign ()
 hoc_argrefasgn ()
 hoc_argref ()
 hoc_argrefarg ()
 bltin ()
Symbolhoc_get_symbol (char *var)
Symbolhoc_get_last_pointer_symbol ()
 hoc_autoobject ()
 eval ()
 hoc_evalpointer ()
 add ()
 sub ()
 mul ()
 hoc_div ()
 hoc_cyclic ()
 negate ()
 gt ()
 lt ()
 ge ()
 le ()
 eq ()
 ne ()
 hoc_and ()
 hoc_or ()
 hoc_not ()
 power ()
 assign ()
 hoc_assign_str (char **cpp, char *buf)
int assstr ()
char * hoc_araystr (Symbol *sym, int index, Objectdata *obd)
int hoc_array_index (Symbol *sp, Objectdata *od)
int araypt (Symbol *sp, int type)
 print ()
 prexpr ()
 prstr ()
 hoc_delete_symbol ()
 hoc_newline ()
 varread ()
InstCode (Pfri f)
Instcodei (int f)
 codesym (Symbol *f)
 codein (Inst *f)
 insertcode (Inst *begin, Inst *end, Pfri f)
 execute (Inst *p)

Variables

Objectdata * hoc_objectdata
Objectdata * hoc_top_level_data
Object * hoc_thisobject
Symlisthoc_symlist
Symlisthoc_top_level_symlist
double EPS
long nstack
Instprog
Instprogp
Instpc
Instprogbase
Instprog_parse_recover
int hoc_returning
long nframe
Symlistp_symlist
int zzdebug
int intset

Define Documentation

#define BBSPOLL

Referenced by call(), and execute().

#define DEBUG_GARBAGE   1
#define EPS   hoc_epsilon
#define MAXINITFCNS   10

Referenced by hoc_on_init_register().

#define nframe   hoc_nframe

Referenced by hoc_init_space().

#define NFRAME   200

Referenced by hoc_init_space().

 
#define nopopm (  )     (stackp -= 2)

Referenced by araypt(), pop_frame(), and ret().

#define NPROG   5000

Referenced by hoc_init_space().

#define nstack   hoc_nstack

Referenced by hoc_init_space().

#define NSTACK   1000

Referenced by hoc_init_space().

#define pushsm ( d   )     ((stackp++)->sym = (d));((stackp++)->i = SYMBOL)

Referenced by varpush().

#define pushxm ( d   )     ((stackp++)->val = (d));((stackp++)->i = NUMBER)
#define relative ( pc   )     (pc + (pc)->i)
 
#define spopm (  )     (tstkchk((--stackp)->i, SYMBOL), (--stackp)->sym)
#define STACKCHK
Value:
if (stackp >= stacklast) \
               execerror("Stack too deep.", "Increase with -NSTACK stacksize option");

Referenced by call(), hoc_iterator_object(), hoc_push_object(), hoc_pushobj(), hoc_pushpx(), hoc_pushstr(), pushi(), pushs(), and pushx().

#define TOBJ_POOL_SIZE   50
#define tstkchk ( i,
 )     (((i)!=(j))?tstkchk_actual(i,j):0)
#define USEMACROS   1
 
#define xpopm (  )     (tstkchk((--stackp)->i, NUMBER), (--stackp)->val)

Typedef Documentation

typedef struct Frame Frame

Function Documentation

add (  ) 

References pushxm, and xpopm.

int araypt ( Symbol sp,
int  type 
)
arg (  ) 

References getarg(), hoc_argindex(), and pushxm.

Here is the call graph for this function:

argassign (  ) 

References getarg(), hoc_argindex(), hoc_opasgn(), op, pushxm, and xpopm.

Here is the call graph for this function:

assign (  ) 
int assstr (  ) 

References hoc_assign_str(), and hoc_strpop().

Here is the call graph for this function:

bltin (  ) 

References pushxm, and xpopm.

Break (  ) 

References hoc_returning.

call (  ) 
double chkarg (  ) 
Inst* Code ( Pfri  f  ) 

References Inst::pf.

Inst* codei ( int  f  ) 

References Inst::i.

codein ( Inst f  ) 

References IGNORE, and Inst::in.

codesym ( Symbol f  ) 

References IGNORE, and Inst::sym.

constpush (  ) 

References pushxm.

Continue (  ) 

References hoc_returning.

eq (  ) 

References EPS, hoc_execerror(), hoc_objpop(), hoc_strpop(), hoc_tobj_unref(), OBJECTTMP, pushxm, STRING, tstkchk, and xpopm.

Here is the call graph for this function:

eval (  ) 
execute ( Inst p  ) 

References BBSPOLL, execerror, hoc_check_intupt(), hoc_returning, Inst::in, and STOP.

Here is the call graph for this function:

for_segment (  ) 

References spopm.

Referenced by debugzz().

for_segment1 (  ) 

References EPS, spopm, and xpopm.

forcode (  ) 

References execute, hoc_returning, nrn_isecstack(), nrn_secstack(), relative, and xpopm.

Here is the call graph for this function:

frame_debug (  ) 
funcret (  ) 
ge (  ) 

References EPS, pushxm, and xpopm.

double* getarg ( int  narg  ) 
gt (  ) 

References EPS, pushxm, and xpopm.

hoc_and (  ) 

References pushxm, and xpopm.

Referenced by debugzz().

char* hoc_araystr ( Symbol sym,
int  index,
Objectdata*  obd 
)
int hoc_argindex (  ) 

References hoc_execerror(), int, and xpopm.

Referenced by arg(), argassign(), hoc_argref(), hoc_argrefarg(), hoc_argrefasgn(), hoc_objectarg(), and hoc_stringarg().

Here is the call graph for this function:

hoc_argref (  ) 

References EPS, hoc_argindex(), hoc_pgetarg(), int, pd, pushxm, and xpopm.

Referenced by debugzz().

Here is the call graph for this function:

hoc_argrefarg (  ) 

References hoc_argindex(), hoc_pgetarg(), hoc_pushpx(), and pd.

Here is the call graph for this function:

hoc_argrefasgn (  ) 

References EPS, hoc_argindex(), hoc_opasgn(), hoc_pgetarg(), int, op, pd, pushxm, and xpopm.

Referenced by debugzz().

Here is the call graph for this function:

hoc_Argtype (  ) 

References Frame::argn, chkarg(), execerror, int, Frame::nargs, OBJECTTMP, pushxm, ret, STRING, and type.

Here is the call graph for this function:

int hoc_argtype ( int  narg  ) 
int hoc_array_index ( Symbol sp,
Objectdata*  od 
)
hoc_assign_str ( char**  cpp,
char *  buf 
)
hoc_autoobject (  ) 

References Frame::argn, hoc_pushobj(), Datum::obj, Symbol::u, and Symbol::u_auto.

Here is the call graph for this function:

double hoc_call_func ( Symbol s,
int  narg 
)

References hoc_call(), hoc_execute(), hoc_pc, hoc_xpop(), Inst::i, Inst::in, Inst::pf, STOP, Inst::sym, and xpop.

Referenced by hoc_call_objfunc().

Here is the call graph for this function:

hoc_cyclic (  ) 

References execerror, pushxm, and xpopm.

Referenced by debugzz().

hoc_define ( Symbol sp  ) 

References emalloc, free_list, Inst::in, and STOP.

Referenced by hoc_xopen_run().

hoc_delete_symbol (  ) 

References Symbol::defined_on_the_fly, fprintf(), hoc_free_symspace(), Symbol::name, symlist, and Symbol::type.

Referenced by debugzz().

Here is the call graph for this function:

hoc_div (  ) 

References execerror, int, pushxm, and xpopm.

Referenced by debugzz().

hoc_evalpointer (  ) 
hoc_fake_call ( Symbol s  ) 

References Frame::nargs, Frame::ob, Frame::retpc, and Frame::sp.

Referenced by hoc_spinit().

Symbol* hoc_get_last_pointer_symbol (  ) 

References hoc_evalpointer(), hoc_ob_pointer(), Inst::in, Inst::pf, rangevarevalpointer(), STOP, and Inst::sym.

Referenced by hoc_Symbol_limits(), and hoc_Symbol_units().

Here is the call graph for this function:

Symbol* hoc_get_symbol ( char*  var  ) 
hoc_init_space (  ) 

References emalloc, NFRAME, nframe, NPROG, NSTACK, nstack, and TOBJ_POOL_SIZE.

Referenced by init().

int hoc_inside_stacktype ( int  i  ) 

Referenced by hoc_newobj(), and hoc_object_asgn().

int hoc_is_double_arg ( int  narg  ) 
int hoc_is_object_arg ( int  narg  ) 
int hoc_is_pdouble_arg ( int  narg  ) 

References hoc_argtype().

Referenced by fit_praxis(), hoc_vsscanf(), ivoc_gr_size(), and pval_praxis().

Here is the call graph for this function:

int hoc_is_str_arg ( int  narg  ) 
int hoc_is_tempobj_arg ( int  narg  ) 

References hoc_argtype(), and OBJECTTMP.

Here is the call graph for this function:

hoc_iterator (  ) 

References hoc_iterator_object(), hoc_thisobject, and relative.

Referenced by debugzz().

Here is the call graph for this function:

hoc_iterator_object ( Symbol sym,
int  argcount,
Inst beginpc,
Inst endpc,
Object*  ob 
)
hoc_iterator_stmt (  ) 
Datum* hoc_look_inside_stack ( int  i,
int  type 
)
hoc_newline (  ) 

References plprint().

Referenced by debugzz().

Here is the call graph for this function:

hoc_not (  ) 

References pushxm, and xpopm.

Referenced by debugzz().

hoc_Numarg (  ) 

References Frame::nargs, pushxm, and ret.

Object* hoc_obj_look_inside_stack ( int  i  ) 
char* hoc_object_name (  ) 
Object** hoc_objgetarg ( int  narg  ) 
Object** hoc_objpop (  ) 
hoc_on_init_register ( Pfri  pf  ) 

References fprintf(), MAXINITFCNS, and nrn_exit().

Referenced by hoc_audit_from_hoc_main1().

Here is the call graph for this function:

double hoc_opasgn ( int  op,
double  dest,
double  src 
)

References hoc_execerror().

Referenced by argassign(), assign(), hoc_argrefasgn(), and hoc_object_asgn().

Here is the call graph for this function:

hoc_or (  ) 

References pushxm, and xpopm.

Referenced by debugzz().

int hoc_ParseExec ( int  yystart  ) 

References execute, hoc_edit(), hoc_execerror(), hoc_in_yyparse, hoc_pipeflag, and hoc_yyparse().

Referenced by hoc_oc().

Here is the call graph for this function:

char** hoc_pgargstr ( int  narg  ) 
double* hoc_pgetarg ( int  narg  ) 
hoc_pop_defer (  ) 

References execerror, hoc_nopop(), hoc_object_name(), hoc_unref_defer(), i, Datum::obj, and OBJECTTMP.

Referenced by hoc_object_component().

Here is the call graph for this function:

Object* hoc_pop_object (  ) 

References execerror, Datum::i, OBJECTTMP, and tstkchk.

hoc_prstack (  ) 

References Datum::i.

hoc_push_object ( Object *  d  ) 
int hoc_push_string (  ) 
hoc_pushobj ( Object **  d  ) 
hoc_pushpx ( double *  d  ) 
hoc_pushstr ( char **  d  ) 
double* hoc_pxpop (  ) 
int hoc_stack_type (  ) 

References Datum::i.

Referenced by nrnpy_hoc_pop().

int hoc_stacktype (  ) 
hoc_stkobj_unref ( Object*  o  ) 

References hoc_obj_unref().

Referenced by nopop().

Here is the call graph for this function:

char* hoc_strgets ( char *  cbuf,
int  nc 
)

Referenced by hoc_pipegets().

int hoc_strgets_need (  ) 

Referenced by hoc_pipegets_need().

hoc_stringarg (  ) 

References hoc_argindex(), hoc_pgargstr(), and hoc_pushstr().

Referenced by debugzz().

Here is the call graph for this function:

char** hoc_strpop (  ) 
char** hoc_temp_charptr (  ) 

Referenced by hoc_Symbol_units().

Object** hoc_temp_objptr ( Object*  obj  ) 
hoc_tobj_unref ( Object**  p  ) 

References hoc_obj_unref(), and TOBJ_POOL_SIZE.

Referenced by eq(), forall_sectionlist(), hoc_ifseclist(), hoc_object_asgn(), hoc_object_component(), hocobjret(), ne(), nrnpy_hoc_pop(), and prexpr().

Here is the call graph for this function:

hoc_unref_defer (  ) 

References hoc_obj_unref(), and hoc_object_name().

Referenced by hoc_pop_defer(), and initcode().

Here is the call graph for this function:

int hoc_xopen_run ( Symbol sp,
char *  str 
)

References execerror, execute, hoc_define(), hoc_pipeflag, hoc_yyparse(), int, and n.

Referenced by hoc_execstr(), hoc_getsym(), hoc_parse_expr(), hoc_parse_stmt(), and hoc_xopen1().

Here is the call graph for this function:

hocobjret (  ) 

References execerror, hoc_objpop(), hoc_push_object(), hoc_tobj_unref(), Symbol::name, ret, Frame::sp, and Symbol::type.

Referenced by debugzz().

Here is the call graph for this function:

int ifarg ( int  narg  ) 

References Frame::nargs.

ifcode (  ) 

References execute, hoc_returning, relative, and xpopm.

initcode (  ) 

References do_equation, fprintf(), free_list, hoc_errno_count, hoc_returning, hoc_unref_defer(), and nrn_initcode().

Here is the call graph for this function:

insertcode ( Inst begin,
Inst end,
Pfri  f 
)

References debugzz, and Inst::pf.

int ipop (  ) 

References execerror, Datum::i, tstkchk, and USERINT.

le (  ) 

References EPS, pushxm, and xpopm.

lt (  ) 

References EPS, pushxm, and xpopm.

mul (  ) 

References pushxm, and xpopm.

ne (  ) 

References EPS, hoc_execerror(), hoc_objpop(), hoc_strpop(), hoc_tobj_unref(), OBJECTTMP, pushxm, STRING, tstkchk, and xpopm.

Here is the call graph for this function:

negate (  ) 

References pushxm, and xpopm.

nopop (  ) 

References execerror, hoc_stkobj_unref(), Datum::i, and OBJECTTMP.

Here is the call graph for this function:

oc_restore_code ( Inst* *  a1,
Inst* *  a2,
Datum* *  a3,
Frame* *  a4,
int a5,
int a6,
Inst* *  a7,
Frame* *  a8,
Datum* *  a9,
Symlist* *  a10,
Inst* *  a11,
int a12 
)

References do_equation, and hoc_returning.

Referenced by OcJumpImpl::restore().

oc_save_code ( Inst* *  a1,
Inst* *  a2,
Datum* *  a3,
Frame* *  a4,
int a5,
int a6,
Inst* *  a7,
Frame* *  a8,
Datum* *  a9,
Symlist* *  a10,
Inst* *  a11,
int a12 
)

References do_equation, and hoc_returning.

Referenced by OcJumpImpl::begin().

pop_frame (  ) 
power (  ) 

References Pow, pushxm, and xpopm.

prexpr (  ) 
print (  ) 

References buf, Fprintf, NOT_PARALLEL_SUB, and prexpr.

procret (  ) 
prstr (  ) 

References HocStr::buf, hoc_strpop(), hocstr_create(), hocstr_resize(), plprint(), and Sprintf.

Here is the call graph for this function:

push_frame ( Symbol sp,
int  narg 
)
pushi ( int  d  ) 

References STACKCHK, and USERINT.

pushs ( Symbol d  ) 

References STACKCHK, and SYMBOL.

pushx ( double  d  ) 

References STACKCHK.

pushzero (  ) 

References pushxm.

ret (  ) 

References hoc_obj_unref(), hoc_returning, Frame::nargs, Proc::nauto, Proc::nobjauto, nopopm, Frame::retpc, Frame::sp, Symbol::u, and Symbol::u_proc.

Here is the call graph for this function:

shortfor (  ) 
Symbol* spop (  ) 

References execerror, Datum::i, SYMBOL, and tstkchk.

Stop (  ) 

References hoc_returning.

Referenced by debugzz().

sub (  ) 

References pushxm, and xpopm.

int tstkchk_actual ( int  i,
int  j 
)

References execerror, fprintf(), OBJECTTMP, s, STRING, SYMBOL, and USERINT.

Here is the call graph for this function:

varpush (  ) 

References pushsm.

varread (  ) 
double xpop (  ) 

References execerror, Datum::i, and tstkchk.


Variable Documentation

double EPS
Objectdata* hoc_objectdata
Object* hoc_thisobject
Objectdata * hoc_top_level_data
long nframe
long nstack
Inst* pc
Generated on Mon Jun 13 08:10:29 2011 for NEURON by  doxygen 1.6.3