w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

compile.h File Reference
#include "common.h"
#include <mruby.h>
Include dependency graph for compile.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mrbc_context
 
struct  mrb_ast_node
 
struct  mrb_parser_message
 
struct  mrb_parser_heredoc_info
 
struct  mrb_parser_state
 

Macros

#define STR_FUNC_PARSING   0x01
 
#define STR_FUNC_EXPAND   0x02
 
#define STR_FUNC_REGEXP   0x04
 
#define STR_FUNC_WORD   0x08
 
#define STR_FUNC_SYMBOL   0x10
 
#define STR_FUNC_ARRAY   0x20
 
#define STR_FUNC_HEREDOC   0x40
 
#define STR_FUNC_XQUOTE   0x80
 
#define MRB_PARSER_TOKBUF_MAX   (UINT16_MAX-1)
 
#define MRB_PARSER_TOKBUF_SIZE   256
 

Typedefs

typedef struct mrbc_context mrbc_context
 
typedef struct mrb_ast_node mrb_ast_node
 

Enumerations

enum  mrb_lex_state_enum {
  EXPR_BEG , EXPR_END , EXPR_ENDARG , EXPR_ENDFN ,
  EXPR_ARG , EXPR_CMDARG , EXPR_MID , EXPR_FNAME ,
  EXPR_DOT , EXPR_CLASS , EXPR_VALUE , EXPR_MAX_STATE
}
 
enum  mrb_string_type {
  str_not_parsing = (0) , str_squote = ( 0x01 ) , str_dquote = ( 0x01 | 0x02 ) , str_regexp = ( 0x01 | 0x04 | 0x02 ) ,
  str_sword = ( 0x01 | 0x08 | 0x20 ) , str_dword = ( 0x01 | 0x08 | 0x20 | 0x02 ) , str_ssym = ( 0x01 | 0x10 ) , str_ssymbols = ( 0x01 | 0x10 | 0x20 ) ,
  str_dsymbols = ( 0x01 | 0x10 | 0x20 | 0x02 ) , str_heredoc = ( 0x01 | 0x40 ) , str_xquote = ( 0x01 | 0x80 | 0x02 )
}
 

Functions

mrbc_contextmrbc_context_new (mrb_state *mrb)
 
void mrbc_context_free (mrb_state *mrb, mrbc_context *cxt)
 
const char * mrbc_filename (mrb_state *mrb, mrbc_context *c, const char *s)
 
void mrbc_partial_hook (mrb_state *mrb, mrbc_context *c, int(*partial_hook)(struct mrb_parser_state *), void *data)
 
void mrbc_cleanup_local_variables (mrb_state *mrb, mrbc_context *c)
 
struct mrb_parser_statemrb_parser_new (mrb_state *)
 
void mrb_parser_free (struct mrb_parser_state *)
 
void mrb_parser_parse (struct mrb_parser_state *, mrbc_context *)
 
void mrb_parser_set_filename (struct mrb_parser_state *, char const *)
 
mrb_sym mrb_parser_get_filename (struct mrb_parser_state *, uint16_t idx)
 
struct mrb_parser_statemrb_parse_file (mrb_state *, FILE *, mrbc_context *)
 
struct mrb_parser_statemrb_parse_string (mrb_state *, const char *, mrbc_context *)
 
struct mrb_parser_statemrb_parse_nstring (mrb_state *, const char *, size_t, mrbc_context *)
 
struct RProcmrb_generate_code (mrb_state *, struct mrb_parser_state *)
 
mrb_value mrb_load_exec (mrb_state *mrb, struct mrb_parser_state *p, mrbc_context *c)
 
mrb_value mrb_load_file (mrb_state *, FILE *)
 
mrb_value mrb_load_file_cxt (mrb_state *, FILE *, mrbc_context *cxt)
 
mrb_value mrb_load_detect_file_cxt (mrb_state *mrb, FILE *fp, mrbc_context *c)
 
mrb_value mrb_load_string (mrb_state *mrb, const char *s)
 
mrb_value mrb_load_nstring (mrb_state *mrb, const char *s, size_t len)
 
mrb_value mrb_load_string_cxt (mrb_state *mrb, const char *s, mrbc_context *cxt)
 
