Defines

lex.m File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define MAX_BIN_CONST_LEN   256
#define MAX_HEX_CONST_LEN   64
#define MAX_OCT_CONST_LEN   86
#define MAX_CHAR_CONST_LEN   1320
#define MAX_KWD_LEN   31
#define IS_BIN_DIGIT(CH)   ((((CH) - '0') >> 1) == 0)
#define IS_OCT_DIGIT(CH)   ((((CH) - '0') >> 3) == 0)
#define VALID_LA_CH
#define CHECK_FOR_FREE_BLANK
#define ADD_TO_TOKEN_KIND_STR(CH, LEN)
#define ADD_TO_TOKEN_STR(CH, LEN)
#define ADD_TO_CONST_BUF(CH, LEN)
#define OVERFLOW_MESSAGE(RESULT)
#define CONVERT_INT_CONST(TYPE, LEN, RESULT)
#define CONVERT_REAL_CONST(TYPE, LEN, RESULT)
#define CONVERT_DBL_CONST(TYPE, LEN, RESULT)

Define Documentation

#define ADD_TO_CONST_BUF (   CH,
  LEN 
)
Value:
if ((LEN) < MAX_CHAR_CONST_LEN) {                             \
                   const_buf[(LEN)] = (CH);                                   \
                }                                                             \
                (LEN)++

Definition at line 97 of file lex.m.

Referenced by get_operand_digit(), get_operand_dot(), get_operand_letter(), get_operand_quote(), and get_token().

#define ADD_TO_TOKEN_KIND_STR (   CH,
  LEN 
)
Value:
if ((LEN) < MAX_ID_LEN) {                                     \
                   TOKEN_KIND_STR(token)[(LEN)] = (CH);                       \
                }                                                             \
                (LEN)++

Definition at line 85 of file lex.m.

Referenced by get_operand_digit(), and get_operand_dot().

#define ADD_TO_TOKEN_STR (   CH,
  LEN 
)
#define CHECK_FOR_FREE_BLANK
Value:

Definition at line 79 of file lex.m.

#define CONVERT_DBL_CONST (   TYPE,
  LEN,
  RESULT 
)
Value:
{ double a_const;                                             \
                  const_buf[(LEN)] = '\0';                                    \
                  errno = 0;                                                  \
                  a_const = atof(const_buf);                                  \
                  if (errno == 0) {                                           \
                    TOKEN_CONST_TBL_IDX(token) = ntr_const_tbl(TYPE,          \
                                                FALSE, (long_type *)&a_const);\
                  } else {                                                    \
                    OVERFLOW_MESSAGE(RESULT);                                 \
                  }                                                           \
                }

Definition at line 424 of file lex.m.

Referenced by convert_const(), cvrt_str_to_cn(), get_operand_digit(), and get_operand_dot().

#define CONVERT_INT_CONST (   TYPE,
  LEN,
  RESULT 
)
Value:
{ long_type     a_const;                                      \
                  const_buf[(LEN)] = '\0';                                    \
                  errno = 0;                                                  \
                  a_const = LEX_STRTOL(const_buf, (char **) NULL, 10);        \
                  if (errno == 0) {                                           \
                     TOKEN_CONST_TBL_IDX(token) = ntr_const_tbl(TYPE,         \
                                                            FALSE, &a_const); \
                  } else {                                                    \
                    OVERFLOW_MESSAGE(RESULT);                                 \
                  }                                                           \
                }

Definition at line 398 of file lex.m.

Referenced by convert_const(), cvrt_str_to_cn(), and get_token().

#define CONVERT_REAL_CONST (   TYPE,
  LEN,
  RESULT 
)
Value:
{ float a_const;                                              \
                  const_buf[(LEN)] = '\0';                                    \
                  errno = 0;                                                  \
                  a_const = (float)atof(const_buf);                           \
                  if (errno == 0) {                                           \
                    TOKEN_CONST_TBL_IDX(token) = ntr_const_tbl(TYPE,          \
                                                FALSE, (long_type *)&a_const);\
                  } else {                                                    \
                    OVERFLOW_MESSAGE(RESULT);                                 \
                  }                                                           \
                }

Definition at line 411 of file lex.m.

Referenced by convert_const(), cvrt_str_to_cn(), get_operand_digit(), and get_operand_dot().

#define IS_BIN_DIGIT (   CH  )     ((((CH) - '0') >> 1) == 0)

Definition at line 63 of file lex.m.

Referenced by get_operand_letter().

#define IS_OCT_DIGIT (   CH  )     ((((CH) - '0') >> 3) == 0)

Definition at line 64 of file lex.m.

Referenced by get_operand_digit(), get_operand_letter(), and get_operand_quote().

#define MAX_BIN_CONST_LEN   256

Definition at line 47 of file lex.m.

Referenced by get_operand_letter().

#define MAX_CHAR_CONST_LEN   1320

Definition at line 51 of file lex.m.

#define MAX_HEX_CONST_LEN   64

Definition at line 48 of file lex.m.

Referenced by get_operand_letter(), and get_operand_quote().

#define MAX_KWD_LEN   31
#define MAX_OCT_CONST_LEN   86

Definition at line 49 of file lex.m.

Referenced by get_operand_digit(), get_operand_letter(), and get_operand_quote().

#define OVERFLOW_MESSAGE (   RESULT  ) 
Value:

Definition at line 107 of file lex.m.

#define VALID_LA_CH