NEURON
NMODL Translator

Implementation of NMODL Source-to-Source translator (NOCMODL) More...

Classes

struct  Item
 
struct  Symbol
 

Macros

#define NRN_BUFSIZE   8192
 
#define ITEM0   (Item*) 0
 
#define LIST0   (List*) 0
 
#define ITERATE(itm, lst)   for (itm = (lst)->next; itm != (lst); itm = itm->next)
 
#define SYM0   (Symbol*) 0
 
#define SYM(q)   ((q)->element.sym)
 
#define STR(q)   ((q)->element.str)
 
#define ITM(q)   ((q)->element.itm)
 
#define LST(q)   ((q)->element.lst)
 
#define SPECIAL   1
 
#define SYMBOL   1
 
#define ITEM   2
 
#define LIST   3
 
#define KEYWORD   01
 
#define PARM   02
 
#define INDEP   04
 
#define DEP   010 /* also in usage field */
 
#define STAT   020
 
#define ARRAY   040
 
#define FUNCT   0100 /* also in usage field */
 
#define PROCED   0200
 
#define NEGATIVE   0400
 
#define SEMI   01 /* ";" */
 
#define BEGINBLK   02 /* "{" */
 
#define ENDBLK   04 /* "}" */
 
#define DERF   01000
 
#define KINF   02000
 
#define NLINF   04000
 
#define DISCF   010000
 
#define PARF   040000
 
#define EXTDEF   0100000
 
#define LINF   0200000
 
#define UNITDEF   0400000L
 
#define EXTDEF2   01000000L /* functions that can take array or function name arguments */
 
#define nmodlCONST   02000000L /* constants that do not appear in .var file */
 
#define EXTDEF3   04000000L /* get two extra reset arguments at beginning */
 
#define INTGER   010000000L /* must be cast to double in expr */
 
#define EXTDEF4   020000000L /* get extra NrnThread* arg at beginning */
 
#define EXTDEF5   040000000L /* not threadsafe from the extdef list */
 
#define EXTDEF_RANDOM   0600000000L /* functions that can be used with RANDOM type */
 
#define EXPLICIT_DECL   01 /* usage field, variable occurs in input file */
 
#define NRNEXTRN   01 /* t, dt, celsius, etc. */
 
#define NRNCURIN   02 /* input value used */
 
#define NRNCUROUT   04 /* added to output value */
 
#define NRNRANGE   010
 
#define NRNPRANGEIN   020
 
#define NRNPRANGEOUT   040
 
#define NRNGLOBAL   0100 /* same for all sections, defined here */
 
#define NRNSTATIC   0200 /* v */
 
#define NRNNOTP   0400 /* doesn't belong in p array */
 
#define NRNIONFLAG
 
#define NRNPOINTER   04000
 
#define IONCONC   010000
 
#define NRNBBCOREPOINTER   020000
 
#define NMODLRANDOM   040000
 
#define IONCONC_IMPLICIT   040000
 
#define Fprintf   fprintf
 
#define Fclose   fclose
 
#define Fflush   fflush
 
#define Printf   printf
 
#define Strcpy   strcpy
 
#define Strcat   strcat
 
#define Insertstr   insertstr
 
#define Insertsym   insertsym
 
#define Linsertsym   linsertsym
 
#define Linsertstr   linsertstr
 
#define Lappendsym   lappendsym
 
#define Lappendstr   lappendstr
 
#define Lappenditem   lappenditem
 
#define Lappendlst   lappendlst
 
#define IGNORE(arg)   arg
 
#define Free(arg)   free((void*) (arg))
 

Typedefs

typedef struct Item List
 
typedef struct Item Item
 
typedef struct Symbol Symbol
 

Functions

char * emalloc (unsigned)
 
char * stralloc (const char *, char *)
 
char * inputline ()
 
char * inputtopar ()
 
char * Gets (char *)
 
Listnewlist ()
 
Listinputtext ()
 
Itemputintoken (const char *s, short type)
 
Iteminsertstr (Item *item, const char *str)
 
Iteminsertsym (List *list, Symbol *sym)
 
Itemlinsertstr (List *list, const char *str)
 
Itemlappendstr (List *list, const char *str)
 
Itemlinsertsym (List *list, Symbol *sym)
 
Itemlappendsym (List *list, Symbol *sym)
 
Itemlappenditem (List *list, Item *item)
 
