1 #ifndef READ_FUNC_H
2 #define READ_FUNC_H
3 
4 #include <sc_export.h>
5 #include <sdai.h>
6 
7 /// This was 512. According to 10303-21:2002 section 5.6: comment length is unlimited. FIXME need to check the code for potential problems before eliminating this limit completely.
8 #define MAX_COMMENT_LENGTH 8192
9 
10 // print Error information for debugging purposes
11 extern SC_CORE_EXPORT void PrintErrorState( ErrorDescriptor & err );
12 
13 // print istream error information for debugging purposes
14 extern SC_CORE_EXPORT void IStreamState( istream & in );
15 
16 extern SC_CORE_EXPORT int ReadInteger( SDAI_Integer & val, istream & in, ErrorDescriptor * err,
17                                        const char * tokenList );
18 
19 extern SC_CORE_EXPORT int ReadInteger( SDAI_Integer & val, const char * s, ErrorDescriptor * err,
20                                        const char * tokenList );
21 
22 extern SC_CORE_EXPORT Severity IntValidLevel( const char * attrValue, ErrorDescriptor * err,
23         int clearError, int optional, const char * tokenList );
24 
25 extern SC_CORE_EXPORT std::string WriteReal( SDAI_Real val );
26 
27 extern SC_CORE_EXPORT void WriteReal( SDAI_Real val, ostream & out );
28 
29 extern SC_CORE_EXPORT int ReadReal( SDAI_Real & val, istream & in, ErrorDescriptor * err,
30                                     const char * tokenList );
31 
32 extern SC_CORE_EXPORT int ReadReal( SDAI_Real & val, const char * s, ErrorDescriptor * err,
33                                     const char * tokenList );
34 
35 extern SC_CORE_EXPORT Severity RealValidLevel( const char * attrValue, ErrorDescriptor * err,
36         int clearError, int optional, const char * tokenList );
37 
38 extern SC_CORE_EXPORT int ReadNumber( SDAI_Real & val, istream & in, ErrorDescriptor * err,
39                                       const char * tokenList );
40 
41 extern SC_CORE_EXPORT int ReadNumber( SDAI_Real & val, const char * s, ErrorDescriptor * err,
42                                       const char * tokenList );
43 
44 extern SC_CORE_EXPORT Severity NumberValidLevel( const char * attrValue, ErrorDescriptor * err,
45         int clearError, int optional, const char * tokenList );
46 
47 
48 ////////////////////
49 
50 extern SC_CORE_EXPORT int   QuoteInString( istream & in );
51 
52 extern SC_CORE_EXPORT void PushPastString( istream & in, std::string & s, ErrorDescriptor * err );
53 
54 extern SC_CORE_EXPORT void PushPastImbedAggr( istream & in, std::string & s, ErrorDescriptor * err );
55 
56 extern SC_CORE_EXPORT void PushPastAggr1Dim( istream & in, std::string & s, ErrorDescriptor * err );
57 
58 ////////////////////
59 
60 extern SC_CORE_EXPORT Severity FindStartOfInstance( istream & in, std::string & inst );
61 
62 ///  used for instances that aren\'t valid - reads to next \';\'
63 extern SC_CORE_EXPORT Severity SkipInstance( istream & in, std::string & inst );
64 
65 extern SC_CORE_EXPORT const char * SkipSimpleRecord( istream & in, std::string & buf, ErrorDescriptor * err );
66 
67 /// this includes entity names
68 extern SC_CORE_EXPORT const char * ReadStdKeyword( istream & in, std::string & buf, int skipInitWS = 1 );
69 
70 extern SC_CORE_EXPORT const char * GetKeyword( istream & in, const char * delims, ErrorDescriptor & err );
71 
72 extern SC_CORE_EXPORT int FoundEndSecKywd( istream& in );
73 
74 extern SC_CORE_EXPORT const char * ReadComment( std::string & ss, const char * s );
75 
76 extern SC_CORE_EXPORT const char * ReadComment( istream & in, std::string & s );
77 
78 extern SC_CORE_EXPORT Severity ReadPcd( istream & in ); //print control directive
79 
80 extern SC_CORE_EXPORT void ReadTokenSeparator( istream & in, std::string * comments = 0 );
81 
82 #endif
83