NEURON
version.cpp
Go to the documentation of this file.
1 #include <../../nrnconf.h>
2 /* $Header$ */
3 /*
4 $Log$
5 Revision 1.1 2003/02/11 18:36:09 hines
6 Initial revision
7 
8 Revision 1.1.1.1 2003/01/01 17:46:35 hines
9 NEURON -- Version 5.4 2002/12/23 from prospero as of 1-1-2003
10 
11 Revision 1.1.1.1 2002/06/26 16:23:07 hines
12 NEURON 5.3 2002/06/04
13 
14  * Revision 1.1.1.1 2001/01/01 20:30:35 hines
15  * preparation for general sparse matrix
16  *
17  * Revision 1.3 2000/03/27 14:18:12 hines
18  * All sources now include nrnconf.h instead of config.h so that minor
19  * option changes (eg in src/parallel/bbsconf.h) do not require recompilation
20  * of everything.
21  *
22  * Revision 1.2 2000/03/15 19:02:16 hines
23  * trying to merge nrn4.3.0 stuff that used imake into the nrn4.2.3 distribution.
24  * Now called nrn4.3.1
25  *
26  * Revision 1.1.1.1 2000/03/09 13:55:34 hines
27  * almost working
28  *
29  * Revision 1.2 1995/05/19 12:51:40 hines
30  * change the oc version number and date
31  *
32  * Revision 1.1.1.1 1994/10/12 17:22:14 hines
33  * NEURON 3.0 distribution
34  *
35  * Revision 2.116 1994/09/27 17:03:05 hines
36  * when oc_jump_target failed then the next error could try to longjump to
37  * a function that had already returned. fixed.
38  *
39  * Revision 2.115 1994/09/26 18:25:40 hines
40  * fix warning on sgi
41  *
42  * Revision 2.114 1994/09/20 16:20:06 hines
43  * port to dec alpha
44  *
45  * Revision 2.113 1994/09/20 14:50:42 hines
46  * port to dec alpha (cxx thinks struct name inside struct is new def)
47  *
48  * Revision 2.112 1994/09/20 14:49:25 hines
49  * execute1("cmd") will return even on execerror. Note: does
50  * not surround with {}
51  *
52  * Revision 2.111 1994/09/12 13:37:14 hines
53  * execute("~command") will eliminate tilde and execute command without
54  * enclosing it in {}. This allows one to create func, proc dynamically.
55  *
56  * Revision 2.110 1994/08/18 12:19:15 hines
57  * allow ob.sec.range[i](x)
58  * this necessitated allowing parsing of ob[i](x) and then giving
59  * an error dynamically.
60  *
61  * Revision 2.109 1994/08/17 19:48:49 hines
62  * ocmain.o : get it from lib (nocable and ocnoiv too)
63  *
64  * Revision 2.108 1994/08/05 14:16:14 hines
65  * show_errmess_always()
66  * errno not defined from include file in hoc.cpp
67  * NullArgument replaces null arguments in Imakefile
68  *
69  * Revision 2.107 1994/07/30 17:33:51 hines
70  * checking whether bison or yacc is used
71  *
72  * Revision 2.106 1994/07/30 14:52:40 hines
73  * pwman_place(left, top)
74  *
75  * Revision 2.105 1994/07/12 17:52:26 hines
76  * more portable way of dealing with ocjump
77  *
78  * Revision 2.104 1994/07/12 13:47:54 hines
79  * from last change there are 80 shift reduce conflicts
80  *
81  * Revision 2.103 1994/07/12 13:45:48 hines
82  * can use constant objects of form
83  * template[index].
84  * now object names are printed in this format as well.
85  *
86  * Revision 2.102 1994/07/04 15:10:54 hines
87  * only print Oc banner if not NEURON
88  *
89  * Revision 2.101 1994/06/29 12:37:28 hines
90  * can switch between bison and yacc. so far I have never used the partial
91  * parseing feature of bison anyway. This works around a problem on some
92  * crays in which there is a bug in bison.
93  *
94  * Revision 2.100 1994/06/21 12:36:04 hines
95  * allow recursive calls to interpreter even in case of hoc_execerror.
96  *
97  * Revision 2.99 1994/06/17 13:00:35 hines
98  * a number of things fixed while looking at the test coverage of hoc.cpp
99  * mostly just to allow coverage.
100  * CBUFSIZE is larger than 256
101  * array index computed with double arithmetic.
102  * corrected handling of end of file while in comments
103  *
104  * Revision 2.98 1994/06/17 12:53:28 hines
105  * when a hoc_exec_cmd fails another execerror is called since
106  * otherwise the pc is invalid. at this time it is not possible to
107  * recover while still interpreting since the interpreter is
108  * initialized. This is not a problem with buttons, etc since when
109  * they are running the interpreter at the top level and they don't get
110  * control until the interpreter is done.
111  *
112  * Revision 2.97 1994/06/07 20:54:40 hines
113  * anyname (eg local) can also be a mechanism name
114  *
115  * Revision 2.96 1994/06/07 20:46:12 hines
116  * all_objectvars not setting objectdata when accessing arrayinfo
117  * fixed
118  *
119  * Revision 2.95 1994/06/07 18:42:38 hines
120  * allow redeclaration of names in templates that are built-in names
121  *
122  * Revision 2.94 1994/06/07 15:01:12 hines
123  * no trailing blank after an object name
124  *
125  * Revision 2.93 1994/05/24 17:36:11 hines
126  * allobjects() prints all object names with number of references
127  *
128  * Revision 2.92 1994/05/24 15:41:38 hines
129  * allobjectrefs recurses on this. Fixed
130  *
131  * Revision 2.91 1994/05/20 19:13:58 hines
132  * object_push(objref) and object_pop()
133  * allow more easy saving of internal state of objects.
134  * after an object_puhs(objref) subsequent commands are executed in
135  * the context of the object til the next object_pop()
136  * Warning: do not create new variables within one of these object contexts.
137  *
138  * Revision 2.90 1994/05/10 20:19:14 hines
139  * global lineno no longer initialized when defined.
140  * Note: there is a potential problem when calling oc_run() from
141  * a descendent of an object since when there is an error, the highest
142  * caller gets the execerror and not the lowest. it would be better ot
143  * nicely unwrap all the calls instead of doing a longjmp
144  *
145  * Revision 2.89 1994/05/09 19:11:46 hines
146  * call_constructor checks if object is a point process and if so
147  * sets the Point_process->ob field so one can know the object given
148  * the point process structure. This was done incorrectly a little while
149  * ago.
150  *
151  * Revision 2.88 1994/05/09 13:54:21 hines
152  * observers hook for templates.
153  *
154  * Revision 2.87 1994/05/05 18:19:32 hines
155  * error when hoc starts out interpreting a template. fixed
156  *
157  * Revision 2.86 1994/05/03 15:15:30 hines
158  * checkpoint returns int not void
159  *
160  * Revision 2.85 1994/05/03 15:11:02 hines
161  * built-in classes can be checkpointed
162  *
163  * Revision 2.84 1994/05/02 12:53:54 hines
164  * quit() function
165  *
166  * Revision 2.83 1994/04/27 12:43:47 hines
167  * objref is keyword synonym for objectvar
168  *
169  * Revision 2.82 1994/04/27 12:17:56 hines
170  * minor warnings from objectcenter fixed (and one serious problem from
171  * last checkin)
172  * PI, E, etc are now userdoubles and are available within objects.
173  *
174  * Revision 2.81 1994/04/27 11:21:31 hines
175  * support for ivoc/SRC/checkpoint.cpp
176  * usage is checkpoint("filename")
177  * then ivoc filename ...
178  * so far only for oc
179  *
180  * Revision 2.80 1994/04/06 17:14:24 hines
181  * minor changes to structures to allow checkpointing in ivoc
182  * basically no more codepfd
183  *
184  * Revision 2.79 1994/04/05 16:35:20 hines
185  * hook for checkpoint
186  * hoc_new_object_asgn(Object**, Symbol*, void*)
187  * double hoc_call_objfunc(Symbol*, int narg, Object*)
188  *
189  * Revision 2.78 1994/03/15 17:09:14 hines
190  * minor leak plugged for "this" in templates
191  *
192  * Revision 2.77 1994/03/10 15:26:07 hines
193  * capture SIGPIPE print message and ignore
194  *
195  * Revision 2.76 1994/03/10 14:33:13 hines
196  * error on last checkin
197  *
198  * Revision 2.75 1994/03/10 14:28:33 hines
199  * invoke coredump_on_error() if want it on next segmentation violation or
200  * bus error.
201  *
202  * Revision 2.74 1994/03/07 21:51:53 hines
203  * make ob = new Obj(ob) act appropriately and don't make assignment til
204  * after init was called.
205  *
206  * Revision 2.73 1994/03/04 21:37:01 hines
207  * help for files invoked on command line
208  *
209  * Revision 2.72 1994/03/04 18:07:22 hines
210  * *** empty log message ***
211  *
212  * Revision 2.71 1994/02/23 15:51:16 hines
213  * RETREAT_SIGNAL (SIGHUP) handled and user written routine "linda_retreat()"
214  * called on a doEvent(). Just exit if no such routine.
215  *
216  * Revision 2.70 1994/02/23 12:53:31 hines
217  * help word word ... in ivoc tickles the help system
218  *
219  * Revision 2.69 1994/02/10 19:41:06 hines
220  * set term=vt125 replaces vt100 in plot.cpp since that is a common term
221  * even in a window system
222  *
223  * Revision 2.68 1994/01/21 18:14:31 hines
224  * some NeXT portability fixes and turn off parse error messages when
225  * hoc_execerror_message == 0
226  *
227  * Revision 2.67 1994/01/11 20:22:24 hines
228  * set errno to 0 every input line so don't get spurious interrupted
229  * system call messages from ivoc select system call
230  *
231  * Revision 2.66 1993/12/15 15:02:01 hines
232  * SECTIONREF and allow ob connect ob()(0or1), expr
233  *
234  * Revision 2.65 1993/11/09 14:30:04 hines
235  * partial port to djg dos extender go32
236  *
237  * Revision 2.64 1993/11/04 15:58:42 hines
238  * forgot to checkin last time
239  *
240  * Revision 2.63 1993/11/04 15:55:48 hines
241  * port to solaris2 (no more warnings)
242  *
243  * Revision 2.62 1993/10/18 13:27:38 hines
244  * beginnings of an audit system
245  *
246  * Revision 2.61 1993/09/06 13:33:54 hines
247  * hoc_scan reads one extra character after scanning the number and
248  * discards it if it is a newline. Otherwise it ungetc's it.
249  *
250  * Revision 2.60 93/09/01 08:23:33 hines
251  * some string assignment statements not popping stack so loops can eventually
252  * give stack overflow
253  *
254  * Revision 2.59 93/08/19 16:38:20 hines
255  * if (!0) print "hello"
256  * now works. before the ! was not transmitted from yylex as NOT
257  * and print "hello" was given the wrong $$ code index
258  *
259  * Revision 2.58 93/08/15 12:54:53 hines
260  * fix warning of function declared external and later static
261  *
262  * Revision 2.56 93/08/14 15:05:37 hines
263  * when in multiline statement typed directly to interpreter from console
264  * we shut off the event driven interface so that there can be no
265  * extraneous statements mixed with the current statement.
266  *
267  * Revision 2.55 93/08/13 17:11:26 hines
268  * fix bug where we did not allow multiple line statements entered
269  * from console as direct command
270  *
271  * Revision 2.54 93/08/11 11:04:49 hines
272  * Zach Mainen's contribution of xstatebutton and xcheckbox
273  *
274  * Revision 2.53 93/07/23 11:33:26 hines
275  * in hoc_total_array_data didn't work for RANGEVAR
276  *
277  * Revision 2.52 93/07/19 09:36:15 hines
278  * freeing double arrays has different notify call
279  *
280  * Revision 2.51 93/07/08 14:23:58 hines
281  * portable to SGI
282  *
283  * Revision 2.49 93/06/30 11:28:45 hines
284  * expand_env_var needed a static buf for return.
285  *
286  * Revision 2.48 93/05/25 14:02:39 hines
287  * some functions that check on the arg type. eg hoc_is_object_arg(narg)
288  *
289  * Revision 2.47 93/05/04 15:26:43 hines
290  * another place where obdsave needs to remember that hoc_top_level_data
291  * may change
292  *
293  * Revision 2.46 93/04/29 15:30:13 hines
294  * notify_pointer_freed called whenever an object is freed.
295  *
296  * Revision 2.45 93/04/28 10:07:18 hines
297  * when a new variable is created at the top level then hoc_top_level_data
298  * is reallocated. (this can happen when xopen is called) however the
299  * function call handlers save and restore a pointe to hoc_objectdata and
300  * between save and restore the pointer may become invalid. This is
301  * avoided with the idiom
302  * Objectdata* obdsav = hoc_objectdata_save()
303  * ...
304  * hoc_objectdata = hoc_objectdata_restore(obdsav);
305  *
306  * Revision 2.44 93/04/21 10:34:49 hines
307  * datum element can be _pvoid for generic pointer storage
308  *
309  * Revision 2.43 93/04/20 08:40:24 hines
310  * lists can have void* elements (use insertvoid lappendvoid VOIDITM(q) )
311  *
312  * Revision 2.42 93/04/17 07:02:58 hines
313  * IRIX can use alloca
314  *
315  * Revision 2.41 93/04/14 15:04:04 hines
316  * some fixes to Imakefile
317  *
318  * Revision 2.40 93/04/13 12:12:19 hines
319  * SIG_RETURN already defined in HPUX : so defined as SIG_RETURN_TYEP
320  *
321  * Revision 2.39 93/04/12 14:08:44 hines
322  * first pass at merging Fisher's LINDA addition
323  *
324  * Revision 2.38 93/03/18 07:53:34 hines
325  * colors made static
326  *
327  * Revision 2.37 93/03/15 10:04:44 hines
328  * assert needs to be #undef before #define
329  *
330  * Revision 2.36 93/03/11 09:32:32 hines
331  * better error message when pointer to rangevar does not have arc spec
332  *
333  * Revision 2.35 93/03/11 07:38:03 hines
334  * Nigel Goddards fix to div() so it works on a cray.
335  *
336  * Revision 2.34 93/03/09 09:46:14 hines
337  * Object** hoc_temp_objvar(Symbol* template_symbol, void* cppobject)
338  * not entirely safe when "function returning object" is arg to another
339  * function. Safe when used in context
340  * o = obj.function_returning_object()
341  *
342  * Revision 2.33 93/03/09 07:45:20 hines
343  * hoc_call_func accepts BLTIN
344  *
345  * Revision 2.32 93/03/05 15:57:44 hines
346  * slider and can call a user interpreted function or procedure via
347  * hoc_call_func(Symbol*, int narg) with args on stack in first arg order
348  *
349  * Revision 2.31 93/03/05 08:42:20 hines
350  * some slight performance improvements by avoidin hoc_lookup for objects
351  * and use stack macros in code.cpp
352  *
353  * Revision 2.30 93/03/02 08:30:12 hines
354  * parallization of shortfor loop as in
355  * parallel for i=1,10 print i
356  *
357  * Revision 2.29 93/02/23 14:44:05 hines
358  * compiles under DOS
359  *
360  * Revision 2.28 93/02/22 14:29:58 hines
361  * nobody uses scanf("%F"..., everybody accepts scanf("%lf"...
362  *
363  * Revision 2.27 93/02/22 13:12:30 hines
364  * works with turboc on DOS (but no readline)
365  *
366  * Revision 2.26 93/02/22 10:57:34 hines
367  * checking of malloc out of order
368  *
369  * Revision 2.25 93/02/20 08:55:45 hines
370  * AIX
371  *
372  * Revision 2.24 93/02/15 08:12:32 hines
373  * for Linus
374  * I mean linux
375  *
376  * Revision 2.23 93/02/12 10:01:10 hines
377  * public names which are top level functions generated a syntax error.
378  *
379  * Revision 2.22 93/02/12 08:51:44 hines
380  * beginning of port to PC-Dos
381  *
382  * Revision 2.21 93/02/11 17:04:30 hines
383  * some fixes for NeXT
384  *
385  * Revision 2.20 93/02/03 11:28:01 hines
386  * a bit more generic for portability. will possibly work on NeXT
387  *
388  * Revision 2.19 93/02/02 10:34:38 hines
389  * static functions declared before used
390  *
391  * Revision 2.18 93/01/27 13:54:00 hines
392  * get METHOD3 from options.h
393  *
394  * Revision 2.17 93/01/23 13:40:47 hines
395  * don't inlclude stdio.h twice in ytab.cpp
396  *
397  * Revision 2.16 93/01/22 17:34:29 hines
398  * ocmodl, ivmodl working both for shared and static libraries
399  *
400  * Revision 2.15 93/01/21 16:21:30 hines
401  * load_func("name"), load_proc("name1", ...), load_template(...)
402  * searches *.oc and *.hoc in . HOCLIBRARYPATH, and $NEURONHOME/lib/hoc
403  * for the appropriate declaration and xopen's the first file that contains
404  * such a declaration.
405  *
406  * Revision 2.14 93/01/21 13:19:34 hines
407  * // commenst out the rest of the line
408  *
409  * Revision 2.13 93/01/21 12:45:49 hines
410  * memory leak on multiple strdef of same symbol
411  *
412  * Revision 2.12 93/01/15 08:20:25 hines
413  * can print nam of object with printf("%s",object)
414  *
415  * Revision 2.11 93/01/14 13:04:06 hines
416  * switch from Objectdata.pstr to Objectdata.ppstr so we can eventually have
417  * arrays of strings and so ivoc's varlabel will work properly.
418  *
419  * Revision 2.10 93/01/13 08:52:17 hines
420  * stubs for xvarlabel, xradiobutton, and xfixedvalue
421  * mechanism in place for notifying if strdef is freed.
422  *
423  * Revision 2.9 93/01/12 16:55:39 hines
424  * really 76 shift/reduce conflicts
425  *
426  * Revision 2.8 93/01/12 16:53:17 hines
427  * "str" = strdef was being allowed
428  *
429  * Revision 2.7 93/01/12 08:58:49 hines
430  * to assign to a hoc string use
431  * hoc_assign_str(char** cpp, char* buf)
432  * Some minor modifications to allow use of some functions by File class
433  *
434  * Revision 2.6 93/01/08 17:08:39 hines
435  * used by ivoc to make a hocusr with makeiv
436  *
437  * Revision 2.5 93/01/06 09:26:23 hines
438  * cray c90 needs include <errno.h> remove some codecenter warnings
439  *
440  * Revision 2.4 93/01/05 17:20:19 hines
441  * print perror() instead of errno=
442  * void sec_access_pop Section* nrn_pop_sec
443  *
444  * Revision 2.1 92/12/31 09:38:16 hines
445  * ready for beta release
446  *
447  * Revision 1.130 92/12/30 12:45:56 hines
448  * don't require empty line after endtemplate
449  *
450  * Revision 1.129 92/12/22 16:53:21 hines
451  * problem with new lines after public and external fixed.
452  * public and external now can be anywhere in template but they had better
453  * be before declarations (at least for external) and usage.
454  *
455  * Revision 1.128 92/12/22 15:29:31 hines
456  * a template can have an external statement followin the public
457  * statement which is a comma separated list of functions or procedures
458  * defined at the top level which can be executed within the object.
459  * (the function is executed in a top level context).
460  * public and external statements are optional
461  *
462  * Revision 1.127 92/12/18 15:12:03 hines
463  * fix bug in which pointers to range variables in object not allowed.
464  *
465  * Revision 1.126 92/12/11 09:41:33 hines
466  * execute("command", [objvar]) executes command in context of object (top-level
467  * if arg not present). int hoc_obj_execute(const char* cmd, Object*) used
468  * in C.
469  *
470  * Revision 1.125 92/11/27 08:19:33 hines
471  * can turn off error messages temporarily
472  *
473  * Revision 1.124 92/11/16 11:20:23 hines
474  * error in x.cpp message when color doesn't exist
475  * xlabel("string")
476  *
477  * Revision 1.123 92/11/13 16:09:20 hines
478  * parseexec gives execerror when incomplete parse
479  *
480  * Revision 1.122 92/11/13 07:34:23 hines
481  * hoc_object_pathname had problem with recursive objects
482  *
483  * Revision 1.121 92/11/11 12:40:55 hines
484  * hoc_val_pointer more robust.
485  * boolean is_obj_type(Object*, typename)
486  *
487  * Revision 1.120 92/11/10 07:38:37 hines
488  * char* expand_env_var(char*) expands all the $(...) in the string.
489  * moved from ivoc/main.cpp to here so oc can use it too.
490  * xopen("...") now allows environment variables
491  *
492  * Revision 1.119 92/11/09 17:14:28 hines
493  * botched last imakefile checkin by checking in the wrong one
494  *
495  * Revision 1.118 92/11/09 17:12:53 hines
496  * trivial fix to Imakefile
497  *
498  * Revision 1.117 92/10/30 16:05:01 hines
499  * echoing proper number of shift/reduce conflicts
500  *
501  * Revision 1.116 92/10/29 16:45:28 hines
502  * char* hoc_object_pathname(Object*)
503  *
504  * Revision 1.115 92/10/29 09:20:16 hines
505  * some errors in freeing objects fixed and replace usage of getarg for
506  * non numbers.
507  *
508  * Revision 1.114 92/10/28 17:33:51 hines
509  * *getarg() now checks to make sure it is returning a number
510  *
511  * Revision 1.113 92/10/27 12:08:18 hines
512  * list.cpp hoclist.h moved from nrnoc to oc
513  * all templates maintain a list of their objects
514  *
515  * Revision 1.112 92/10/27 09:17:48 hines
516  * rangevar(x) = y is an allowed syntax and sets the value at the segment that
517  * contains x
518  *
519  * Revision 1.111 92/10/24 12:12:48 hines
520  * botched last checkin. now its right.
521  *
522  * Revision 1.110 92/10/24 12:02:22 hines
523  * portability fixes found at Pittsburgh for CRAY and HP
524  *
525  * Revision 1.109 92/10/24 10:27:21 hines
526  * error in stub for xpvalue()
527  *
528  * Revision 1.108 92/10/24 10:17:49 hines
529  * botched last checkin for symbol.cpp. notifies interviews when hoc_free_val..
530  * called
531  *
532  * Revision 1.107 92/10/24 10:16:35 hines
533  * noiv.cpp is place to put function stubs that only make sense with interviews
534  * whenever any VAR is freed it should be done with hoc_free_val... which
535  * will notify the interviews objects that hold pointers to variables.
536  *
537  * Revision 1.106 92/10/23 14:07:35 hines
538  * only complete statements can be parsed in hoc_oc for now
539  * also resetting parser yystart on hoc-execerror
540  * object_name(Object*) returns object name
541  *
542  * Revision 1.105 92/10/23 08:21:30 hines
543  * fix some memory leaks with purify having to do with failing to free
544  * arayinfo
545  *
546  * Revision 1.104 92/10/22 12:33:21 hines
547  * for debugging there is a list of all objects (#define OBLIST 1)
548  * that can be printed. This list is turned off in hoc_oop.cpp
549  *
550  * Revision 1.103 92/10/22 09:49:17 hines
551  * ob.sec syntax must always do a poptypestack at end.
552  *
553  * Revision 1.102 92/10/21 15:50:03 hines
554  * this pointer is not referenced during initialization nor is it
555  * unreferenced during freeing the object
556  *
557  * Revision 1.101 92/10/21 14:51:50 hines
558  * fixed several errors having to do with stack and frame overflows
559  * under object.section { stmt} and calling hoc procedures with
560  * object.proc()
561  *
562  * Revision 1.100 92/10/21 11:10:31 hines
563  * didn't allow local variable names used as object components. fixed
564  * objectvar this
565  * inside template will automatically get set to itself.
566  * fixed error in popping the object type stack when sections were a component
567  *
568  * Revision 1.99 92/10/14 14:35:59 hines
569  * numarg() returns the number of arguments in a hoc procedure or function.
570  * hoc_typestack returns the type of the Datum on the stack
571  * hoc_argtype(i) returns the type of the ith arg.
572  *
573  * Revision 1.98 92/10/14 10:10:25 hines
574  * move oc specific stuff out of axis.cpp and into code2.cpp
575  * new argument function hoc_pgetarg checks for double pointer on stack
576  * and returns it.
577  * hoc_val_pointer(string) returns a pointer to the variable resulting
578  * from parsing the string.
579  *
580  * Revision 1.97 92/10/10 12:32:08 hines
581  * old section list syntax discarded in favor of making them first class
582  * objects.
583  * style is
584  * objectvar s
585  * s = new SectionList()
586  * sec s.append()
587  * sec s.remove()
588  * forsec s
589  * ifsec s
590  *
591  * Revision 1.96 92/10/10 10:24:06 hines
592  * ob.sec.range, ob.sec.range(x), ob.sec.property now allowed.
593  * ob.sec.range(x) = expr means just change the value of node closest to x
594  *
595  * Revision 1.95 92/10/09 12:16:13 hines
596  * remove old style point process syntax
597  * make hoc_run_expr(sym) much more general
598  * added hoc_run_stmt(sym) as well
599  * create them with hoc_parse_expr(char*, Symlist**) and
600  * hoc_parse_stmt(char*, Symlist**)
601  *
602  * Revision 1.94 92/10/09 07:48:23 hines
603  * method available for setting and retrieving values from built-in classes.
604  * used with new style of point processes.
605  *
606  * Revision 1.93 92/10/08 08:36:10 hines
607  * some extra parse error messages about assignments and redeclaring
608  * variables.
609  *
610  * Revision 1.92 92/10/07 15:43:26 hines
611  * arg syntax changed to $s1 and $o1 because O looked too much like 0
612  *
613  * Revision 1.91 92/10/07 15:34:36 hines
614  * error in stack frame on call to C++ constructors.
615  *
616  * Revision 1.90 92/10/07 14:07:08 hines
617  * get rid of irrelevant type clash on default action
618  *
619  * Revision 1.89 92/10/07 13:51:15 hines
620  * strings can be passed as args and read and set with $S1 = $S2
621  *
622  * Revision 1.88 92/10/07 10:45:14 hines
623  * a simpler connect statement is now available in addition to the old
624  * baroque syntax. it is
625  * connect sec1(x), sec2(0 or 1)
626  *
627  * Revision 1.87 92/10/07 09:47:27 hines
628  * keyword for setting pointers in models has been changed
629  * from connect to setpointer
630  *
631  * Revision 1.86 92/10/05 10:15:49 hines
632  * when _CRAY math functions get l suffix
633  *
634  * Revision 1.85 92/10/05 08:04:28 hines
635  * bad ; in one line
636  *
637  * Revision 1.84 92/10/02 17:28:40 hines
638  * can pass pointer to anything with &
639  *
640  * Revision 1.83 92/09/24 16:50:17 hines
641  * METHOD3 for nrnoc. when _method3 != 0 then x = i/nnode from i=0 to nnode
642  *
643  * Revision 1.82 92/09/18 15:13:45 hines
644  * hoc_list now won't conflict with OS::list
645  *
646  * Revision 1.81 92/09/18 13:39:01 hines
647  * c++ class members interfaced to oc can return an Object**
648  * used first for built in List class
649  *
650  * Revision 1.80 92/08/25 12:30:48 hines
651  * hoc_araystr(Symbol*, index, Objectdata*) returns a string expressing the
652  * array part of a variable
653  * hoc_total_array_data(Symbol*, Objectdata*) returns the total length of
654  * the variable vector.
655  *
656  * Revision 1.79 92/08/24 14:10:02 hines
657  * define OOP 1 in hoc.h
658  *
659  * Revision 1.78 92/08/18 10:24:43 hines
660  * templates can not make new objects using templates declared at the top level.
661  * first looks for local templates though.
662  *
663  * Revision 1.77 92/08/18 07:31:45 hines
664  * arrays in different objects can have different sizes.
665  * Now one uses araypt(symbol, SYMBOL) or araypt(symbol, OBJECTVAR) to
666  * return index of an array variable.
667  *
668  * Revision 1.76 92/08/17 12:49:38 hines
669  * arrays in different objects can have different sizes. Now arayinfo
670  * gets carried along in objectdata. arayinfo is reference counted.
671  *
672  * Revision 1.75 92/08/17 08:19:09 hines
673  * strdef, double, and objectvar can appear inside functions (any compound
674  * statement). They are still global (within a template). When executed
675  * (and if they are arrays) the old arayinfo is thrown away and the
676  * proper aray storage is allocated. Note that arrays should at least be
677  * initialized outside of a statement or else the parser will complain when
678  * it sees the array syntax. next step is to give each array in each object
679  * it's own arayinfo so they can have different bounds. At this time
680  * they could be inconsistent. One should not try to have the same name
681  * with different dimensions though.
682  *
683  * Revision 1.74 92/08/17 07:32:05 hines
684  * change from new(template) to new template(args)
685  * strange problem with tests/test5.hoc with segmentation violation that
686  * isn't seen with objectcenter and goes away when xopens have a path to the
687  * file.
688  *
689  * Revision 1.73 92/08/15 12:41:32 hines
690  * can pass object variable as arg to oc functions and procedures. Within
691  * the procedures the syntax is
692  * $$1.ob.ob.var etc.
693  * see test7.hoc for usage with array of strings
694  *
695  * Revision 1.72 92/08/12 16:16:16 hines
696  * uninsert mechanism_name
697  *
698  * Revision 1.71 92/08/12 11:56:34 hines
699  * hoc_fake_ret() allows calls to functions that do a ret(). These functions
700  * can have no arguments and the caller must pop the stack and deal with
701  * hoc_returning.
702  * This was done so init... could be called both from hoc_spinit and from
703  * hoc.
704  * last function called by hoc_spinit in hocusr.cpp is hoc_last_init()
705  *
706  * Revision 1.70 92/08/12 10:45:42 hines
707  * Changes of sejnowski lab. also gets sred from hoc. Major addition is
708  * a new x.cpp which is modified for screen updating following an expose
709  * event. This is in x_sejnowski.cpp and will compile to x.o when
710  * Sejnowski is defined as 1 in Imakefile (don't forget imknrn -a when
711  * changed and delete old x.o)
712  * Does not contain get_default on this checkin
713  *
714  * Revision 1.69 92/08/12 08:51:12 hines
715  * FARADAY and R (molar gas constant) added as built-in constants.
716  *
717  * Revision 1.68 92/08/10 16:00:05 hines
718  * forgot to checkin parse.ypp last time
719  *
720  * Revision 1.67 92/08/10 15:59:38 hines
721  * lists of sections with seclistdef ,,,
722  * append_seclist(seclist)
723  * remove_seclist(seclist)
724  * forsec seclist
725  * ifsec seclist
726  *
727  *
728  * Revision 1.66 92/08/10 10:30:28 hines
729  * hoc_thisobject contains a pointer to the current object. It is 0 at the
730  * top level.
731  *
732  * Revision 1.65 92/08/08 12:57:43 hines
733  * access object.section
734  *
735  * Revision 1.64 92/08/08 12:42:22 hines
736  * to get decent section names each object of a template has a unique index
737  * a count of the objects is kept in the template and when the count is
738  * 0 then the index restarts at 0.
739  * print ob will show the style
740  *
741  * Revision 1.63 92/08/08 11:56:50 hines
742  * ob.section.var not implemented but hooks are there to do it later
743  *
744  * Revision 1.62 92/08/08 10:03:01 hines
745  * properly push section from object
746  *
747  * Revision 1.61 92/08/07 16:13:27 hines
748  * sections as objects. sections now live in nmodl style list
749  *
750  * Revision 1.60 92/07/31 16:16:58 hines
751  * float_epsilon used for logical comparisons, int(), indexing and short for
752  * default value is 1e-11
753  * Hopfully no one has to worry about roundoff for the loops to come out
754  * right.
755  *
756  *
757  * Revision 1.59 92/07/31 14:34:57 hines
758  * avoid saber warning with hoc_xpop not declared double in nocable.cpp
759  *
760  * Revision 1.58 92/07/31 14:17:04 hines
761  * better handling of errno as in hoc
762  *
763  * Revision 1.57 92/07/31 13:49:19 hines
764  * fix up forsec and ifsec so it works in object context
765  *
766  * Revision 1.56 92/07/31 12:12:38 hines
767  * following merged from hoc
768  * The regular expression has been augmented with
769  * {istart-iend} where istart and iend are integers. The expression matches
770  * any integer that falls in this range.
771  *
772  * Revision 1.55 92/07/31 12:01:15 hines
773  * forsec and ifsec merged from hoc/neuron
774  *
775  * Revision 1.54 92/07/31 08:57:45 hines
776  * no longer use strings.h
777  *
778  * Revision 1.53 92/07/31 08:55:29 hines
779  * following merged from hoc to oc
780  * Stewart Jasloves contribution to axis labels. This can be invoked by
781  * setting #define Jaslove 1. It is 0 by default. The 3rd and 6th arguments
782  * of axis() may have a precision which specifies the number of digits
783  * after the decimal point for axis labels. eg. 5.3 denotes 5 tic marks with
784  * 3 digits after the decimal point for each tic label
785  *
786  *
787  * Revision 1.52 92/07/31 08:41:19 hines
788  * ecalloc returns 0 when requesting 0 space. (now matches hoc)
789  *
790  * Revision 1.51 92/07/31 08:33:45 hines
791  * failed to checkin code2.cpp when chkarg got moved there
792  *
793  * Revision 1.50 92/07/31 08:32:16 hines
794  * C interface objects see the top level symbol table
795  *
796  * Revision 1.49 92/07/31 08:29:56 hines
797  * remove the old newgraph stuff
798  *
799  * Revision 1.48 92/07/07 09:50:05 hines
800  * chkarg moved to code2.cpp so always available
801  *
802  * Revision 1.47 92/07/06 16:13:38 hines
803  * good start with interfacing c++ objects so they are callable from oc
804  *
805  * Revision 1.46 92/05/13 13:41:22 hines
806  * some names in hoc.h were reserved for c++.These are changed to
807  * cName when __cplusplus is defined.
808  *
809  * Revision 1.45 92/05/13 13:39:45 hines
810  * plot(-3) merely seeked to beginning of file without erasing it.
811  * now plt(-3) closes and reopens a 0 length file.
812  * only for fig plots not done for codraw at this time.
813  *
814  * Revision 1.44 92/04/15 11:22:58 hines
815  * double hoc_run_expr(sym) returns value of expresssion in sym made by
816  * hoc_parse_exper()
817  *
818  * Revision 1.43 92/04/09 12:39:54 hines
819  * ready to add idplot usage with newgraph(), addgraph(), initgraph(), xgraph()
820  * flushgraph().
821  * A facilitating function exists called
822  * Symbol* hoc_parse_expr(char* str, Symlist** psymlist) which
823  * return a procedure symbol which can be used as
824  * hoc_execute(sym->u.u_proc->defn.in);
825  * val = hoc_xpop();
826  *
827  * Revision 1.42 92/03/27 14:06:22 hines
828  * turn off readline event hook if hoc_interviews becomes 0
829  *
830  * Revision 1.41 92/03/19 08:57:38 hines
831  * axis labels close to origin set to 0 so label not strange looking.
832  *
833  * Revision 1.40 92/03/17 08:09:52 hines
834  * xmenufile() adds menu which can save or open menufiles.
835  *
836  * Revision 1.39 92/03/11 19:07:38 hines
837  * proper passing of strings as arguments to built-in functions.
838  * gargstr(i) and hoc_pgargstr(i)
839  *
840  * Revision 1.38 92/03/11 15:37:27 hines
841  * doEvents() will execute InterViews events if any.
842  *
843  * Revision 1.37 92/03/11 13:56:13 hines
844  * hoc.cpp inadvertently checked in last time with sigsegvec removed
845  *
846  * Revision 1.36 92/03/11 13:53:56 hines
847  * all parse errors now hoc_execerror
848  *
849  * Revision 1.35 92/03/06 16:01:18 hines
850  * hoc_oc can be used while executing. uses rinitcode(). But a problem
851  * exists when single tokens are parsed.
852  *
853  * Revision 1.34 92/03/06 07:19:46 hines
854  * hoc_ac_ global variable defined to allow evaluation of expressions
855  * via hoc_oc("hoc_ac_ = expr\n");
856  * Then the user can find the value in extern double hoc_ac_.
857  *
858  * Revision 1.33 92/03/05 14:46:39 hines
859  * number that terminates string demonstrated a bug in ungetc. now
860  * we test to make sure we don't unget a '\0'
861  *
862  * Revision 1.32 92/03/05 13:25:41 hines
863  * fix problem where not initcode after a execution by hoc_oc()
864  * xvalue added
865  *
866  * Revision 1.31 92/02/26 10:27:54 hines
867  * xview removed. nrnoc verified (needed fixes) for reversed section syntax.
868  *
869  * Revision 1.30 92/02/21 17:06:54 hines
870  * new signal handling. hoc_oc() gets a longjump and returns. on return
871  * the normal longjump is to hoc_run1()
872  *
873  * Revision 1.29 92/02/21 14:38:57 hines
874  * Completely event driven with event loop from InterViews.
875  *
876  * Revision 1.28 92/02/20 10:55:02 hines
877  * after em call from hoc_oc, execute the buffer
878  *
879  * Revision 1.27 92/02/19 15:02:02 hines
880  * preparing for sections within objects. syntax is
881  * ob.section stmt section.var
882  * this causes about 36 extra shift/reduce conflicts
883  *
884  * Revision 1.26 92/02/17 08:56:51 hines
885  * Imake defines BISON. Default parser is yacc (for hoc, nmodl, etc.)
886  *
887  * Revision 1.25 92/02/06 12:12:42 hines
888  * Can have comments on same line with no tokens in between.
889  * error fixed in translation of range vector with explicit section as first
890  * item in a statement.
891  *
892  * Revision 1.24 92/02/05 08:42:18 hines
893  * Can connect a NEURON {POINTER var,...} in models to external variables using
894  * connect var_suffix, anyvar
895  *
896  * Revision 1.23 92/02/03 11:22:59 hines
897  * rudimentary event driven version of oc.
898  *
899  * Revision 1.22 92/01/31 15:02:06 hines
900  * fix a trivial type mismatch that was revealed on switch to bison.
901  * Ready now to make oc event driven.
902  *
903  * Revision 1.21 92/01/30 11:05:12 hines
904  * leave out an xflush in x.cpp so doesn't hang. error in cable part of code.cpp
905  * found by codecenter. "if (a=b) instead of if(a == b)"
906  * Imakefile invokes ObjectOrientedHoc
907  *
908  * Revision 1.20 92/01/30 08:43:33 hines
909  * add -I.. to makedepend include path so it can find a touched stdarg.h
910  *
911  * Revision 1.19 92/01/30 08:17:21 hines
912  * bug fixes found in hoc incorporated. if()return, no else, objectcenter
913  * warnings.
914  *
915  * Revision 1.18 92/01/30 08:15:26 hines
916  * y
917  * under Imake control
918  *
919  * Revision 1.17 91/11/18 10:54:10 hines
920  * xview menus. ^C doesnt work yet.
921  *
922  * Revision 1.16 91/11/13 07:57:09 hines
923  * userdouble uses old style sym->u.pval
924  *
925  * Revision 1.15 91/11/05 11:24:17 hines
926  * all neuron/examples produce same results with nrnoc as with neuron.
927  * Found quite a few bugs this way.
928  *
929  * Revision 1.14 91/10/30 14:40:49 hines
930  * stack.hoc works and can be reloaded
931  *
932  * Revision 1.13 91/10/29 15:05:21 hines
933  * emacs command line editor with history
934  *
935  * Revision 1.12 91/10/25 12:03:52 hines
936  * double arrays in objects work. init (if it exists) in a template
937  * is executed for each new object.
938  *
939  * Revision 1.11 91/10/25 10:30:03 hines
940  * stop works inside object procedures
941  * fixed problem with single object statement in loop or if with no braces
942  *
943  * Revision 1.10 91/10/25 09:32:55 hines
944  * object arrays. stack.hoc works. need to work on stop command and
945  * necessity for braces around single statements in for loops.
946  *
947  * Revision 1.9 91/10/24 16:22:11 hines
948  * can call object functions and procedures. Object arrays not working yet.
949  * object_id(obj) is used for tests.
950  * STKDEBUG turned on in code.cpp in which every element also carries a type.
951  *
952  * Revision 1.8 91/10/22 15:47:17 hines
953  * objects and components. can assign, evaluate, and print.
954  * No object arrays or function components yet.
955  * At level of test3.hoc
956  *
957  * Revision 1.7 91/10/18 14:40:51 hines
958  * symbol tables now are type Symlist containing pointers to first and last
959  * symbols. New symbols get added onto the end.
960  *
961  * Revision 1.6 91/10/17 15:01:39 hines
962  * VAR, STRING now handled with pointer to value located in object data space
963  * to allow future multiple objects. Ie symbol for var, string, objectvar
964  * has offset into a pointer data space.
965  *
966  * Revision 1.5 91/10/16 13:14:14 hines
967  * fix up mistakes in last checkin
968  *
969  * Revision 1.4 91/10/16 12:48:00 hines
970  * symbol tables for the templates. Prototype not even executed.
971  * need to come to grips with how to find data in the objects.
972  *
973  * Revision 1.3 91/10/16 07:33:03 hines
974  * prototype of type checking
975  *
976  * Revision 1.2 91/10/14 17:36:16 hines
977  * scaffolding for oop in place. Syntax about right. No action yet.
978  *
979  * Revision 1.1 91/10/11 11:12:22 hines
980  * Initial revision
981  *
982  * --------------------------------
983  * Revision 4.44 91/10/01 11:37:55 hines
984  * optional use of xview libraries
985  *
986  * Revision 4.43 91/10/01 11:34:27 hines
987  * gather console input at one place in preparation for adding
988  * emacs like command line editing. Hoc input now reads entire line.
989  * Revision 3.1 89/07/07 14:16:30 mlh
990  * automattic version numbering
991  *
992  * Revision 3.0 89/07/07 13:58:28 mlh
993  * *** empty log message ***
994  *
995 */
996 
997 /* hoc */
998 char* RCS_hoc_version = "$Revision: 3 $";
999 char* RCS_hoc_date = "$Date: 2003-02-11 19:36:05 +0100 (Tue, 11 Feb 2003) $";
char * RCS_hoc_date
Definition: version.cpp:999
char * RCS_hoc_version
Definition: version.cpp:998