All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
token.h File Reference

Tokenisation code and constants. More...

Go to the source code of this file.

Data Structures

struct  FR_NAME_NUMBER
 

Macros

#define T_EQEND   (T_OP_CMP_EQ + 1)
 
#define T_EQSTART   T_OP_ADD
 

Typedefs

typedef struct FR_NAME_NUMBER FR_NAME_NUMBER
 
typedef enum fr_token FR_TOKEN
 

Enumerations

enum  fr_token {
  T_INVALID = 0,
  T_EOL,
  T_LCBRACE,
  T_RCBRACE,
  T_LBRACE,
  T_RBRACE,
  T_COMMA,
  T_SEMICOLON,
  T_OP_INCRM,
  T_OP_ADD,
  T_OP_SUB,
  T_OP_SET,
  T_OP_EQ,
  T_OP_NE,
  T_OP_GE,
  T_OP_GT,
  T_OP_LE,
  T_OP_LT,
  T_OP_REG_EQ,
  T_OP_REG_NE,
  T_OP_CMP_TRUE,
  T_OP_CMP_FALSE,
  T_OP_CMP_EQ,
  T_HASH,
  T_BARE_WORD,
  T_DOUBLE_QUOTED_STRING,
  T_SINGLE_QUOTED_STRING,
  T_BACK_QUOTED_STRING,
  T_TOKEN_LAST
}
 

Functions

char const * fr_int2str (FR_NAME_NUMBER const *table, int number, char const *def)
 
int fr_str2int (FR_NAME_NUMBER const *table, char const *name, int def)
 
int fr_substr2int (FR_NAME_NUMBER const *table, char const *name, int def, int len)
 
char const * fr_token_name (int)
 
FR_TOKEN getop (char const **ptr)
 
FR_TOKEN getstring (char const **ptr, char *buf, int buflen, bool unescape)
 
FR_TOKEN gettoken (char const **ptr, char *buf, int buflen, bool unescape)
 
int getword (char const **ptr, char *buf, int buflen, bool unescape)
 

Variables

const bool fr_assignment_op []
 
const bool fr_equality_op []
 
const bool fr_str_tok []
 
const char fr_token_quote []
 Convert tokens back to a quoting character. More...
 
const char * fr_tokens []
 
const FR_NAME_NUMBER fr_tokens_table []
 

Detailed Description

Tokenisation code and constants.

Id:
3352d6764506bf1b2e2b9a3df2f64b656ed69f00

Definition in file token.h.


Data Structure Documentation

struct FR_NAME_NUMBER

Definition at line 68 of file token.h.

Data Fields
char const * name
int number

Macro Definition Documentation

#define T_EQEND   (T_OP_CMP_EQ + 1)

Definition at line 66 of file token.h.

#define T_EQSTART   T_OP_ADD

Definition at line 65 of file token.h.

Typedef Documentation

typedef enum fr_token FR_TOKEN

Enumeration Type Documentation

enum fr_token
Enumerator
T_INVALID 
T_EOL 
T_LCBRACE 
T_RCBRACE 
T_LBRACE 
T_RBRACE 
T_COMMA 
T_SEMICOLON 
T_OP_INCRM 
T_OP_ADD 
T_OP_SUB 
T_OP_SET 
T_OP_EQ 
T_OP_NE 
T_OP_GE 
T_OP_GT 
T_OP_LE 
T_OP_LT 
T_OP_REG_EQ 
T_OP_REG_NE 
T_OP_CMP_TRUE 
T_OP_CMP_FALSE 
T_OP_CMP_EQ 
T_HASH 
T_BARE_WORD 
T_DOUBLE_QUOTED_STRING 
T_SINGLE_QUOTED_STRING 
T_BACK_QUOTED_STRING 
T_TOKEN_LAST 

Definition at line 32 of file token.h.

Function Documentation

char const* fr_int2str ( FR_NAME_NUMBER const *  table,
int  number,
char const *  def 
)

Definition at line 506 of file token.c.

+ Here is the caller graph for this function:

int fr_str2int ( FR_NAME_NUMBER const *  table,
char const *  name,
int  def 
)

Definition at line 451 of file token.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int fr_substr2int ( FR_NAME_NUMBER const *  table,
char const *  name,
int  def,
int  len 
)

Definition at line 471 of file token.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char const* fr_token_name ( int  )

Definition at line 520 of file token.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

FR_TOKEN getop ( char const **  ptr)

Definition at line 413 of file token.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

FR_TOKEN getstring ( char const **  ptr,
char *  buf,
int  buflen,
bool  unescape 
)

Definition at line 429 of file token.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

FR_TOKEN gettoken ( char const **  ptr,
char *  buf,
int  buflen,
bool  unescape 
)

Definition at line 405 of file token.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int getword ( char const **  ptr,
char *  buf,
int  buflen,
bool  unescape 
)

Definition at line 396 of file token.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

const bool fr_assignment_op[]

Definition at line 129 of file token.c.

const bool fr_equality_op[]

Definition at line 162 of file token.c.

const bool fr_str_tok[]

Definition at line 195 of file token.c.

const char fr_token_quote[]

Convert tokens back to a quoting character.

None string types convert to '?' to screw ups can be identified easily

Definition at line 96 of file token.c.

const char* fr_tokens[]

Definition at line 60 of file token.c.

const FR_NAME_NUMBER fr_tokens_table[]

Definition at line 30 of file token.c.