osprey/kg++fe/gnu/cppexp.c File Reference

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

Include dependency graph for cppexp.c:

Go to the source code of this file.

Data Types

type  op
type  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   (CPP_LAST_CPP_OP + 1)
#define CPP_UMINUS   (CPP_LAST_CPP_OP + 2)
#define SYNTAX_ERROR(msgid)   do { cpp_error (pfile, DL_ERROR, msgid); goto syntax_error; } while(0)
#define SYNTAX_ERROR2(msgid, arg)   do { cpp_error (pfile, DL_ERROR, msgid, arg); goto syntax_error; } while(0)
#define NO_L_OPERAND   (1 << 0)
#define LEFT_ASSOC   (1 << 1)
#define CHECK_PROMOTION   (1 << 2)

Functions/Subroutines

static bool num_positive PARAMS ((cpp_num, size_t))
static bool num_greater_eq PARAMS ((cpp_num, cpp_num, size_t))
static cpp_num num_part_mul PARAMS ((cpp_num_part, cpp_num_part))
static cpp_num num_unary_op PARAMS ((cpp_reader *, cpp_num, enum cpp_ttype))
static cpp_num num_binary_op PARAMS ((cpp_reader *, cpp_num, cpp_num, enum cpp_ttype))
static cpp_num num_mul PARAMS ((cpp_reader *, cpp_num, cpp_num))
static cpp_num num_lshift PARAMS ((cpp_num, size_t, size_t))
static cpp_num append_digit PARAMS ((cpp_num, int, int, size_t))
static cpp_num parse_defined PARAMS ((cpp_reader *))
static cpp_num eval_token PARAMS ((cpp_reader *, const cpp_token *))
static struct op *reduce PARAMS ((cpp_reader *, struct op *, enum cpp_ttype))
static unsigned int
interpret_float_suffix 
PARAMS ((const uchar *, size_t))
static void check_promotion PARAMS ((cpp_reader *, const struct op *))
static unsigned int interpret_float_suffix (uchar *s, size_t len) const
static unsigned int interpret_int_suffix (uchar *s, size_t len) const
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)
static cpp_num append_digit (cpp_num num, int digit, int base, size_t precision)
static cpp_num parse_defined (cpp_reader *pfile)
static cpp_num eval_token (cpp_reader *pfile, const cpp_token *token)
bool _cpp_parse_expr (cpp_reader *pfile)
static struct opreduce (cpp_reader *pfile, struct op *top, enum cpp_ttype op)
struct op_cpp_expand_op_stack (cpp_reader *pfile)
static void check_promotion (cpp_reader *pfile, const struct op *op)
static cpp_num num_trim (cpp_num num, size_t precision)
static bool num_positive (cpp_num num, size_t precision)
cpp_num cpp_num_sign_extend (cpp_num num, size_t precision)
static cpp_num num_negate (cpp_num num, size_t precision)
static bool num_greater_eq (cpp_num pa, cpp_num pb, size_t precision)
static cpp_num num_bitwise_op (pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op)
static cpp_num num_inequality_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op)
static cpp_num num_equality_op (pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op)
static cpp_num num_rshift (cpp_num num, size_t precision, size_t n)
static cpp_num num_lshift (cpp_num num, size_t precision, size_t n)
static cpp_num num_unary_op (cpp_reader *pfile, cpp_num num, enum cpp_ttype op)
static cpp_num num_binary_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op)
static cpp_num num_part_mul (cpp_num_part lhs, cpp_num_part rhs)
static cpp_num num_mul (cpp_reader *pfile, cpp_num lhs, cpp_num rhs)
static cpp_num num_div_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op)

Variables

static struct operator optab []


Define Documentation

#define CHECK_PROMOTION   (1 << 2)

Definition at line 654 of file cppexp.c.

Referenced by reduce().

#define CPP_UMINUS   (CPP_LAST_CPP_OP + 2)

Definition at line 80 of file cppexp.c.

Referenced by _cpp_parse_expr(), num_unary_op(), and reduce().

#define CPP_UPLUS   (CPP_LAST_CPP_OP + 1)

Definition at line 79 of file cppexp.c.

Referenced by _cpp_parse_expr(), num_unary_op(), and reduce().

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

Definition at line 35 of file cppexp.c.

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

Definition at line 37 of file cppexp.c.

Referenced by num_part_mul().

#define LEFT_ASSOC   (1 << 1)

Definition at line 653 of file cppexp.c.

Referenced by reduce().

#define LOW_PART ( num_part   )     (num_part & HALF_MASK)

Definition at line 36 of file cppexp.c.

Referenced by num_part_mul().

