Ruby  2.5.0dev(2017-10-22revision60238)
Data Structures | Macros | Functions
cparse.c File Reference
#include "ruby/ruby.h"

Go to the source code of this file.

Data Structures

struct  cparse_params
 

Macros

#define FALSE   0
 
#define TRUE   1
 
#define RACC_VERSION   "1.4.5"
 
#define DEFAULT_TOKEN   -1
 
#define ERROR_TOKEN   1
 
#define FINAL_TOKEN   0
 
#define vDEFAULT_TOKEN   INT2FIX(DEFAULT_TOKEN)
 
#define vERROR_TOKEN   INT2FIX(ERROR_TOKEN)
 
#define vFINAL_TOKEN   INT2FIX(FINAL_TOKEN)
 
#define AREF(s, idx)   ((0 <= idx && idx < RARRAY_LEN(s)) ? rb_ary_entry(s, idx) : Qnil)
 
#define STACK_INIT_LEN   64
 
#define NEW_STACK()   rb_ary_new2(STACK_INIT_LEN)
 
#define PUSH(s, i)   rb_ary_store(s, RARRAY_LEN(s), i)
 
#define POP(s)   rb_ary_pop(s)
 
#define LAST_I(s)   ((RARRAY_LEN(s) > 0) ? rb_ary_entry(s, RARRAY_LEN(s) - 1) : Qnil)
 
#define GET_TAIL(s, len)   get_stack_tail(s, len)
 
#define CUT_TAIL(s, len)   cut_stack_tail(s, len)
 
#define CP_FIN_ACCEPT   1
 
#define CP_FIN_EOT   2
 
#define CP_FIN_CANTPOP   3
 
#define D_puts(msg)
 
#define D_printf(fmt, arg)
 
#define RUBY_UNTYPED_DATA_WARNING   1
 
#define SHIFT(v, act, tok, val)   shift(v,act,tok,val)
 
#define REDUCE(v, act)
 
#define rb_intern(str)   rb_intern_const(str)
 

Functions

void Init_cparse (void)
 

Macro Definition Documentation

◆ AREF

#define AREF (   s,
  idx 
)    ((0 <= idx && idx < RARRAY_LEN(s)) ? rb_ary_entry(s, idx) : Qnil)

Definition at line 93 of file cparse.c.

◆ CP_FIN_ACCEPT

#define CP_FIN_ACCEPT   1

Definition at line 176 of file cparse.c.

◆ CP_FIN_CANTPOP

#define CP_FIN_CANTPOP   3

Definition at line 178 of file cparse.c.

◆ CP_FIN_EOT

#define CP_FIN_EOT   2

Definition at line 177 of file cparse.c.

◆ CUT_TAIL

#define CUT_TAIL (   s,
  len 
)    cut_stack_tail(s, len)

Definition at line 127 of file cparse.c.

◆ D_printf

#define D_printf (   fmt,
  arg 
)

Definition at line 218 of file cparse.c.

◆ D_puts

#define D_puts (   msg)

Definition at line 217 of file cparse.c.

◆ DEFAULT_TOKEN

#define DEFAULT_TOKEN   -1

Definition at line 29 of file cparse.c.

◆ ERROR_TOKEN

#define ERROR_TOKEN   1

Definition at line 30 of file cparse.c.

◆ FALSE

#define FALSE   0

Definition at line 17 of file cparse.c.

◆ FINAL_TOKEN

#define FINAL_TOKEN   0

Definition at line 31 of file cparse.c.

◆ GET_TAIL

#define GET_TAIL (   s,
  len 
)    get_stack_tail(s, len)

Definition at line 126 of file cparse.c.

◆ LAST_I

#define LAST_I (   s)    ((RARRAY_LEN(s) > 0) ? rb_ary_entry(s, RARRAY_LEN(s) - 1) : Qnil)

Definition at line 124 of file cparse.c.

◆ NEW_STACK

#define NEW_STACK ( )    rb_ary_new2(STACK_INIT_LEN)

Definition at line 121 of file cparse.c.

◆ POP

#define POP (   s)    rb_ary_pop(s)

Definition at line 123 of file cparse.c.

◆ PUSH

#define PUSH (   s,
 
)    rb_ary_store(s, RARRAY_LEN(s), i)

Definition at line 122 of file cparse.c.

◆ RACC_VERSION

#define RACC_VERSION   "1.4.5"

Definition at line 27 of file cparse.c.

◆ rb_intern

#define rb_intern (   str)    rb_intern_const(str)

Referenced by Init_cparse().

◆ REDUCE

#define REDUCE (   v,
  act 
)
Value:
do {\
switch (reduce(v,act)) { \
case 0: /* normal */ \
break; \
case 1: /* yyerror */ \
goto user_yyerror; \
case 2: /* yyaccept */ \
D_puts("u accept"); \
goto accept; \
default: \
break; \
} \
} while (0)

Definition at line 460 of file cparse.c.

◆ RUBY_UNTYPED_DATA_WARNING

#define RUBY_UNTYPED_DATA_WARNING   1

Definition at line 222 of file cparse.c.

◆ SHIFT

#define SHIFT (   v,
  act,
  tok,
  val 
)    shift(v,act,tok,val)

Definition at line 459 of file cparse.c.

◆ STACK_INIT_LEN

#define STACK_INIT_LEN   64

Definition at line 120 of file cparse.c.

◆ TRUE

#define TRUE   1

Definition at line 20 of file cparse.c.

◆ vDEFAULT_TOKEN

#define vDEFAULT_TOKEN   INT2FIX(DEFAULT_TOKEN)

Definition at line 33 of file cparse.c.

◆ vERROR_TOKEN

#define vERROR_TOKEN   INT2FIX(ERROR_TOKEN)

Definition at line 34 of file cparse.c.

◆ vFINAL_TOKEN

#define vFINAL_TOKEN   INT2FIX(FINAL_TOKEN)

Definition at line 35 of file cparse.c.

Function Documentation

◆ Init_cparse()

void Init_cparse ( void  )