1 /******************************************************************************
3 KPP - The Kinetic PreProcessor
4 Builds simulation code for chemical kinetic systems
6 Copyright (C) 1995-1996 Valeriu Damian and Adrian Sandu
7 Copyright (C) 1997-2005 Adrian Sandu
9 KPP is free software; you can redistribute it and/or modify it under the
10 terms of the GNU General Public License as published by the Free Software
11 Foundation (http://www.gnu.org/copyleft/gpl.html); either version 2 of the
12 License, or (at your option) any later version.
14 KPP is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, consult http://www.gnu.org/copyleft/gpl.html or
21 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA.
25 Computer Science Department
26 Virginia Polytechnic Institute and State University
28 E-mail: sandu@cs.vt.edu
30 ******************************************************************************/
40 /* mz_rs_20050518+ value increased */
41 #define MAX_INLINE 10000
42 /* #define MAX_INLINE 4000 */
45 enum eq_state
{ LHS
, RHS
, RAT
};
46 enum sptypes
{ DUMMY_SPC
, VAR_SPC
, RAD_SPC
, FIX_SPC
};
47 enum atomcheck
{ NO_CHECK
, DO_CHECK
, CANCEL_CHECK
};
48 enum codetype
{ APPEND
, REPLACE
};
58 extern int crt_line_no
;
59 extern char *crt_filename
;
61 extern char crtFile
[];
62 extern char crtToken
[];
63 extern char nextToken
[];
64 extern int crtTokType
;
65 extern int nextTokType
;
68 extern int crt_section
;
70 int Parser( char * filename
);
71 void ScanError( char *fmt
, ... );
72 void ParserError( char *fmt
, ... );
73 void ScanWarning( char *fmt
, ... );
74 void ParserWarning( char *fmt
, ... );
75 void Error( char *fmt
, ... );
76 void Warning( char *fmt
, ... );
77 void Message( char *fmt
, ... );
78 void FatalError( int status
, char *fmt
, ... );
80 void DeclareAtom( char *atname
);
81 void SetAtomType( char *atname
, int type
);
82 void AddAtom( char *atname
, char *nr
);
83 void DeclareSpecies( int type
, char* spname
);
84 void SetSpcType( int type
, char *spname
);
85 void AssignInitialValue( char *spname
, char *spval
);
86 void StoreEquationRate( char *rate
, char *label
);
88 void ProcessTerm( int side
, char *sign
, char *coef
, char *spname
);
89 void AddLumpSpecies( char *spname
);
90 void CheckLump( char *spname
);
91 void AddLookAt( char *spname
);
92 void AddMonitor( char *spname
);
93 void AddTransport( char *spname
);
100 char * AppendString( char * s1
, char * s2
, int * len
, int addlen
);
101 void AddInlineCode( char * context
, char * code
);