osprey-gcc-4.2.0/libcpp/expr.c File Reference

#include "config.h"
#include "system.h"
#include "cpplib.h"
#include "internal.h"

Include dependency graph for expr.c:

Go to the source code of this file.

Data Types

type  op
type  cpp_operator

Defines

#define PART_PRECISION   (sizeof (cpp_num_part) * CHAR_BIT)
#define HALF_MASK   (~(cpp_num_part) 0 >> (PART_PRECISION / 2))
#define LOW_PART(num_part)   (num_part & HALF_MASK)
#define HIGH_PART(num_part)   (num_part >> (PART_PRECISION / 2))
#define num_zerop(num)   ((num.low | num.high) == 0)
#define num_eq(num1, num2)   (num1.low == num2.low && num1.high == num2.high)
#define CPP_UPLUS   ((enum cpp_ttype) (CPP_LAST_CPP_OP + 1))
#define CPP_UMINUS   ((enum cpp_ttype) (CPP_LAST_CPP_OP + 2))
#define SYNTAX_ERROR(msgid)   do { cpp_error (pfile, CPP_DL_ERROR, msgid); goto syntax_error; } while(0)
#define SYNTAX_ERROR2(msgid, arg)
#define NO_L_OPERAND   (1 << 0)
#define LEFT_ASSOC   (1 << 1)
#define CHECK_PROMOTION   (1 << 2)

Functions/Subroutines

static bool num_positive (cpp_num, size_t)
static bool num_greater_eq (cpp_num, cpp_num, size_t)
static cpp_num num_trim (cpp_num, size_t)
static cpp_num num_part_mul (cpp_num_part, cpp_num_part)
static cpp_num num_unary_op (cpp_reader *, cpp_num, enum cpp_ttype)
static cpp_num num_binary_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype)
static cpp_num num_negate (cpp_num, size_t)
static cpp_num num_bitwise_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype)
static cpp_num num_inequality_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype)
static cpp_num num_equality_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype)
static cpp_num num_mul (cpp_reader *, cpp_num, cpp_num)
static cpp_num num_div_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype)
static cpp_num num_lshift (cpp_num, size_t, size_t)
static cpp_num num_rshift (cpp_num, size_t, size_t)
static cpp_num append_digit (cpp_num, int, int, size_t)
static cpp_num parse_defined (cpp_reader *)
static cpp_num eval_token (cpp_reader *, const cpp_token *)
static struct opreduce (cpp_reader *, struct op *, enum cpp_ttype)
static unsigned int interpret_float_suffix (const uchar *, size_t)
static unsigned int interpret_int_suffix (const uchar *, size_t)
static void check_promotion (cpp_reader *, const struct op *)
unsigned int cpp_classify_number (cpp_reader *pfile, const cpp_token *token)
cpp_num cpp_interpret_integer (cpp_reader *pfile, const cpp_token *token, unsigned int type)
bool _cpp_parse_expr (cpp_reader *pfile)
struct op_cpp_expand_op_stack (cpp_reader *pfile)
cpp_num cpp_num_sign_extend (cpp_num num, size_t precision)
static cpp_num num_bitwise_op (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_num lhs, cpp_num rhs, enum cpp_ttype op)
static cpp_num num_equality_op (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_num lhs, cpp_num rhs, enum cpp_ttype op)

Variables

static struct cpp_operator optab []


Define Documentation

#define CHECK_PROMOTION   (1 << 2)

Definition at line 646 of file expr.c.

#define CPP_UMINUS   ((enum cpp_ttype) (CPP_LAST_CPP_OP + 2))

Definition at line 69 of file expr.c.

#define CPP_UPLUS   ((enum cpp_ttype) (CPP_LAST_CPP_OP + 1))

Definition at line 68 of file expr.c.

#define HALF_MASK   (~(cpp_num_part) 0 >> (PART_PRECISION / 2))

Definition at line 27 of file expr.c.

#define HIGH_PART ( num_part   )     (num_part >> (PART_PRECISION / 2))

Definition at line 29 of file expr.c.

#define LEFT_ASSOC   (1 << 1)

Definition at line 645 of file expr.c.

#define LOW_PART ( num_part   )     (num_part & HALF_MASK)

Definition at line 28 of file expr.c.

#define NO_L_OPERAND   (1 << 0)

Definition at line 644 of file expr.c.

#define num_eq ( num1,
num2   )     (num1.low == num2.low && num1.high == num2.high)

Definition at line 40 of file expr.c.

#define num_zerop ( num   )     ((num.low | num.high) == 0)

Definition at line 39 of file expr.c.

#define PART_PRECISION   (sizeof (cpp_num_part) * CHAR_BIT)

Definition at line 26 of file expr.c.

#define SYNTAX_ERROR ( msgid   )     do { cpp_error (pfile, CPP_DL_ERROR, msgid); goto syntax_error; } while(0)

Definition at line 73 of file expr.c.

#define SYNTAX_ERROR2 ( msgid,
arg   ) 

