Subversion Repositories tendra.SVN

Rev

Rev 5 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5 Rev 6
Line -... Line 1...
-
 
1
/*
-
 
2
 * Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>.
-
 
3
 * All rights reserved.
-
 
4
 *
-
 
5
 * Redistribution and use in source and binary forms, with or without
-
 
6
 * modification, are permitted provided that the following conditions are met:
-
 
7
 *
-
 
8
 * 1. Redistributions of source code must retain the above copyright notice,
-
 
9
 *    this list of conditions and the following disclaimer.
-
 
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
-
 
11
 *    this list of conditions and the following disclaimer in the documentation
-
 
12
 *    and/or other materials provided with the distribution.
-
 
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
-
 
14
 *    may be used to endorse or promote products derived from this software
-
 
15
 *    without specific, prior written permission.
-
 
16
 *
-
 
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
-
 
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-
 
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-
 
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
-
 
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-
 
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-
 
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-
 
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-
 
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-
 
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-
 
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 
28
 *
-
 
29
 * $Id$
-
 
30
 */
1
/*
31
/*
2
    		 Crown Copyright (c) 1997
32
    		 Crown Copyright (c) 1997
3
    
33
 
4
    This TenDRA(r) Computer Program is subject to Copyright
34
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
35
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
36
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
37
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
38
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
39
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
40
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
41
    shall be deemed to be acceptance of the following conditions:-
12
    
42
 
13
        (1) Its Recipients shall ensure that this Notice is
43
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
44
        reproduced upon any copies or amended versions of it;
15
    
45
 
16
        (2) Any amended version of it shall be clearly marked to
46
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
47
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
48
        for the relevant amendment or amendments;
19
    
49
 
20
        (3) Its onward transfer from a recipient to another
50
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
51
        party shall be deemed to be that party's acceptance of
22
        these conditions;
52
        these conditions;
23
    
53
 
24
        (4) DERA gives no warranty or assurance as to its
54
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
55
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
56
        no liability whatsoever in relation to any use to which
27
        it may be put.
57
        it may be put.
28
*/
58
*/
Line 61... Line 91...
61
#include "table.h"
91
#include "table.h"
62
 
92
 
63
/*--------------------------------------------------------------------------*/
93
/*--------------------------------------------------------------------------*/
64
 
94
 
65
static void
95
static void
66
c_check_grammar_1 PROTO_N ((entry, gclosure))
96
c_check_grammar_1(EntryP entry, GenericP gclosure)
67
		  PROTO_T (EntryP   entry X
-
 
68
			   GenericP gclosure)
-
 
69
{
97
{
70
    TypeP type;
98
    TypeP type;
71
 
99
 
72
    UNUSED (gclosure);
100
    UNUSED(gclosure);
73
    switch (entry_type (entry)) EXHAUSTIVE {
101
    switch (entry_type(entry))EXHAUSTIVE {
74
      case ET_RULE:
102
      case ET_RULE:
75
	break;
103
	break;
76
      case ET_BASIC: {
104
      case ET_BASIC: {
77
	  BasicP basic = entry_get_basic (entry);
105
	  BasicP basic = entry_get_basic(entry);
78
 
106
 
79
	  if ((!types_equal_zero_tuple (basic_result (basic))) &&
107
	  if ((!types_equal_zero_tuple(basic_result(basic))) &&
80
	      (basic_get_result_code (basic) == NIL (GenericP))) {
108
	      (basic_get_result_code(basic) == NIL(GenericP))) {
81
	      E_basic_result_code_not_defined (entry_key (entry));
109
	      E_basic_result_code_not_defined(entry_key(entry));
82
	  }
110
	  }
83
      }
111
      }
84
	break;
112
	break;
85
      case ET_ACTION:
113
      case ET_ACTION:
86
	if (action_get_code (entry_get_action (entry)) == NIL (GenericP)) {
114
	if (action_get_code(entry_get_action(entry)) == NIL(GenericP)) {
87
	    E_action_code_not_defined (entry_key (entry));
115
	    E_action_code_not_defined(entry_key(entry));
88
	}
116
	}
89
	break;
117
	break;
90
      case ET_TYPE:
118
      case ET_TYPE:
91
	type = entry_get_type (entry);
119
	type = entry_get_type(entry);
92
	if (((type_get_assign_code (type) != NIL (GenericP)) ||
120
	if (((type_get_assign_code(type) != NIL(GenericP)) ||
93
	     (type_get_param_assign_code (type) != NIL (GenericP)) ||
121
	     (type_get_param_assign_code(type) != NIL(GenericP)) ||
94
	     (type_get_result_assign_code (type) != NIL (GenericP))) &&
122
	     (type_get_result_assign_code(type) != NIL(GenericP))) &&
95
	    ((type_get_assign_code (type) == NIL (GenericP)) ||
123
	    ((type_get_assign_code(type) == NIL(GenericP)) ||
96
	     (type_get_param_assign_code (type) == NIL (GenericP)) ||
124
	     (type_get_param_assign_code(type) == NIL(GenericP)) ||
97
	     (type_get_result_assign_code (type) == NIL (GenericP)))) {
125
	     (type_get_result_assign_code(type) == NIL(GenericP)))) {
98
	    E_type_code_not_defined (entry_key (entry));
126
	    E_type_code_not_defined(entry_key(entry));
99
	}
127
	}
100
	break;
128
	break;
101
      case ET_NON_LOCAL:
129
      case ET_NON_LOCAL:
102
      case ET_NAME:
130
      case ET_NAME:
103
      case ET_RENAME:
131
      case ET_RENAME:
Line 108... Line 136...
108
}
136
}
109
 
137
 
110
/*--------------------------------------------------------------------------*/
138
/*--------------------------------------------------------------------------*/
111
 
139
 
112
void
140
void
113
c_check_grammar PROTO_N ((grammar))
141
c_check_grammar(GrammarP grammar)
114
		PROTO_T (GrammarP grammar)
-
 
115
{
142
{
116
    table_iter (grammar_table (grammar), c_check_grammar_1, NIL (GenericP));
143
    table_iter(grammar_table(grammar), c_check_grammar_1, NIL(GenericP));
117
}
144
}
118

145

119
/*
146
/*
120
 * Local variables(smf):
147
 * Local variables(smf):
121
 * eval: (include::add-path-entry "../os-interface" "../library")
148
 * eval: (include::add-path-entry "../os-interface" "../library")