mrb_value mrb_load_nstring_cxt (mrb_state *mrb, const char *s, size_t len, mrbc_context *cxt)
 

Detailed Description

  • mruby parser

See Copyright Notice in mruby.h

Definition in file compile.h.

Macro Definition Documentation

◆ MRB_PARSER_TOKBUF_MAX

#define MRB_PARSER_TOKBUF_MAX   (UINT16_MAX-1)

Definition at line 112 of file compile.h.

◆ MRB_PARSER_TOKBUF_SIZE

#define MRB_PARSER_TOKBUF_SIZE   256

Definition at line 113 of file compile.h.

◆ STR_FUNC_ARRAY

#define STR_FUNC_ARRAY   0x20

Definition at line 81 of file compile.h.

◆ STR_FUNC_EXPAND

#define STR_FUNC_EXPAND   0x02

Definition at line 77 of file compile.h.

◆ STR_FUNC_HEREDOC

#define STR_FUNC_HEREDOC   0x40

Definition at line 82 of file compile.h.

◆ STR_FUNC_PARSING

#define STR_FUNC_PARSING   0x01

Definition at line 76 of file compile.h.

◆ STR_FUNC_REGEXP

#define STR_FUNC_REGEXP   0x04

Definition at line 78 of file compile.h.

◆ STR_FUNC_SYMBOL

#define STR_FUNC_SYMBOL   0x10

Definition at line 80 of file compile.h.

◆ STR_FUNC_WORD

#define STR_FUNC_WORD   0x08

Definition at line 79 of file compile.h.

◆ STR_FUNC_XQUOTE

#define STR_FUNC_XQUOTE   0x80

Definition at line 83 of file compile.h.

Typedef Documentation

◆ mrb_ast_node

typedef struct mrb_ast_node mrb_ast_node

◆ mrbc_context

typedef struct mrbc_context mrbc_context

Enumeration Type Documentation

◆ mrb_lex_state_enum

Enumerator
EXPR_BEG 
EXPR_END 
EXPR_ENDARG 
EXPR_ENDFN 
EXPR_ARG 
EXPR_CMDARG 
EXPR_MID 
EXPR_FNAME 
EXPR_DOT 
EXPR_CLASS 
EXPR_VALUE 
EXPR_MAX_STATE 

Definition at line 54 of file compile.h.

◆ mrb_string_type

Enumerator
str_not_parsing 
str_squote 
str_dquote 
str_regexp 
str_sword 
str_dword 
str_ssym 
str_ssymbols 
str_dsymbols 
str_heredoc 
str_xquote 

Definition at line 85 of file compile.h.

Function Documentation

◆ mrb_generate_code()

struct RProc* mrb_generate_code ( mrb_state mrb,
struct mrb_parser_state p 
)

Definition at line 3295 of file codegen.c.

References generate_code(), p, and VAL.

Referenced by create_proc_from_string(), decl_lv_underscore(), main(), and mrb_load_exec().

◆ mrb_load_detect_file_cxt()

◆ mrb_load_exec()

◆ mrb_load_file()

mrb_value mrb_load_file ( mrb_state mrb,
FILE f 
)

program load functions Please note! Currently due to interactions with the GC calling these functions will leak one RProc object per function call. To prevent this save the current memory arena before calling and restore the arena right after, like so int ai = mrb_gc_arena_save(mrb); mrb_value status = mrb_load_string(mrb, buffer); mrb_gc_arena_restore(mrb, ai);

Definition at line 12854 of file y.tab.c.

References f, mrb_load_file_cxt(), and NULL.

Referenced by aptex_commands_init().

◆ mrb_load_file_cxt()

mrb_value mrb_load_file_cxt ( mrb_state mrb,
FILE f,
mrbc_context cxt 
)

Definition at line 12848 of file y.tab.c.

References c, f, mrb_load_exec(), and mrb_parse_file().

Referenced by load_file(), main(), and mrb_load_file().

◆ mrb_load_nstring()

mrb_value mrb_load_nstring ( mrb_state mrb,
const char *  s,
size_t  len 
)

Definition at line 12916 of file y.tab.c.

References len, mrb_load_nstring_cxt(), NULL, and s.

◆ mrb_load_nstring_cxt()

mrb_value mrb_load_nstring_cxt ( mrb_state mrb,
const char *  s,
size_t  len,
mrbc_context cxt 
)