Value:

do { cpp_error (pfile, CPP_DL_ERROR, msgid, arg); goto syntax_error; } \
  while(0)

Definition at line 75 of file expr.c.


Function Documentation

struct op* _cpp_expand_op_stack ( cpp_reader pfile  )  [read]

Definition at line 988 of file expr.c.

References cpp_reader::op_limit, cpp_reader::op_stack, size_t, xrealloc(), and XRESIZEVEC.

bool _cpp_parse_expr ( cpp_reader pfile  ) 

static cpp_num append_digit ( cpp_num  num,
int  digit,
int  base,
size_t  precision 
) [static]

static void check_promotion ( cpp_reader pfile,
const struct op op 
) [static]

unsigned int cpp_classify_number ( cpp_reader pfile,
const cpp_token token 
)

cpp_num cpp_interpret_integer ( cpp_reader pfile,
const cpp_token token,
unsigned int  type 
)

cpp_num cpp_num_sign_extend ( cpp_num  num,
size_t  precision 
)

Definition at line 1056 of file expr.c.

References cpp_num::high, cpp_num::low, PART_PRECISION, and cpp_num::unsignedp.

static cpp_num eval_token ( cpp_reader pfile,
const cpp_token token 
) [static]

static unsigned int interpret_float_suffix ( const uchar s,
size_t  len 
) [static]

Definition at line 83 of file expr.c.

References CPP_N_DFLOAT, CPP_N_IMAGINARY, CPP_N_LARGE, CPP_N_MEDIUM, CPP_N_SMALL, d, f, and i.

static unsigned int interpret_int_suffix ( const uchar s,
size_t  len 
) [static]

Definition at line 121 of file expr.c.

References CPP_N_IMAGINARY, CPP_N_LARGE, CPP_N_MEDIUM, CPP_N_SMALL, CPP_N_UNSIGNED, and i.

static cpp_num num_binary_op ( cpp_reader pfile,
cpp_num  lhs,
cpp_num  rhs,
enum cpp_ttype  op 
) [static]

static cpp_num num_bitwise_op ( cpp_reader *pfile  ATTRIBUTE_UNUSED,
cpp_num  lhs,
cpp_num  rhs,
enum cpp_ttype  op 
) [static]

Definition at line 1120 of file expr.c.

References cpp_num::high, cpp_num::low, cpp_num::overflow, and cpp_num::unsignedp.

static cpp_num num_bitwise_op ( cpp_reader ,
cpp_num  ,
cpp_num  ,
enum  cpp_ttype 
) [static]

static cpp_num num_div_op ( cpp_reader pfile,
cpp_num  lhs,
cpp_num  rhs,
enum cpp_ttype  op 
) [static]

static cpp_num num_equality_op ( cpp_reader *pfile  ATTRIBUTE_UNUSED,
cpp_num  lhs,
cpp_num  rhs,
enum cpp_ttype  op 
) [static]

Definition at line 1171 of file expr.c.

References eq, cpp_num::high, cpp_num::low, num_eq, cpp_num::overflow, and cpp_num::unsignedp.

static cpp_num num_equality_op ( cpp_reader ,
cpp_num  ,
cpp_num  ,
enum  cpp_ttype 
) [static]

static bool num_greater_eq ( cpp_num  pa,
cpp_num  pb,
size_t  precision 
) [static]

Definition at line 1097 of file expr.c.

References cpp_num::high, cpp_num::low, num_positive(), and cpp_num::unsignedp.

static cpp_num num_inequality_op ( cpp_reader pfile,
cpp_num  lhs,
cpp_num  rhs,
enum cpp_ttype  op 
) [static]

static cpp_num num_lshift ( cpp_num  num,
size_t  precision,
size_t  n 
) [static]

static cpp_num num_mul ( cpp_reader pfile,
cpp_num  lhs,
cpp_num  rhs 
) [static]

static cpp_num num_negate ( cpp_num  num,
size_t  precision 
) [static]

static cpp_num num_part_mul ( cpp_num_part  lhs,
cpp_num_part  rhs 
) [static]

static bool num_positive ( cpp_num  num,
size_t  precision 
) [static]

Definition at line 1042 of file expr.c.

References cpp_num::high, cpp_num::low, and PART_PRECISION.

static cpp_num num_rshift ( cpp_num  num,
size_t  precision,
size_t  n 
) [static]

static cpp_num num_trim ( cpp_num  num,
size_t  precision 
) [static]

Definition at line 1022 of file expr.c.

References cpp_num::high, cpp_num::low, and PART_PRECISION.

static cpp_num num_unary_op ( cpp_reader pfile,
cpp_num  num,
enum cpp_ttype  op 
) [static]

static cpp_num parse_defined ( cpp_reader pfile  )  [static]

static struct op * reduce ( cpp_reader pfile,
struct op top,
enum cpp_ttype  op 
) [static, read]


Variable Documentation


Generated on Wed Apr 8 15:29:19 2009 for Open64 by  doxygen 1.5.6