OpenCores
URL https://opencores.org/ocsvn/raptor64/raptor64/trunk

Subversion Repositories raptor64

[/] [raptor64/] [trunk/] [software/] [c64/] [source/] [err.c] - Blame information for rev 51

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 37 robfinch
// ============================================================================
2
// (C) 2012 Robert Finch
3
// All Rights Reserved.
4
// robfinch<remove>@opencores.org
5
//
6
// C64 - Raptor64 'C' derived language compiler
7
//  - 64 bit CPU
8
//
9
// This source file is free software: you can redistribute it and/or modify 
10
// it under the terms of the GNU Lesser General Public License as published 
11
// by the Free Software Foundation, either version 3 of the License, or     
12
// (at your option) any later version.                                      
13
//                                                                          
14
// This source file is distributed in the hope that it will be useful,      
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of           
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
17
// GNU General Public License for more details.                             
18
//                                                                          
19
// You should have received a copy of the GNU General Public License        
20
// along with this program.  If not, see <http://www.gnu.org/licenses/>.    
21
//                                                                          
22
// ============================================================================
23
//
24
#include "c.h"
25
 
26
extern int numerrs;
27
extern int total_errors;
28
extern int errno[80];
29
 
30
static char *errtextstr[] = {
31
        "Syntax error",
32
        "Illegal character",
33
        "Floating point",
34
        "Illegal type",
35
        "Undefined symbol",
36 51 robfinch
        "Duplicate symbol",
37 37 robfinch
        "Bad punctuation",
38
        "Identifier expected",
39
        "No initializer",
40
        "Incomplete statement",
41
        "Illegal initializer",
42
        "Illegal class",
43
        "block",
44
        "No pointer",
45
        "No function",
46
        "No member",
47
        "LValue required",
48
        "Dereference",
49
        "Mismatch",
50
        "Expression expected",
51
        "While/Until expected",
52
        "Missing case statement",
53
        "Duplicate case statement",
54
        "Bad label",
55
        "Preprocessor error",
56
        "Include file",
57
        "Can't open",
58
        "Define",
59
        "Expecting a catch statement",
60
        "Bad bitfield width",
61
        "Expression too complex",
62
        "Asm statement too long - break into multiple statements",
63
        "Too many case constants",
64 51 robfinch
        "Attempting to catch a structure - aggregates may not be caught - use a pointer to struct",
65
        "Semaphore increment / decrement limited to 1 to 15."
66
        "Semaphore address must be 16 byte aligned."
67 37 robfinch
};
68
 
69
char *errtext(int errnum)
70
{
71
        return errtextstr[errnum];
72
}
73
 
74
/*
75
 *      error - print error information
76
 */
77
void error(int n)
78
{
79
        if (numerrs < 80) {
80
                errno[numerrs++] = n;
81
                ++total_errors;
82
        }
83
        else
84
                exit(1);
85
}
86
 
87
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.