Ruby  1.9.3p551(2014-11-13revision48407)
Macros | Functions | Variables
token.c File Reference
#include "ruby/ruby.h"
#include "syck.h"
#include "gram.h"

Go to the source code of this file.

Macros

#define QUOTELEN   1024
 
#define YYCTYPE   char
 
#define YYCURSOR   parser->cursor
 
#define YYMARKER   parser->marker
 
#define YYLIMIT   parser->limit
 
#define YYTOKEN   parser->token
 
#define YYTOKTMP   parser->toktmp
 
#define YYLINEPTR   parser->lineptr
 
#define YYLINECTPTR   parser->linectptr
 
#define YYLINE   parser->linect
 
#define YYFILL(n)   syck_parser_read(parser)
 
#define YYPOS(n)   YYCURSOR = YYTOKEN + n
 
#define NEWLINE(ptr)   YYLINEPTR = ptr + newline_len(ptr); if ( YYLINEPTR > YYLINECTPTR ) { YYLINE++; YYLINECTPTR = YYLINEPTR; }
 
#define ADD_LEVEL(len, status)   syck_parser_add_level( parser, len, status )
 
#define POP_LEVEL()   syck_parser_pop_level( parser )
 
#define CURRENT_LEVEL()   syck_parser_current_level( parser )
 
#define FORCE_NEXT_TOKEN(tok)   parser->force_token = tok;
 
#define ENSURE_YAML_IOPEN(last_lvl, to_len, reset)
 
#define ENSURE_YAML_IEND(last_lvl, to_len)
 
#define QUOTECAT(s, c, i, l)
 
#define QUOTECATS(s, c, i, cs, cl)
 
#define RETURN_IMPLICIT()
 
#define PLAIN_NOT_INL()
 
#define PLAIN_IS_INL()
 
#define RETURN_YAML_BLOCK()
 
#define GOBBLE_UP_YAML_INDENT(ict, start)
 
#define GET_TRUE_YAML_INDENT(indt_len)
 

Functions

void eat_comments (SyckParser *)
 
char escape_seq (char)
 
int is_newline (char *ptr)
 
int newline_len (char *ptr)
 
int sycklex_yaml_utf8 (YYSTYPE *, SyckParser *)
 
int sycklex_bytecode_utf8 (YYSTYPE *, SyckParser *)
 
int syckwrap ()
 
int sycklex (YYSTYPE *sycklval, SyckParser *parser)
 
void syckerror (const char *msg)
 

Variables

SyckParsersyck_parser_ptr = NULL
 

Macro Definition Documentation

#define ADD_LEVEL (   len,
  status 
)    syck_parser_add_level( parser, len, status )

Definition at line 47 of file token.c.

Referenced by sycklex_yaml_utf8().

#define CURRENT_LEVEL ( )    syck_parser_current_level( parser )

Definition at line 49 of file token.c.

Referenced by sycklex_yaml_utf8().

#define ENSURE_YAML_IEND (   last_lvl,
  to_len 
)
Value:
if ( last_lvl->spaces > to_len ) \
{ \
YYPOS(0); \
}
#define YAML_IEND
Definition: gram.c:90
#define YYPOS(n)
Definition: token.c:37
void syck_parser_pop_level(SyckParser *)
Definition: syck.c:370
return
Definition: name2ctype.h:23857
struct parser_params * parser
Definition: ripper.c:4323

Definition at line 79 of file token.c.

Referenced by sycklex_yaml_utf8().

#define ENSURE_YAML_IOPEN (   last_lvl,
  to_len,
  reset 
)
Value:
if ( last_lvl->spaces < to_len ) \
{ \
if ( last_lvl->status == syck_lvl_iseq || last_lvl->status == syck_lvl_imap ) \
{ \
goto Document; \
} \
{ \
if ( reset == 1 ) YYPOS(0); \
} \
}
#define YAML_IOPEN
Definition: gram.c:88
if(len<=MAX_WORD_LENGTH &&len >=MIN_WORD_LENGTH)
Definition: name2ctype.h:23841
#define YYPOS(n)
Definition: token.c:37
#define ADD_LEVEL(len, status)
Definition: token.c:47
else
Definition: bigdecimal.c:1150
return
Definition: name2ctype.h:23857

Definition at line 60 of file token.c.

Referenced by sycklex_yaml_utf8().

#define FORCE_NEXT_TOKEN (   tok)    parser->force_token = tok;

Definition at line 54 of file token.c.

Referenced by sycklex_yaml_utf8().

