Subversion Repositories tendra.SVN

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
@special exp
32
@special tag
33
@special nat
34
@special bool
35
@special string
36
@special shape
37
@special variety
38
@special floating_variety
39
@special bitfield_variety
40
@special alignment
41
@special exp_list
42
@special exp_option
43
/* AUTOMATICALLY GENERATED BY %ZX VERSION %ZV FROM TDF %VA.%VB */
44
 
45
#define sub0( X )	( ( X )->son )
46
#define sub1( X )	( ( X )->son->bro )
47
#define sub2( X )	( ( X )->son->bro->bro )
48
#define sub3( X )	( ( X )->son->bro->bro->bro )
49
#define sub4( X )	( ( X )->son->bro->bro->bro->bro )
50
#define sub5( X )	( ( X )->son->bro->bro->bro->bro->bro )
51
#define sub6( X )	( ( X )->son->bro->bro->bro->bro->bro->bro )
52
#define sub7( X )	( ( X )->son->bro->bro->bro->bro->bro->bro->bro )
53
 
54
 
55
/*
56
    SET THE SHAPE OF AN EXPRESSION
57
 
58
    The shape of the expression exp is calculated and assigned.  Most of
59
    the work is done by the check routines above, as selected by an
60
    automatically generated switch statement.
61
*/
62
 
63
void check_exp_fn
64
    PROTO_N ( ( exp ) )
65
    PROTO_T ( node *exp )
66
{
67
    long m ;
68
    if ( exp == null ) return ;
69
    m = exp->cons->encoding ;
70
    if ( m == ENC_labelled ) {
71
	node *placelabs_intro = sub0 ( exp ) ;
72
	node *places = sub2 ( exp ) ;
73
	if ( placelabs_intro->cons->encoding != places->cons->encoding ) {
74
	    input_error ( "Labels don't match exps in labelled" ) ;
75
	}
76
    }
77
    if ( do_check ) {
78
	if ( exp->shape ) return ;
79
	checking = exp->cons->name ;
80
	switch ( m ) {
81
@loop sort
82
@if sort.eq.exp
83
@loop sort.cons
84
	    case ENC_%27CN : {
85
@loop cons.param
86
@if param.sort.special
87
		node *%PN = sub%PE ( exp ) ;
88
@else
89
@if param.sort.dummy
90
		%PSN parameter, %PN, messes things up!
91
@endif
92
@endif
93
@end
94
		CHECK_%25CN
95
		break ;
96
	    }
97
@end
98
@endif
99
@end
100
	}
101
	exp->shape = expand_fully ( exp->shape ) ;
102
    }
103
    return ;
104
}