Itemlappendlst (List *list, List *lst)
 
Itemnext ()
 
Itemprev ()
 
Symbolinstall (const char *, int)
 
Symbollookup (const char *)
 
Symbolcopylocal (Symbol *)
 
Symbolifnew_parminstall (const char *name, const char *num, const char *units, const char *limits)
 
void printlist (List *)
 
void verbatim_adjust (char *q)
 

Variables

std::map< std::string, const char * > extdef_rand
 
int nmodl_text
 
Listfiletxtlist
 
char finname [NRN_BUFSIZE]
 
char buf [NRN_BUFSIZE]
 
char * modprefix
 
Listintoken
 
Listinitfunc
 
Listconstructorfunc
 
Listdestructorfunc
 
Listmodelfunc
 
Listtermfunc
 
Listprocfunc
 
Listinitlist
 
Listfirstlist
 
Listplotlist
 
FILE * fin
 
FILE * fparout
 
FILE * fcout
 
Symbolsemi
 
Symbolbeginblk
 
Symbolendblk
 

Detailed Description

Implementation of NMODL Source-to-Source translator (NOCMODL)

Macro Definition Documentation

◆ ARRAY

#define ARRAY   040

Definition at line 187 of file modl.h.

◆ BEGINBLK

#define BEGINBLK   02 /* "{" */

Definition at line 192 of file modl.h.

◆ DEP

#define DEP   010 /* also in usage field */

Definition at line 185 of file modl.h.

◆ DERF

#define DERF   01000

Definition at line 194 of file modl.h.

◆ DISCF

#define DISCF   010000

Definition at line 197 of file modl.h.

◆ ENDBLK

#define ENDBLK   04 /* "}" */

Definition at line 193 of file modl.h.

◆ EXPLICIT_DECL

#define EXPLICIT_DECL   01 /* usage field, variable occurs in input file */

Definition at line 209 of file modl.h.

◆ EXTDEF

#define EXTDEF   0100000

Definition at line 199 of file modl.h.

◆ EXTDEF2

#define EXTDEF2   01000000L /* functions that can take array or function name arguments */

Definition at line 202 of file modl.h.

◆ EXTDEF3

#define EXTDEF3   04000000L /* get two extra reset arguments at beginning */

Definition at line 204 of file modl.h.

◆ EXTDEF4

#define EXTDEF4   020000000L /* get extra NrnThread* arg at beginning */

Definition at line 206 of file modl.h.

◆ EXTDEF5

#define EXTDEF5   040000000L /* not threadsafe from the extdef list */

Definition at line 207 of file modl.h.

◆ EXTDEF_RANDOM

#define EXTDEF_RANDOM   0600000000L /* functions that can be used with RANDOM type */

Definition at line 208 of file modl.h.

◆ Fclose

#define Fclose   fclose

Definition at line 315 of file modl.h.

◆ Fflush

#define Fflush   fflush

Definition at line 316 of file modl.h.

◆ Fprintf

#define Fprintf   fprintf

Definition at line 314 of file modl.h.

◆ Free

#define Free (   arg)    free((void*) (arg))

Definition at line 329 of file modl.h.

◆ FUNCT

#define FUNCT   0100 /* also in usage field */

Definition at line 188 of file modl.h.

◆ IGNORE

#define IGNORE (   arg)    arg

Definition at line 328 of file modl.h.

◆ INDEP

#define INDEP   04

Definition at line 184 of file modl.h.

◆ Insertstr

#define Insertstr   insertstr

Definition at line 320 of file modl.h.

◆ Insertsym

#define Insertsym   insertsym

Definition at line 321 of file modl.h.

◆ INTGER

#define INTGER   010000000L /* must be cast to double in expr */

Definition at line 205 of file modl.h.

◆ IONCONC

#define IONCONC   010000

Definition at line 224 of file modl.h.

◆ IONCONC_IMPLICIT

#define IONCONC_IMPLICIT   040000

Definition at line 229 of file modl.h.

◆ ITEM

#define ITEM   2

Definition at line 173 of file modl.h.

◆ ITEM0

#define ITEM0   (Item*) 0

Definition at line 106 of file modl.h.

◆ ITERATE

#define ITERATE (   itm,
  lst 
)    for (itm = (lst)->next; itm != (lst); itm = itm->next)

Definition at line 109 of file modl.h.

◆ ITM