#define GET_TRUE_YAML_INDENT (   indt_len)
Value:
{ \
SyckLevel *lvl_deep = CURRENT_LEVEL(); \
indt_len = lvl_deep->spaces; \
if ( lvl_deep->status == syck_lvl_seq || ( indt_len == YYCURSOR - YYLINEPTR && lvl_deep->status != syck_lvl_map ) ) \
{ \
SyckLevel *lvl_over; \
parser->lvl_idx--; \
lvl_over = CURRENT_LEVEL(); \
indt_len = lvl_over->spaces; \
parser->lvl_idx++; \
} \
}
#define YYCURSOR
Definition: token.c:23
if(len<=MAX_WORD_LENGTH &&len >=MIN_WORD_LENGTH)
Definition: name2ctype.h:23841
#define CURRENT_LEVEL()
Definition: token.c:49
struct _syck_level SyckLevel
Definition: syck.h:151
#define YYLINEPTR
Definition: token.c:28
struct parser_params * parser
Definition: ripper.c:4323

Definition at line 216 of file token.c.

Referenced by sycklex_yaml_utf8().

#define GOBBLE_UP_YAML_INDENT (   ict,
  start 
)
Value:
char *indent = start; \
NEWLINE(indent); \
while ( indent < YYCURSOR ) \
{ \
if ( is_newline( ++indent ) ) \
{ \
NEWLINE(indent); \
} \
} \
ict = 0; \
if ( *YYCURSOR == '\0' ) \
{ \
ict = -1; \
start = YYCURSOR - 1; \
} \
else if ( *YYLINEPTR == ' ' ) \
{ \
ict = (int)(YYCURSOR - YYLINEPTR); \
}
#define YYCURSOR
Definition: token.c:23
VP_EXPORT int
Definition: bigdecimal.c:4911
if(len<=MAX_WORD_LENGTH &&len >=MIN_WORD_LENGTH)
Definition: name2ctype.h:23841
while(a->frac[0]/shift==0)
Definition: bigdecimal.c:4978
#define YYLINEPTR
Definition: token.c:28
else
Definition: bigdecimal.c:1150
char * start
Definition: yaml2byte.c:126
int is_newline(char *ptr)
Definition: token.c:2692
#define NEWLINE(ptr)
Definition: token.c:42

Definition at line 192 of file token.c.

Referenced by sycklex_yaml_utf8().

#define NEWLINE (   ptr)    YYLINEPTR = ptr + newline_len(ptr); if ( YYLINEPTR > YYLINECTPTR ) { YYLINE++; YYLINECTPTR = YYLINEPTR; }

Definition at line 42 of file token.c.

#define PLAIN_IS_INL ( )
Value:
char *walker = qstr + qidx - 1; \
while ( walker > qstr && ( *walker == '\n' || *walker == ' ' || *walker == '\t' ) ) \
{ \
qidx--; \
walker[0] = '\0'; \
walker--; \
}
while(a->frac[0]/shift==0)
Definition: bigdecimal.c:4978

Definition at line 143 of file token.c.

Referenced by sycklex_yaml_utf8().

#define PLAIN_NOT_INL ( )
Value:
if ( *(YYCURSOR - 1) == ' ' || is_newline( YYCURSOR - 1 ) ) \
{ \
} \
QUOTECATS(qstr, qcapa, qidx, YYTOKEN, YYCURSOR - YYTOKEN); \
goto Plain2;
#define YYCURSOR
Definition: token.c:23
#define QUOTECATS(s, c, i, cs, cl)
Definition: token.c:102
#define YYTOKEN
Definition: token.c:26
int is_newline(char *ptr)
Definition: token.c:2692

Definition at line 134 of file token.c.

Referenced by sycklex_yaml_utf8().

#define POP_LEVEL ( )    syck_parser_pop_level( parser )

Definition at line 48 of file token.c.

Referenced by sycklex_yaml_utf8().

#define QUOTECAT (   s,
  c,
  i,
 
)
Value:
{ \
if ( i + 1 >= c ) \
{ \
S_REALLOC_N( s, char, c ); \
} \
s[i++] = l; \
s[i] = '\0'; \
}
if(len<=MAX_WORD_LENGTH &&len >=MIN_WORD_LENGTH)
Definition: name2ctype.h:23841
#define S_REALLOC_N(var, type, n)
Definition: syck.h:49
register char * s
Definition: os2.c:56
VpDivd * c
Definition: bigdecimal.c:1163
#define QUOTELEN
Definition: token.c:17
ssize_t i
Definition: bigdecimal.c:5519

Definition at line 91 of file token.c.

Referenced by sycklex_yaml_utf8().

