/* * Copyright (c) 2002-2004, 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 * * 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/utilities/make_tdf/tdf.alg,v 1.2 2004/03/13 07:39:04 bp Exp $ */ /* * AUTOMATICALLY GENERATED FROM ALGEBRA tdf (VERSION 1.0) * BY calculus (VERSION 1.3) */ #ifndef CMD_OPS_H_INCLUDED #define CMD_OPS_H_INCLUDED /* Operations for union COMMAND */ #define TAG_cmd(P) (CHECK_NULL (P)->ag_tag) /* Operations for component line of union COMMAND */ #define cmd_line(P) (CHECK_NULL (P) + 1) /* Operations for field simple of union COMMAND */ #define cmd_simple_tag 0u #define IS_cmd_simple(P) (CHECK_NULL (P)->ag_tag == 0) #define cmd_simple_text(P) (CHECK_TAG ((P), 0) + 2) #define MAKE_cmd_simple(line_, text_, tdf_cmd)\ {\ tdf *x102_ = GEN_tdf ( 3, TYPEID_cmd );\ x102_->ag_tag = 0;\ COPY_int (x102_ + 1, (line_));\ COPY_string (x102_ + 2, (text_));\ (tdf_cmd) = x102_;\ } #define DECONS_cmd_simple(line_, text_, tdf_cmd)\ {\ tdf *x103_ = CHECK_TAG ((tdf_cmd), 0);\ (line_) = DEREF_int (x103_ + 1);\ (text_) = DEREF_string (x103_ + 2);\ } #define DESTROY_cmd_simple(destroyer_, line_, text_, tdf_cmd)\ {\ tdf *x104_ = CHECK_TAG ((tdf_cmd), 0);\ (line_) = DEREF_int (x104_ + 1);\ (text_) = DEREF_string (x104_ + 2);\ (destroyer_) (x104_, 3u);\ } /* Operations for field compound of union COMMAND */ #define cmd_compound_tag 1u #define IS_cmd_compound(P) (CHECK_NULL (P)->ag_tag == 1) #define cmd_compound_seq(P) (CHECK_TAG ((P), 1) + 2) #define MAKE_cmd_compound(line_, seq_, tdf_cmd)\ {\ tdf *x105_ = GEN_tdf ( 3, TYPEID_cmd );\ x105_->ag_tag = 1;\ COPY_int (x105_ + 1, (line_));\ COPY_list (x105_ + 2, (seq_));\ (tdf_cmd) = x105_;\ } #define DECONS_cmd_compound(line_, seq_, tdf_cmd)\ {\ tdf *x106_ = CHECK_TAG ((tdf_cmd), 1);\ (line_) = DEREF_int (x106_ + 1);\ (seq_) = DEREF_list (x106_ + 2);\ } #define DESTROY_cmd_compound(destroyer_, line_, seq_, tdf_cmd)\ {\ tdf *x107_ = CHECK_TAG ((tdf_cmd), 1);\ (line_) = DEREF_int (x107_ + 1);\ (seq_) = DEREF_list (x107_ + 2);\ (destroyer_) (x107_, 3u);\ } /* Operations for field loop of union COMMAND */ #define cmd_loop_tag 2u #define IS_cmd_loop(P) (CHECK_NULL (P)->ag_tag == 2) #define cmd_loop_control(P) (CHECK_TAG ((P), 2) + 2) #define cmd_loop_body(P) (CHECK_TAG ((P), 2) + 3) #define MAKE_cmd_loop(line_, control_, body_, tdf_cmd)\ {\ tdf *x108_ = GEN_tdf ( 4, TYPEID_cmd );\ x108_->ag_tag = 2;\ COPY_int (x108_ + 1, (line_));\ COPY_string (x108_ + 2, (control_));\ COPY_cmd (x108_ + 3, (body_));\ (tdf_cmd) = x108_;\ } #define DECONS_cmd_loop(line_, control_, body_, tdf_cmd)\ {\ tdf *x109_ = CHECK_TAG ((tdf_cmd), 2);\ (line_) = DEREF_int (x109_ + 1);\ (control_) = DEREF_string (x109_ + 2);\ (body_) = DEREF_cmd (x109_ + 3);\ } #define DESTROY_cmd_loop(destroyer_, line_, control_, body_, tdf_cmd)\ {\ tdf *x110_ = CHECK_TAG ((tdf_cmd), 2);\ (line_) = DEREF_int (x110_ + 1);\ (control_) = DEREF_string (x110_ + 2);\ (body_) = DEREF_cmd (x110_ + 3);\ (destroyer_) (x110_, 4u);\ } /* Operations for field cond of union COMMAND */ #define cmd_cond_tag 3u #define IS_cmd_cond(P) (CHECK_NULL (P)->ag_tag == 3) #define cmd_cond_control(P) (CHECK_TAG ((P), 3) + 2) #define cmd_cond_true_code(P) (CHECK_TAG ((P), 3) + 3) #define cmd_cond_false_code(P) (CHECK_TAG ((P), 3) + 4) #define MAKE_cmd_cond(line_, control_, true_code_, false_code_, tdf_cmd)\ {\ tdf *x111_ = GEN_tdf ( 5, TYPEID_cmd );\ x111_->ag_tag = 3;\ COPY_int (x111_ + 1, (line_));\ COPY_string (x111_ + 2, (control_));\ COPY_cmd (x111_ + 3, (true_code_));\ COPY_cmd (x111_ + 4, (false_code_));\ (tdf_cmd) = x111_;\ } #define DECONS_cmd_cond(line_, control_, true_code_, false_code_, tdf_cmd)\ {\ tdf *x112_ = CHECK_TAG ((tdf_cmd), 3);\ (line_) = DEREF_int (x112_ + 1);\ (control_) = DEREF_string (x112_ + 2);\ (true_code_) = DEREF_cmd (x112_ + 3);\ (false_code_) = DEREF_cmd (x112_ + 4);\ } #define DESTROY_cmd_cond(destroyer_, line_, control_, true_code_, false_code_, tdf_cmd)\ {\ tdf *x113_ = CHECK_TAG ((tdf_cmd), 3);\ (line_) = DEREF_int (x113_ + 1);\ (control_) = DEREF_string (x113_ + 2);\ (true_code_) = DEREF_cmd (x113_ + 3);\ (false_code_) = DEREF_cmd (x113_ + 4);\ (destroyer_) (x113_, 5u);\ } /* Operations for field use of union COMMAND */ #define cmd_use_tag 4u #define IS_cmd_use(P) (CHECK_NULL (P)->ag_tag == 4) #define cmd_use_sort(P) (CHECK_TAG ((P), 4) + 2) #define cmd_use_cons(P) (CHECK_TAG ((P), 4) + 3) #define MAKE_cmd_use(line_, sort_, cons_, tdf_cmd)\ {\ tdf *x114_ = GEN_tdf ( 4, TYPEID_cmd );\ x114_->ag_tag = 4;\ COPY_int (x114_ + 1, (line_));\ COPY_string (x114_ + 2, (sort_));\ COPY_string (x114_ + 3, (cons_));\ (tdf_cmd) = x114_;\ } #define DECONS_cmd_use(line_, sort_, cons_, tdf_cmd)\ {\ tdf *x115_ = CHECK_TAG ((tdf_cmd), 4);\ (line_) = DEREF_int (x115_ + 1);\ (sort_) = DEREF_string (x115_ + 2);\ (cons_) = DEREF_string (x115_ + 3);\ } #define DESTROY_cmd_use(destroyer_, line_, sort_, cons_, tdf_cmd)\ {\ tdf *x116_ = CHECK_TAG ((tdf_cmd), 4);\ (line_) = DEREF_int (x116_ + 1);\ (sort_) = DEREF_string (x116_ + 2);\ (cons_) = DEREF_string (x116_ + 3);\ (destroyer_) (x116_, 4u);\ } /* Operations for field special of union COMMAND */ #define cmd_special_tag 5u #define IS_cmd_special(P) (CHECK_NULL (P)->ag_tag == 5) #define cmd_special_sort(P) (CHECK_TAG ((P), 5) + 2) #define cmd_special_cons(P) (CHECK_TAG ((P), 5) + 3) #define MAKE_cmd_special(line_, sort_, cons_, tdf_cmd)\ {\ tdf *x117_ = GEN_tdf ( 4, TYPEID_cmd );\ x117_->ag_tag = 5;\ COPY_int (x117_ + 1, (line_));\ COPY_string (x117_ + 2, (sort_));\ COPY_string (x117_ + 3, (cons_));\ (tdf_cmd) = x117_;\ } #define DECONS_cmd_special(line_, sort_, cons_, tdf_cmd)\ {\ tdf *x118_ = CHECK_TAG ((tdf_cmd), 5);\ (line_) = DEREF_int (x118_ + 1);\ (sort_) = DEREF_string (x118_ + 2);\ (cons_) = DEREF_string (x118_ + 3);\ } #define DESTROY_cmd_special(destroyer_, line_, sort_, cons_, tdf_cmd)\ {\ tdf *x119_ = CHECK_TAG ((tdf_cmd), 5);\ (line_) = DEREF_int (x119_ + 1);\ (sort_) = DEREF_string (x119_ + 2);\ (cons_) = DEREF_string (x119_ + 3);\ (destroyer_) (x119_, 4u);\ } #endif