#define ITM (   q)    ((q)->element.itm)

Definition at line 168 of file modl.h.

◆ KEYWORD

#define KEYWORD   01

Definition at line 182 of file modl.h.

◆ KINF

#define KINF   02000

Definition at line 195 of file modl.h.

◆ Lappenditem

#define Lappenditem   lappenditem

Definition at line 326 of file modl.h.

◆ Lappendlst

#define Lappendlst   lappendlst

Definition at line 327 of file modl.h.

◆ Lappendstr

#define Lappendstr   lappendstr

Definition at line 325 of file modl.h.

◆ Lappendsym

#define Lappendsym   lappendsym

Definition at line 324 of file modl.h.

◆ LINF

#define LINF   0200000

Definition at line 200 of file modl.h.

◆ Linsertstr

#define Linsertstr   linsertstr

Definition at line 323 of file modl.h.

◆ Linsertsym

#define Linsertsym   linsertsym

Definition at line 322 of file modl.h.

◆ LIST

#define LIST   3

Definition at line 174 of file modl.h.

◆ LIST0

#define LIST0   (List*) 0

Definition at line 107 of file modl.h.

◆ LST

#define LST (   q)    ((q)->element.lst)

Definition at line 169 of file modl.h.

◆ NEGATIVE

#define NEGATIVE   0400

Definition at line 190 of file modl.h.

◆ NLINF

#define NLINF   04000

Definition at line 196 of file modl.h.

◆ nmodlCONST

#define nmodlCONST   02000000L /* constants that do not appear in .var file */

Definition at line 203 of file modl.h.

◆ NMODLRANDOM

#define NMODLRANDOM   040000

Definition at line 226 of file modl.h.

◆ NRN_BUFSIZE

#define NRN_BUFSIZE   8192

Definition at line 87 of file modl.h.

◆ NRNBBCOREPOINTER

#define NRNBBCOREPOINTER   020000

Definition at line 225 of file modl.h.

◆ NRNCURIN

#define NRNCURIN   02 /* input value used */

Definition at line 213 of file modl.h.

◆ NRNCUROUT

#define NRNCUROUT   04 /* added to output value */

Definition at line 214 of file modl.h.

◆ NRNEXTRN

#define NRNEXTRN   01 /* t, dt, celsius, etc. */

Definition at line 212 of file modl.h.

◆ NRNGLOBAL

#define NRNGLOBAL   0100 /* same for all sections, defined here */

Definition at line 218 of file modl.h.

◆ NRNIONFLAG

#define NRNIONFLAG
Value:
01000 /* temporary flag to allow READ and WRITE \
without declaring twice */

Definition at line 221 of file modl.h.

◆ NRNNOTP

#define NRNNOTP   0400 /* doesn't belong in p array */

Definition at line 220 of file modl.h.

◆ NRNPOINTER

#define NRNPOINTER   04000

Definition at line 223 of file modl.h.

◆ NRNPRANGEIN

#define NRNPRANGEIN   020

Definition at line 216 of file modl.h.

◆ NRNPRANGEOUT

#define NRNPRANGEOUT   040

Definition at line 217 of file modl.h.

◆ NRNRANGE

#define NRNRANGE   010

Definition at line 215 of file modl.h.

◆ NRNSTATIC

#define NRNSTATIC   0200 /* v */

Definition at line 219 of file modl.h.

◆ PARF

#define PARF   040000

Definition at line 198 of file modl.h.

◆ PARM

#define PARM   02

Definition at line 183 of file modl.h.

◆ Printf

#define Printf   printf

Definition at line 317 of file modl.h.

◆ PROCED

#define PROCED   0200

Definition at line 189 of file modl.h.

◆ SEMI

#define SEMI   01 /* ";" */

Definition at line 191 of file modl.h.

◆ SPECIAL

#define SPECIAL   1

Definition at line 171 of file modl.h.

◆ STAT

#define STAT   020

Definition at line 186 of file modl.h.

◆ STR

#define STR (   q)    ((q)->element.str)

Definition at line 167 of file modl.h.

◆ Strcat

#define Strcat   strcat

Definition at line 319 of file modl.h.

◆ Strcpy

#define Strcpy   strcpy

Definition at line 318 of file modl.h.

◆ SYM

#define SYM (   q)    ((q)->element.sym)

Definition at line 166 of file modl.h.

◆ SYM0

