/* * Copyright (c) 2003, The Tendra Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice unmodified, this list of conditions, and the following * disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * * Crown Copyright (c) 1997, 1998 * * This TenDRA(r) Computer Program is subject to Copyright * owned by the United Kingdom Secretary of State for Defence * acting through the Defence Evaluation and Research Agency * (DERA). It is made available to Recipients with a * royalty-free licence for its use, reproduction, transfer * to other parties and amendment for any purpose not excluding * product development provided that any such use et cetera * shall be deemed to be acceptance of the following conditions:- * * (1) Its Recipients shall ensure that this Notice is * reproduced upon any copies or amended versions of it; * * (2) Any amended version of it shall be clearly marked to * show both the nature of and the organisation responsible * for the relevant amendment or amendments; * * (3) Its onward transfer from a recipient to another * party shall be deemed to be that party's acceptance of * these conditions; * * (4) DERA gives no warranty or assurance as to its * quality or suitability for any purpose and DERA accepts * no liability whatsoever in relation to any use to which * it may be put. * * $TenDRA: tendra/src/producers/common/c_class.alg,v 1.18 2005/11/07 18:42:37 stefanf Exp $ */ /* * AUTOMATICALLY GENERATED FROM ALGEBRA c_class (VERSION 1.1) * BY calculus (VERSION 1.3) */ #ifndef OFF_OPS_H_INCLUDED #define OFF_OPS_H_INCLUDED /* Operations for union OFFSET */ #define TAG_off(P) (CHECK_NULL (P)->ag_tag) /* Operations for field zero of union OFFSET */ #define off_zero_tag 0u #define IS_off_zero(P) (CHECK_NULL (P)->ag_tag == 0) #define off_zero_type(P) (CHECK_TAG ((P), 0) + 1) #define MAKE_off_zero(type_, c_class_off)\ {\ c_class *x781_ = GEN_c_class ( 2, TYPEID_off );\ x781_->ag_tag = 0;\ COPY_type (x781_ + 1, (type_));\ (c_class_off) = x781_;\ } #define DECONS_off_zero(type_, c_class_off)\ {\ c_class *x782_ = CHECK_TAG ((c_class_off), 0);\ (type_) = DEREF_type (x782_ + 1);\ } #define DESTROY_off_zero(destroyer_, type_, c_class_off)\ {\ c_class *x783_ = CHECK_TAG ((c_class_off), 0);\ (type_) = DEREF_type (x783_ + 1);\ (destroyer_) (x783_, 2u);\ } /* Operations for field type of union OFFSET */ #define off_type_tag 1u #define IS_off_type(P) (CHECK_NULL (P)->ag_tag == 1) #define off_type_type(P) (CHECK_TAG ((P), 1) + 1) #define MAKE_off_type(type_, c_class_off)\ {\ c_class *x784_ = GEN_c_class ( 2, TYPEID_off );\ x784_->ag_tag = 1;\ COPY_type (x784_ + 1, (type_));\ (c_class_off) = x784_;\ } #define DECONS_off_type(type_, c_class_off)\ {\ c_class *x785_ = CHECK_TAG ((c_class_off), 1);\ (type_) = DEREF_type (x785_ + 1);\ } #define DESTROY_off_type(destroyer_, type_, c_class_off)\ {\ c_class *x786_ = CHECK_TAG ((c_class_off), 1);\ (type_) = DEREF_type (x786_ + 1);\ (destroyer_) (x786_, 2u);\ } /* Operations for field array of union OFFSET */ #define off_array_tag 2u #define IS_off_array(P) (CHECK_NULL (P)->ag_tag == 2) #define off_array_type(P) (CHECK_TAG ((P), 2) + 1) #define off_array_arg(P) (CHECK_TAG ((P), 2) + 2) #define MAKE_off_array(type_, arg_, c_class_off)\ {\ c_class *x787_ = GEN_c_class ( 3, TYPEID_off );\ x787_->ag_tag = 2;\ COPY_type (x787_ + 1, (type_));\ COPY_unsigned (x787_ + 2, (arg_));\ (c_class_off) = x787_;\ } #define DECONS_off_array(type_, arg_, c_class_off)\ {\ c_class *x788_ = CHECK_TAG ((c_class_off), 2);\ (type_) = DEREF_type (x788_ + 1);\ (arg_) = DEREF_unsigned (x788_ + 2);\ } #define DESTROY_off_array(destroyer_, type_, arg_, c_class_off)\ {\ c_class *x789_ = CHECK_TAG ((c_class_off), 2);\ (type_) = DEREF_type (x789_ + 1);\ (arg_) = DEREF_unsigned (x789_ + 2);\ (destroyer_) (x789_, 3u);\ } /* Operations for field extra of union OFFSET */ #define off_extra_tag 3u #define IS_off_extra(P) (CHECK_NULL (P)->ag_tag == 3) #define off_extra_type(P) (CHECK_TAG ((P), 3) + 1) #define off_extra_scale(P) (CHECK_TAG ((P), 3) + 2) #define MAKE_off_extra(type_, scale_, c_class_off)\ {\ c_class *x790_ = GEN_c_class ( 3, TYPEID_off );\ x790_->ag_tag = 3;\ COPY_type (x790_ + 1, (type_));\ COPY_int (x790_ + 2, (scale_));\ (c_class_off) = x790_;\ } #define DECONS_off_extra(type_, scale_, c_class_off)\ {\ c_class *x791_ = CHECK_TAG ((c_class_off), 3);\ (type_) = DEREF_type (x791_ + 1);\ (scale_) = DEREF_int (x791_ + 2);\ } #define DESTROY_off_extra(destroyer_, type_, scale_, c_class_off)\ {\ c_class *x792_ = CHECK_TAG ((c_class_off), 3);\ (type_) = DEREF_type (x792_ + 1);\ (scale_) = DEREF_int (x792_ + 2);\ (destroyer_) (x792_, 3u);\ } /* Operations for field base of union OFFSET */ #define off_base_tag 4u #define IS_off_base(P) (CHECK_NULL (P)->ag_tag == 4) #define off_base_graph(P) (CHECK_TAG ((P), 4) + 1) #define MAKE_off_base(graph_, c_class_off)\ {\ c_class *x793_ = GEN_c_class ( 2, TYPEID_off );\ x793_->ag_tag = 4;\ COPY_graph (x793_ + 1, (graph_));\ (c_class_off) = x793_;\ } #define DECONS_off_base(graph_, c_class_off)\ {\ c_class *x794_ = CHECK_TAG ((c_class_off), 4);\ (graph_) = DEREF_graph (x794_ + 1);\ } #define DESTROY_off_base(destroyer_, graph_, c_class_off)\ {\ c_class *x795_ = CHECK_TAG ((c_class_off), 4);\ (graph_) = DEREF_graph (x795_ + 1);\ (destroyer_) (x795_, 2u);\ } /* Operations for field deriv of union OFFSET */ #define off_deriv_tag 5u #define IS_off_deriv(P) (CHECK_NULL (P)->ag_tag == 5) #define off_deriv_graph(P) (CHECK_TAG ((P), 5) + 1) #define off_deriv_direct(P) (CHECK_TAG ((P), 5) + 2) #define off_deriv_indirect(P) (CHECK_TAG ((P), 5) + 3) #define MAKE_off_deriv(graph_, direct_, indirect_, c_class_off)\ {\ c_class *x796_ = GEN_c_class ( 4, TYPEID_off );\ x796_->ag_tag = 5;\ COPY_graph (x796_ + 1, (graph_));\ COPY_off (x796_ + 2, (direct_));\ COPY_off (x796_ + 3, (indirect_));\ (c_class_off) = x796_;\ } #define DECONS_off_deriv(graph_, direct_, indirect_, c_class_off)\ {\ c_class *x797_ = CHECK_TAG ((c_class_off), 5);\ (graph_) = DEREF_graph (x797_ + 1);\ (direct_) = DEREF_off (x797_ + 2);\ (indirect_) = DEREF_off (x797_ + 3);\ } #define DESTROY_off_deriv(destroyer_, graph_, direct_, indirect_, c_class_off)\ {\ c_class *x798_ = CHECK_TAG ((c_class_off), 5);\ (graph_) = DEREF_graph (x798_ + 1);\ (direct_) = DEREF_off (x798_ + 2);\ (indirect_) = DEREF_off (x798_ + 3);\ (destroyer_) (x798_, 4u);\ } /* Operations for field member of union OFFSET */ #define off_member_tag 6u #define IS_off_member(P) (CHECK_NULL (P)->ag_tag == 6) #define off_member_id(P) (CHECK_TAG ((P), 6) + 1) #define MAKE_off_member(id_, c_class_off)\ {\ c_class *x799_ = GEN_c_class ( 2, TYPEID_off );\ x799_->ag_tag = 6;\ COPY_id (x799_ + 1, (id_));\ (c_class_off) = x799_;\ } #define DECONS_off_member(id_, c_class_off)\ {\ c_class *x800_ = CHECK_TAG ((c_class_off), 6);\ (id_) = DEREF_id (x800_ + 1);\ } #define DESTROY_off_member(destroyer_, id_, c_class_off)\ {\ c_class *x801_ = CHECK_TAG ((c_class_off), 6);\ (id_) = DEREF_id (x801_ + 1);\ (destroyer_) (x801_, 2u);\ } /* Operations for field ptr_mem of union OFFSET */ #define off_ptr_mem_tag 7u #define IS_off_ptr_mem(P) (CHECK_NULL (P)->ag_tag == 7) #define off_ptr_mem_arg(P) (CHECK_TAG ((P), 7) + 1) #define MAKE_off_ptr_mem(arg_, c_class_off)\ {\ c_class *x802_ = GEN_c_class ( 2, TYPEID_off );\ x802_->ag_tag = 7;\ COPY_exp (x802_ + 1, (arg_));\ (c_class_off) = x802_;\ } #define DECONS_off_ptr_mem(arg_, c_class_off)\ {\ c_class *x803_ = CHECK_TAG ((c_class_off), 7);\ (arg_) = DEREF_exp (x803_ + 1);\ } #define DESTROY_off_ptr_mem(destroyer_, arg_, c_class_off)\ {\ c_class *x804_ = CHECK_TAG ((c_class_off), 7);\ (arg_) = DEREF_exp (x804_ + 1);\ (destroyer_) (x804_, 2u);\ } /* Operations for field negate of union OFFSET */ #define off_negate_tag 8u #define IS_off_negate(P) (CHECK_NULL (P)->ag_tag == 8) #define off_negate_arg(P) (CHECK_TAG ((P), 8) + 1) #define MAKE_off_negate(arg_, c_class_off)\ {\ c_class *x805_ = GEN_c_class ( 2, TYPEID_off );\ x805_->ag_tag = 8;\ COPY_off (x805_ + 1, (arg_));\ (c_class_off) = x805_;\ } #define DECONS_off_negate(arg_, c_class_off)\ {\ c_class *x806_ = CHECK_TAG ((c_class_off), 8);\ (arg_) = DEREF_off (x806_ + 1);\ } #define DESTROY_off_negate(destroyer_, arg_, c_class_off)\ {\ c_class *x807_ = CHECK_TAG ((c_class_off), 8);\ (arg_) = DEREF_off (x807_ + 1);\ (destroyer_) (x807_, 2u);\ } /* Operations for field plus of union OFFSET */ #define off_plus_tag 9u #define IS_off_plus(P) (CHECK_NULL (P)->ag_tag == 9) #define off_plus_arg1(P) (CHECK_TAG ((P), 9) + 1) #define off_plus_arg2(P) (CHECK_TAG ((P), 9) + 2) #define MAKE_off_plus(arg1_, arg2_, c_class_off)\ {\ c_class *x808_ = GEN_c_class ( 3, TYPEID_off );\ x808_->ag_tag = 9;\ COPY_off (x808_ + 1, (arg1_));\ COPY_off (x808_ + 2, (arg2_));\ (c_class_off) = x808_;\ } #define DECONS_off_plus(arg1_, arg2_, c_class_off)\ {\ c_class *x809_ = CHECK_TAG ((c_class_off), 9);\ (arg1_) = DEREF_off (x809_ + 1);\ (arg2_) = DEREF_off (x809_ + 2);\ } #define DESTROY_off_plus(destroyer_, arg1_, arg2_, c_class_off)\ {\ c_class *x810_ = CHECK_TAG ((c_class_off), 9);\ (arg1_) = DEREF_off (x810_ + 1);\ (arg2_) = DEREF_off (x810_ + 2);\ (destroyer_) (x810_, 3u);\ } /* Operations for field mult of union OFFSET */ #define off_mult_tag 10u #define IS_off_mult(P) (CHECK_NULL (P)->ag_tag == 10) #define off_mult_arg1(P) (CHECK_TAG ((P), 10) + 1) #define off_mult_arg2(P) (CHECK_TAG ((P), 10) + 2) #define MAKE_off_mult(arg1_, arg2_, c_class_off)\ {\ c_class *x811_ = GEN_c_class ( 3, TYPEID_off );\ x811_->ag_tag = 10;\ COPY_off (x811_ + 1, (arg1_));\ COPY_exp (x811_ + 2, (arg2_));\ (c_class_off) = x811_;\ } #define DECONS_off_mult(arg1_, arg2_, c_class_off)\ {\ c_class *x812_ = CHECK_TAG ((c_class_off), 10);\ (arg1_) = DEREF_off (x812_ + 1);\ (arg2_) = DEREF_exp (x812_ + 2);\ } #define DESTROY_off_mult(destroyer_, arg1_, arg2_, c_class_off)\ {\ c_class *x813_ = CHECK_TAG ((c_class_off), 10);\ (arg1_) = DEREF_off (x813_ + 1);\ (arg2_) = DEREF_exp (x813_ + 2);\ (destroyer_) (x813_, 3u);\ } /* Operations for field ptr_diff of union OFFSET */ #define off_ptr_diff_tag 11u #define IS_off_ptr_diff(P) (CHECK_NULL (P)->ag_tag == 11) #define off_ptr_diff_ptr1(P) (CHECK_TAG ((P), 11) + 1) #define off_ptr_diff_ptr2(P) (CHECK_TAG ((P), 11) + 2) #define MAKE_off_ptr_diff(ptr1_, ptr2_, c_class_off)\ {\ c_class *x814_ = GEN_c_class ( 3, TYPEID_off );\ x814_->ag_tag = 11;\ COPY_exp (x814_ + 1, (ptr1_));\ COPY_exp (x814_ + 2, (ptr2_));\ (c_class_off) = x814_;\ } #define DECONS_off_ptr_diff(ptr1_, ptr2_, c_class_off)\ {\ c_class *x815_ = CHECK_TAG ((c_class_off), 11);\ (ptr1_) = DEREF_exp (x815_ + 1);\ (ptr2_) = DEREF_exp (x815_ + 2);\ } #define DESTROY_off_ptr_diff(destroyer_, ptr1_, ptr2_, c_class_off)\ {\ c_class *x816_ = CHECK_TAG ((c_class_off), 11);\ (ptr1_) = DEREF_exp (x816_ + 1);\ (ptr2_) = DEREF_exp (x816_ + 2);\ (destroyer_) (x816_, 3u);\ } /* Operations for field token of union OFFSET */ #define off_token_tag 12u #define IS_off_token(P) (CHECK_NULL (P)->ag_tag == 12) #define off_token_tok(P) (CHECK_TAG ((P), 12) + 1) #define off_token_args(P) (CHECK_TAG ((P), 12) + 2) #define MAKE_off_token(tok_, args_, c_class_off)\ {\ c_class *x817_ = GEN_c_class ( 3, TYPEID_off );\ x817_->ag_tag = 12;\ COPY_id (x817_ + 1, (tok_));\ COPY_list (x817_ + 2, (args_));\ (c_class_off) = x817_;\ } #define DECONS_off_token(tok_, args_, c_class_off)\ {\ c_class *x818_ = CHECK_TAG ((c_class_off), 12);\ (tok_) = DEREF_id (x818_ + 1);\ (args_) = DEREF_list (x818_ + 2);\ } #define DESTROY_off_token(destroyer_, tok_, args_, c_class_off)\ {\ c_class *x819_ = CHECK_TAG ((c_class_off), 12);\ (tok_) = DEREF_id (x819_ + 1);\ (args_) = DEREF_list (x819_ + 2);\ (destroyer_) (x819_, 3u);\ } #endif