Ruby  1.9.3p429(2013-05-15revision40747)
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 ) \
{ \
syck_parser_pop_level( parser ); \
YYPOS(0); \
return YAML_IEND; \
}

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; \
} \
else \
{ \
ADD_LEVEL( to_len, syck_lvl_doc ); \
if ( reset == 1 ) YYPOS(0); \
} \
}

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++; \
} \
}

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); \
}

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--; \
}

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 ) ) \
{ \
YYCURSOR--; \
} \
QUOTECATS(qstr, qcapa, qidx, YYTOKEN, YYCURSOR - YYTOKEN); \
goto Plain2;

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 ) \
{ \
c += QUOTELEN; \
S_REALLOC_N( s, char, c ); \
} \
s[i++] = l; \
s[i] = '\0'; \
}

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 ) \
{ \
c += QUOTELEN; \
S_REALLOC_N( s, char, c ); \
} \
S_MEMCPY( s + i, cs, char, cl ); \
i += cl; \
s[i] = '\0'; \
}

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:
{ \
YYCURSOR = YYTOKEN; \
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 ); \
} \
return YAML_PLAIN; \
}

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.

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.