#define QUOTECATS (   s,
  c,
  i,
  cs,
  cl 
)
Value:
{ \
while ( i + cl >= c ) \
{ \
S_REALLOC_N( s, char, c ); \
} \
S_MEMCPY( s + i, cs, char, cl ); \
i += cl; \
s[i] = '\0'; \
}
while(a->frac[0]/shift==0)
Definition: bigdecimal.c:4978
#define S_MEMCPY(p1, p2, type, n)
Definition: syck.h:55
#define S_REALLOC_N(var, type, n)
Definition: syck.h:49
register char * s
Definition: os2.c:56
VpDivd * c
Definition: bigdecimal.c:1163
#define QUOTELEN
Definition: token.c:17
ssize_t i
Definition: bigdecimal.c:5519

Definition at line 102 of file token.c.

Referenced by sycklex_yaml_utf8().

#define QUOTELEN   1024

Definition at line 17 of file token.c.

#define RETURN_IMPLICIT ( )
Value:
{ \
n->data.str->ptr = qstr; \
n->data.str->len = qidx; \
n->data.str->style = scalar_plain; \
sycklval->nodeData = n; \
if ( parser->implicit_typing == 1 ) \
{ \
try_tag_implicit( sycklval->nodeData, parser->taguri_expansion ); \
} \
}
#define YYCURSOR
Definition: token.c:23
ssize_t n
Definition: bigdecimal.c:5519
if(len<=MAX_WORD_LENGTH &&len >=MIN_WORD_LENGTH)
Definition: name2ctype.h:23841
struct _syck_node SyckNode
Definition: syck.h:74
#define YAML_PLAIN
Definition: gram.c:85
#define YYTOKEN
Definition: token.c:26
void try_tag_implicit(SyckNode *n, int taguri)
Definition: implicit.c:21
return
Definition: name2ctype.h:23857
SyckNode * syck_alloc_str(void)
Definition: node.c:85
struct parser_params * parser
Definition: ripper.c:4323

Definition at line 118 of file token.c.

Referenced by sycklex_yaml_utf8().

#define RETURN_YAML_BLOCK ( )

Definition at line 156 of file token.c.

Referenced by sycklex_yaml_utf8().

#define YYCTYPE   char

Definition at line 22 of file token.c.

Referenced by eat_comments(), and sycklex_yaml_utf8().

#define YYCURSOR   parser->cursor

Definition at line 23 of file token.c.

Referenced by eat_comments(), and sycklex_yaml_utf8().

#define YYFILL (   n)    syck_parser_read(parser)

Definition at line 31 of file token.c.

Referenced by eat_comments(), and sycklex_yaml_utf8().

#define YYLIMIT   parser->limit

Definition at line 25 of file token.c.

Referenced by eat_comments(), and sycklex_yaml_utf8().

#define YYLINE   parser->linect

Definition at line 30 of file token.c.

#define YYLINECTPTR   parser->linectptr

Definition at line 29 of file token.c.

#define YYLINEPTR   parser->lineptr

Definition at line 28 of file token.c.

Referenced by sycklex_yaml_utf8().

#define YYMARKER   parser->marker

Definition at line 24 of file token.c.

Referenced by eat_comments(), and sycklex_yaml_utf8().

#define YYPOS (   n)    YYCURSOR = YYTOKEN + n

Definition at line 37 of file token.c.

Referenced by sycklex_yaml_utf8().

#define YYTOKEN   parser->token

Definition at line 26 of file token.c.

Referenced by eat_comments(), and sycklex_yaml_utf8().

#define YYTOKTMP   parser->toktmp

Definition at line 27 of file token.c.

Referenced by sycklex_yaml_utf8().

Function Documentation

void eat_comments ( SyckParser parser)

Definition at line 2599 of file token.c.

References YYCTYPE, YYCURSOR, YYFILL, YYLIMIT, YYMARKER, and YYTOKEN.

Referenced by sycklex_yaml_utf8().

char escape_seq ( char  ch)

Definition at line 2674 of file token.c.

References ch.

Referenced by sycklex_yaml_utf8().

int is_newline ( char *  ptr)

Definition at line 2692 of file token.c.

References newline_len().

Referenced by sycklex_yaml_utf8().

int newline_len ( char *  ptr)

Definition at line 2698 of file token.c.

Referenced by is_newline(), and sycklex_yaml_utf8().

void syckerror ( const char *  msg)
int sycklex ( YYSTYPE sycklval,
SyckParser parser 
)
int sycklex_bytecode_utf8 ( YYSTYPE ,
SyckParser  
)
int sycklex_yaml_utf8 ( YYSTYPE sycklval,
SyckParser parser 
)
int syckwrap ( )

Definition at line 2710 of file token.c.

Variable Documentation

SyckParser* syck_parser_ptr = NULL

Definition at line 233 of file token.c.