Ruby 1.9.2p136(2010-12-25revision30365)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Defines | Functions | Variables

# ext/psych/parser.c File Reference

`#include <psych.h>`
Include dependency graph for parser.c:

Go to the source code of this file.

## Defines
#define | PSYCH_TRANSCODE(_str, _yaml_enc, _internal_enc)
## Functions
static int | io_reader (void *data, unsigned char *buf, size_t size, size_t *read)
static VALUE | parse (VALUE self, VALUE yaml)
void | Init_psych_parser ()
## Variables
VALUE | cPsychParser
VALUE | ePsychSyntaxError
static ID | id_read
static ID | id_empty
static ID | id_start_stream
static ID | id_end_stream
static ID | id_start_document
static ID | id_end_document
static ID | id_alias
static ID | id_scalar
static ID | id_start_sequence
static ID | id_end_sequence
static ID | id_start_mapping
static ID | id_end_mapping

## Define Documentation

#define PSYCH_TRANSCODE | ( |  | _str,
|  |  | _yaml_enc,
|  |  | _internal_enc
| ) |  |

Value:

    do { \
        rb_enc_associate_index(_str, _yaml_enc); \
        if(_internal_enc) \
          _str = rb_str_export_to_enc(_str, _internal_enc); \
      } while (0)

Definition at line 19 of file parser.c.

Referenced by parse().

## Function Documentation

void Init_psych_parser | ( |  | ) |

Definition at line 289 of file parser.c.

References cPsychParser, ePsychSyntaxError, id_alias, id_empty, id_end_document, id_end_mapping, id_end_sequence, id_end_stream, id_read, id_scalar, id_start_document, id_start_mapping, id_start_sequence, id_start_stream, INT2NUM(), mPsych, parse(), rb_cObject, rb_define_class_under(), rb_define_const(), rb_define_method(), rb_define_module(), rb_eSyntaxError, and rb_intern.

Referenced by Init_psych().

static int io_reader | ( | void * | data,
|  | unsigned char * | buf,
|  | size_t | size,
|  | size_t * | read
| ) |  | `[static]`

Definition at line 26 of file parser.c.

References id_read, INT2NUM(), NIL_P, rb_funcall(), RSTRING_LEN, and StringValuePtr.

Referenced by parse().

static VALUE parse | ( | VALUE | self,
|  | VALUE | yaml
| ) |  | `[static]`

Definition at line 51 of file parser.c.

References alias, ePsychSyntaxError, id_alias, id_empty, id_end_document, id_end_mapping, id_end_sequence, id_end_stream, id_read, id_scalar, id_start_document, id_start_mapping, id_start_sequence, id_start_stream, INT2NUM(), io_reader(), PSYCH_TRANSCODE, Qfalse, Qnil, Qtrue, rb_ary_new(), rb_ary_new3(), rb_ary_push(), rb_default_internal_encoding(), rb_enc_find_index(), rb_funcall(), rb_iv_get(), rb_raise(), rb_respond_to(), rb_str_new(), rb_str_new2(), RSTRING_LEN, RSTRING_PTR, StringValue, and version().

Referenced by Init_psych_parser().

## Variable Documentation

VALUE cPsychParser

Definition at line 3 of file parser.c.

Referenced by Init_psych_parser().

VALUE ePsychSyntaxError

Definition at line 4 of file parser.c.

Referenced by Init_psych_parser(), and parse().

ID id_alias`[static]`

Definition at line 12 of file parser.c.

Referenced by Init_psych_parser(), and parse().

ID id_empty`[static]`

Definition at line 7 of file parser.c.

Referenced by Init_psych_parser(), and parse().

ID id_end_document`[static]`

Definition at line 11 of file parser.c.

Referenced by Init_psych_parser(), and parse().

ID id_end_mapping`[static]`

Definition at line 17 of file parser.c.

Referenced by Init_psych_parser(), and parse().

ID id_end_sequence`[static]`

Definition at line 15 of file parser.c.

Referenced by Init_psych_parser(), and parse().

ID id_end_stream`[static]`

Definition at line 9 of file parser.c.

Referenced by Init_psych_parser(), and parse().

ID id_read`[static]`

Definition at line 6 of file parser.c.

Referenced by copy_stream_fallback_body(), Init_IO(), Init_psych_parser(), io_reader(), and parse().

ID id_scalar`[static]`

Definition at line 13 of file parser.c.

Referenced by Init_psych_parser(), and parse().

ID id_start_document`[static]`

Definition at line 10 of file parser.c.

Referenced by Init_psych_parser(), and parse().

ID id_start_mapping`[static]`

Definition at line 16 of file parser.c.

Referenced by Init_psych_parser(), and parse().

ID id_start_sequence`[static]`

Definition at line 14 of file parser.c.

Referenced by Init_psych_parser(), and parse().

ID id_start_stream`[static]`

Definition at line 8 of file parser.c.

Referenced by Init_psych_parser(), and parse().