1/** 2 * \file 3 * \brief Header file for opcode definitions 4 * 5 */ 6/* 7 * Copyright (c) 2009, 2010, ETH Zurich. 8 * All rights reserved. 9 * 10 * This file is distributed under the terms in the attached LICENSE file. 11 * If you do not find this file, copies can be found by writing to: 12 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group. 13 */ 14 15#ifndef __OPDEFS_H__ 16#define __OPDEFS_H__ 17 18#ifndef DOXYGEN 19// exclude system headers from documentation 20 21#include <stdint.h> 22 23#endif // DOXYGEN 24 25#include <bfdmuxtools/filter.h> 26 27#define MAX_OPERATOR_STRING_LENGTH 9 /**< \brief Maximum length of an operator string in characters */ 28 29/** 30 * \brief Defines a type for operator definition entries 31 * \warning Operator strings cannot contain brackets! 32 */ 33typedef struct { 34 char opstr[MAX_OPERATOR_STRING_LENGTH]; 35 /**< \brief The string representing the operator */ 36 uint8_t opcode; 37 /**< \brief The binary opcode the operator maps to */ 38 uint8_t reserved_length; 39 /**< \brief The number of bytes that should be reserved for this operator. Usually this is exactly one byte. See c file for exceptions. */ 40 uint8_t arity; 41 /**< \brief Specifies if the operator expects left, right, or both sides to be operands. 0x10 for left-unary, 0x01 for right-unary, 0x11 for binary operators. */ 42} op_def_t; 43 44extern op_def_t op_list[]; 45 46#endif 47