Definition at line 12910 of file y.tab.c.

References c, len, mrb_load_exec(), mrb_parse_nstring(), and s.

Referenced by mrb_load_nstring(), mrb_load_string_cxt(), and mrdb_check_syntax().

◆ mrb_load_string()

mrb_value mrb_load_string ( mrb_state mrb,
const char *  s 
)

Definition at line 12928 of file y.tab.c.

References mrb_load_string_cxt(), NULL, and s.

Referenced by aptex_commands_init(), FuzzRB(), and LLVMFuzzerTestOneInput().

◆ mrb_load_string_cxt()

mrb_value mrb_load_string_cxt ( mrb_state mrb,
const char *  s,
mrbc_context cxt 
)

Definition at line 12922 of file y.tab.c.

References c, mrb_load_nstring_cxt(), s, and strlen().

Referenced by main(), and mrb_load_string().

◆ mrb_parse_file()

struct mrb_parser_state* mrb_parse_file ( mrb_state mrb,
FILE f,
mrbc_context c 
)

Definition at line 12758 of file y.tab.c.

References c, f, mrb_parser_state::mrb, mrb_parse_file_continue(), and NULL.

Referenced by mrb_load_file_cxt().

◆ mrb_parse_nstring()

struct mrb_parser_state* mrb_parse_nstring ( mrb_state mrb,
const char *  s,
size_t  len,
mrbc_context c 
)

◆ mrb_parse_string()

struct mrb_parser_state* mrb_parse_string ( mrb_state mrb,
const char *  s,
mrbc_context c 
)

Definition at line 12779 of file y.tab.c.

References c, mrb_parser_state::mrb, mrb_parse_nstring(), s, and strlen().

Referenced by decl_lv_underscore().

◆ mrb_parser_free()

void mrb_parser_free ( struct mrb_parser_state p)

Definition at line 12642 of file y.tab.c.

References mrb_free(), mrb_pool_close(), and p.

Referenced by create_proc_from_string(), decl_lv_underscore(), main(), and mrb_load_exec().

◆ mrb_parser_get_filename()

mrb_sym mrb_parser_get_filename ( struct mrb_parser_state p,
uint16_t  idx 
)

Definition at line 12729 of file y.tab.c.

References idx, and p.

Referenced by codegen(), and scope_finish().

◆ mrb_parser_new()

struct mrb_parser_state* mrb_parser_new ( mrb_state mrb)

◆ mrb_parser_parse()

void mrb_parser_parse ( struct mrb_parser_state p,
mrbc_context c 
)

◆ mrb_parser_set_filename()

void mrb_parser_set_filename ( struct mrb_parser_state p,
char const f 
)

Definition at line 12697 of file y.tab.c.

References f, i, memmove, mrb_intern_cstr, new_table(), p, parser_palloc(), sym, UINT16_MAX, and yyerror().

Referenced by parser_init_cxt(), and partial_hook().

◆ mrbc_cleanup_local_variables()

void mrbc_cleanup_local_variables ( mrb_state mrb,
mrbc_context c 
)

Definition at line 12687 of file y.tab.c.

References c, mrb_free(), and NULL.

Referenced by main().

◆ mrbc_context_free()

void mrbc_context_free ( mrb_state mrb,
mrbc_context cxt 
)

◆ mrbc_context_new()

mrbc_context* mrbc_context_new ( mrb_state mrb)

Definition at line 12650 of file y.tab.c.

References mrb_calloc().

Referenced by create_proc_from_string(), load_file(), main(), and mrdb_check_syntax().

◆ mrbc_filename()

const char* mrbc_filename ( mrb_state mrb,
mrbc_context c,
const char *  s 
)

Definition at line 12664 of file y.tab.c.

References c, len, memcpy, mrb_free(), mrb_malloc(), p, s, and strlen().

Referenced by create_proc_from_string(), load_file(), main(), and mrdb_check_syntax().

◆ mrbc_partial_hook()

void mrbc_partial_hook ( mrb_state mrb,
mrbc_context c,
int(*)(struct mrb_parser_state *)  partial_hook,
void data 
)

Definition at line 12680 of file y.tab.c.

References c, data, and func.

Referenced by load_file().