#define SYM0   (Symbol*) 0

Definition at line 158 of file modl.h.

◆ SYMBOL

#define SYMBOL   1

Definition at line 172 of file modl.h.

◆ UNITDEF

#define UNITDEF   0400000L

Definition at line 201 of file modl.h.

Typedef Documentation

◆ Item

typedef struct Item Item

◆ List

typedef struct Item List

Definition at line 1 of file modl.h.

◆ Symbol

typedef struct Symbol Symbol

Function Documentation

◆ copylocal()

Symbol * copylocal ( Symbol )

◆ emalloc()

char* emalloc ( unsigned  n)

Definition at line 128 of file list.cpp.

◆ Gets()

char * Gets ( char *  buf)

Definition at line 91 of file io.cpp.

◆ ifnew_parminstall()

Symbol * ifnew_parminstall ( const char *  name,
const char *  num,
const char *  units,
const char *  limits 
)

Definition at line 71 of file parsact.cpp.

◆ inputline()

char * inputline ( )

◆ inputtext()

List * inputtext ( )

◆ inputtopar()

char * inputtopar ( )

◆ insertstr()

Item * insertstr ( Item item,
const char *  str 
)

◆ insertsym()

Item * insertsym ( List list,
Symbol sym 
)

◆ install()

Symbol* install ( const char *  ,
int   
)

◆ lappenditem()

Item * lappenditem ( List list,
Item item 
)

◆ lappendlst()

Item * lappendlst ( List list,
List lst 
)

◆ lappendstr()

Item * lappendstr ( List list,
const char *  str 
)

◆ lappendsym()

Item * lappendsym ( List list,
Symbol sym 
)

◆ linsertstr()

Item * linsertstr ( List list,
const char *  str 
)

◆ linsertsym()

Item * linsertsym ( List list,
Symbol sym 
)

◆ lookup()

Symbol * lookup ( const char *  )

◆ newlist()

List* newlist ( void  )

◆ next()

Item * next ( )

◆ prev()

Item * prev ( )

◆ printlist()

void printlist ( List list)

Definition at line 141 of file model.cpp.

◆ putintoken()

Item* putintoken ( const char *  s,
short  type 
)

◆ stralloc()

char * stralloc ( const char *  buf,
char *  rel 
)

Definition at line 129 of file list.cpp.

◆ verbatim_adjust()

void verbatim_adjust ( char *  q)

Definition at line 261 of file modl.cpp.

Variable Documentation

◆ beginblk

Symbol * beginblk

Definition at line 277 of file modl.h.

◆ buf

char buf[NRN_BUFSIZE]
extern

Definition at line 13 of file init.cpp.

◆ constructorfunc

List * constructorfunc

Definition at line 269 of file modl.h.

◆ destructorfunc

List * destructorfunc

Definition at line 269 of file modl.h.

◆ endblk

Symbol * endblk

Definition at line 278 of file modl.h.

◆ extdef_rand

std::map<std::string, const char*> extdef_rand
extern

Definition at line 158 of file init.cpp.

◆ fcout

FILE * fcout

Definition at line 274 of file modl.h.

◆ filetxtlist

List* filetxtlist
extern

Definition at line 59 of file modl.cpp.

◆ fin

FILE* fin
extern

Definition at line 33 of file model.cpp.

◆ finname

char finname[NRN_BUFSIZE]
extern

Definition at line 38 of file model.cpp.

◆ firstlist

List * firstlist

Definition at line 269 of file modl.h.

◆ fparout

FILE * fparout

Definition at line 273 of file modl.h.

◆ initfunc

List * initfunc

Definition at line 268 of file modl.h.

◆ initlist

List * initlist

Definition at line 269 of file modl.h.

◆ intoken

List* intoken
extern

Definition at line 12 of file init.cpp.

◆ modelfunc

List * modelfunc

Definition at line 269 of file modl.h.

◆ modprefix

char* modprefix
extern

Definition at line 48 of file modl.cpp.

◆ nmodl_text

int nmodl_text
extern

Definition at line 58 of file modl.cpp.

◆ plotlist

List * plotlist

Definition at line 270 of file modl.h.

◆ procfunc

List * procfunc

Definition at line 269 of file modl.h.

◆ semi

Symbol* semi
extern

Definition at line 11 of file init.cpp.

◆ termfunc

List * termfunc

Definition at line 269 of file modl.h.