File: error.h

package info (click to toggle)
icmake 13.05.01-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,132 kB
  • sloc: cpp: 11,595; fortran: 883; makefile: 853; sh: 546; pascal: 342
file content (89 lines) | stat: -rw-r--r-- 2,078 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#ifndef INCLUDED_ERROR_
#define INCLUDED_ERROR_

#include <ostream>

class Error
{
    static char const *s_static[];
    static char const *s_semantic[];

    static size_t s_nErrors;
    static size_t s_error;
    static size_t s_lastLine;
    static size_t s_displayCount;

    enum 
    {
        MAX_PER_LINE = 2
    };

    public:
        enum Static
        {
            OFF,                    
            CLOSEPAREN,             
            COMMA_OR_CLOSEPAREN,    
            COMMA_OR_SEMICOL,       
            EXPRESSION,             
            IDENTIFIER,             
            INIT,                   
            NO_MAIN,               
            OPENPAREN,  
            OPENCURLY,  
            SEMICOL,    
            STATEMENT,    
            TYPENAME,   
        };

        enum Semantic
        {
            NO_ERROR,
            AMBIGUOUS_OVERLOAD,    
            ARGUMENT_MISMATCH,     
//            CANNOT_OVERLOAD,       
            DIVISION_BY_ZERO,      
            EXIT_TYPE,             
            FPRINTF_NO_STR,        
            INDEX_TYPE,            
            INVALID_CAST,          
            INVALID_OPERAND,       
            LIST_CONST,            
            LVALUE_NEEDED,         
            MAIN_NOT_RECURSIVE,    
            MAIN_NO_OVERLOADS,    
            MAIN_PARAMS_ERROR,     
            MAIN_RETURN_ERROR,     
            MULTIPLY_DEFINED,      
            NESTED_PRINTF_INSERTION,
            NO_BREAK,              
            NO_CONTINUE,           
            OPERAND_TYPES,
            PRINTF_OPCODE,
            RETURN_TYPE,           
            TERNARY_TYPES,         
            UNDEFINED_VAR,         
            UNDEFINED_FUNCTION,    
        };

        static void msg();
        static std::ostream &msg(Semantic error);
        static size_t count();                                      // .f
        static void set(Static error);                              // .f

    private:
        static bool display();

};

#include "count.f"
#include "set.f"

#endif