#define NO_L_OPERAND   (1 << 0)

Definition at line 652 of file cppexp.c.

Referenced by _cpp_parse_expr().

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

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

Definition at line 47 of file cppexp.c.

Referenced by _cpp_parse_expr(), num_lshift(), num_mul(), num_negate(), num_unary_op(), and reduce().

#define PART_PRECISION   (sizeof (cpp_num_part) * CHAR_BIT)

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

Definition at line 84 of file cppexp.c.

Referenced by _cpp_parse_expr(), cpp_classify_number(), and rs6000_pragma_longcall().

#define SYNTAX_ERROR2 ( msgid,
arg   )     do { cpp_error (pfile, DL_ERROR, msgid, arg); goto syntax_error; } while(0)

Definition at line 86 of file cppexp.c.

Referenced by _cpp_parse_expr(), and cpp_classify_number().


Function Documentation

struct op* _cpp_expand_op_stack ( cpp_reader pfile  )  [read]

Definition at line 1007 of file cppexp.c.

Referenced by _cpp_parse_expr().

bool _cpp_parse_expr ( cpp_reader pfile  ) 

Definition at line 711 of file cppexp.c.

Referenced by do_elif(), and do_if().

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 
)

Definition at line 158 of file cppexp.c.

Referenced by c_lex(), c_lex_with_flags(), and eval_token().

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

Definition at line 325 of file cppexp.c.

Referenced by eval_token(), and interpret_integer().

cpp_num cpp_num_sign_extend ( cpp_num  num,
size_t  precision 
)

Definition at line 1083 of file cppexp.c.

Referenced by interpret_integer().

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

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

Definition at line 93 of file cppexp.c.

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

Referenced by cpp_classify_number().

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

Definition at line 122 of file cppexp.c.

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

Referenced by cpp_classify_number().

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 ( pfile  ,
cpp_num  lhs,
cpp_num  rhs,
enum cpp_ttype  op 
) [static]

Definition at line 1153 of file cppexp.c.

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

Referenced by reduce().

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 ( pfile  ,
cpp_num  lhs,
cpp_num  rhs,
enum cpp_ttype  op 
) [static]

Definition at line 1208 of file cppexp.c.

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

Referenced by reduce().

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

Definition at line 1128 of file cppexp.c.

References num_positive().

Referenced by num_binary_op(), num_div_op(), and num_inequality_op().

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

Definition at line 1184 of file cppexp.c.

References CPP_OPTION, cpp_num::high, cpp_num::low, num_eq, num_greater_eq(), cpp_num::overflow, and cpp_num::unsignedp.

Referenced by reduce().

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

Definition at line 1268 of file cppexp.c.

References num_eq, num_rshift(), num_trim(), num_zerop, and PART_PRECISION.

Referenced by num_binary_op(), and num_div_op().

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]

Definition at line 1109 of file cppexp.c.

References copy, cpp_num::high, num_eq, num_trim(), and num_zerop.

Referenced by num_binary_op(), num_div_op(), num_mul(), and num_unary_op().

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

Definition at line 1433 of file cppexp.c.

References cpp_num::high, HIGH_PART, cpp_num::low, LOW_PART, PART_PRECISION, result, and cpp_num::unsignedp.

Referenced by num_mul().

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

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

Definition at line 1226 of file cppexp.c.

References num_positive(), num_trim(), and PART_PRECISION.

Referenced by num_binary_op(), and num_lshift().

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

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

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

static unsigned int interpret_float_suffix PARAMS ( (const uchar *, size_t  )  [static]

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

static cpp_num eval_token PARAMS ( (cpp_reader *, const cpp_token *)   )  [static]

static cpp_num parse_defined PARAMS ( (cpp_reader *)   )  [static]

static cpp_num append_digit PARAMS ( (cpp_num, int, int, size_t  )  [static]

static cpp_num num_lshift PARAMS ( (cpp_num, size_t, size_t  )  [static]

static cpp_num num_mul PARAMS ( (cpp_reader *, cpp_num, cpp_num  )  [static]

static cpp_num num_binary_op PARAMS ( (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype  )  [static]

static cpp_num num_unary_op PARAMS ( (cpp_reader *, cpp_num, enum cpp_ttype  )  [static]

static cpp_num num_part_mul PARAMS ( (cpp_num_part, cpp_num_part  )  [static]

static bool num_greater_eq PARAMS ( (cpp_num, cpp_num, size_t  )  [static]

static bool num_positive PARAMS ( (cpp_num, size_t  )  [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

struct operator optab[] [static]


Generated on Wed Apr 8 15:30:05 2009 for Open64 by  doxygen 1.5.6