1 | /****************************************************************************** |
---|
2 | |
---|
3 | KPP - The Kinetic PreProcessor |
---|
4 | Builds simulation code for chemical kinetic systems |
---|
5 | |
---|
6 | Copyright (C) 1995-1996 Valeriu Damian and Adrian Sandu |
---|
7 | Copyright (C) 1997-2005 Adrian Sandu |
---|
8 | |
---|
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. |
---|
13 | |
---|
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 |
---|
17 | details. |
---|
18 | |
---|
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. |
---|
23 | |
---|
24 | Adrian Sandu |
---|
25 | Computer Science Department |
---|
26 | Virginia Polytechnic Institute and State University |
---|
27 | Blacksburg, VA 24060 |
---|
28 | E-mail: sandu@cs.vt.edu |
---|
29 | |
---|
30 | ******************************************************************************/ |
---|
31 | |
---|
32 | |
---|
33 | |
---|
34 | #ifndef _SCAN_H_ |
---|
35 | #define _SCAN_H_ |
---|
36 | |
---|
37 | #include <stdio.h> |
---|
38 | #include "gdef.h" |
---|
39 | |
---|
40 | /* mz_rs_20050518+ value increased */ |
---|
41 | #define MAX_INLINE 10000 |
---|
42 | /* #define MAX_INLINE 4000 */ |
---|
43 | /* mz_rs_20050518- */ |
---|
44 | |
---|
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 }; |
---|
49 | |
---|
50 | typedef struct { |
---|
51 | int key; |
---|
52 | int type; |
---|
53 | char * kname; |
---|
54 | } INLINE_KEY; |
---|
55 | |
---|
56 | extern int eqState; |
---|
57 | extern int isPhoto; |
---|
58 | extern int crt_line_no; |
---|
59 | extern char *crt_filename; |
---|
60 | extern int crtLine; |
---|
61 | extern char crtFile[]; |
---|
62 | extern char crtToken[]; |
---|
63 | extern char nextToken[]; |
---|
64 | extern int crtTokType; |
---|
65 | extern int nextTokType; |
---|
66 | extern int nError; |
---|
67 | extern int nWarning; |
---|
68 | extern int crt_section; |
---|
69 | |
---|
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, ... ); |
---|
79 | |
---|
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 ); |
---|
87 | void CheckEquation(); |
---|
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 ); |
---|
94 | |
---|
95 | void WriteAtoms(); |
---|
96 | void WriteSpecies(); |
---|
97 | void WriteMatrices(); |
---|
98 | void WriteOptions(); |
---|
99 | |
---|
100 | char * AppendString( char * s1, char * s2, int * len, int addlen ); |
---|
101 | void AddInlineCode( char * context, char * code ); |
---|
102 | |
---|
103 | #endif |
---|