mutant-melbourne 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +25 -0
 - data/README.md +69 -0
 - data/Rakefile +14 -0
 - data/ext/melbourne/.gitignore +3 -0
 - data/ext/melbourne/bstring-license.txt +29 -0
 - data/ext/melbourne/bstrlib.c +2687 -0
 - data/ext/melbourne/bstrlib.h +267 -0
 - data/ext/melbourne/encoding_compat.cpp +188 -0
 - data/ext/melbourne/encoding_compat.hpp +57 -0
 - data/ext/melbourne/extconf.rb +87 -0
 - data/ext/melbourne/grammar18.cpp +11280 -0
 - data/ext/melbourne/grammar18.hpp +13 -0
 - data/ext/melbourne/grammar18.y +6088 -0
 - data/ext/melbourne/grammar19.cpp +12420 -0
 - data/ext/melbourne/grammar19.hpp +11 -0
 - data/ext/melbourne/grammar19.y +7113 -0
 - data/ext/melbourne/lex.c.blt +152 -0
 - data/ext/melbourne/lex.c.tab +136 -0
 - data/ext/melbourne/local_state.hpp +43 -0
 - data/ext/melbourne/melbourne.cpp +88 -0
 - data/ext/melbourne/melbourne.hpp +19 -0
 - data/ext/melbourne/node18.hpp +262 -0
 - data/ext/melbourne/node19.hpp +271 -0
 - data/ext/melbourne/node_types.rb +304 -0
 - data/ext/melbourne/node_types18.cpp +255 -0
 - data/ext/melbourne/node_types18.hpp +129 -0
 - data/ext/melbourne/node_types19.cpp +249 -0
 - data/ext/melbourne/node_types19.hpp +126 -0
 - data/ext/melbourne/parser_state18.hpp +181 -0
 - data/ext/melbourne/parser_state19.hpp +251 -0
 - data/ext/melbourne/quark.cpp +42 -0
 - data/ext/melbourne/quark.hpp +45 -0
 - data/ext/melbourne/symbols.cpp +224 -0
 - data/ext/melbourne/symbols.hpp +119 -0
 - data/ext/melbourne/var_table18.cpp +83 -0
 - data/ext/melbourne/var_table18.hpp +33 -0
 - data/ext/melbourne/var_table19.cpp +65 -0
 - data/ext/melbourne/var_table19.hpp +35 -0
 - data/ext/melbourne/visitor18.cpp +963 -0
 - data/ext/melbourne/visitor18.hpp +12 -0
 - data/ext/melbourne/visitor19.cpp +960 -0
 - data/ext/melbourne/visitor19.hpp +15 -0
 - data/lib/compiler/ast/constants.rb +81 -0
 - data/lib/compiler/ast/control_flow.rb +290 -0
 - data/lib/compiler/ast/data.rb +14 -0
 - data/lib/compiler/ast/definitions.rb +749 -0
 - data/lib/compiler/ast/encoding.rb +18 -0
 - data/lib/compiler/ast/exceptions.rb +138 -0
 - data/lib/compiler/ast/file.rb +11 -0
 - data/lib/compiler/ast/grapher.rb +89 -0
 - data/lib/compiler/ast/literals.rb +207 -0
 - data/lib/compiler/ast/node.rb +362 -0
 - data/lib/compiler/ast/operators.rb +106 -0
 - data/lib/compiler/ast/self.rb +15 -0
 - data/lib/compiler/ast/sends.rb +615 -0
 - data/lib/compiler/ast/transforms.rb +298 -0
 - data/lib/compiler/ast/values.rb +88 -0
 - data/lib/compiler/ast/variables.rb +351 -0
 - data/lib/compiler/ast.rb +20 -0
 - data/lib/compiler/locals.rb +109 -0
 - data/lib/melbourne/processor.rb +651 -0
 - data/lib/melbourne/version.rb +3 -0
 - data/lib/melbourne.rb +143 -0
 - metadata +112 -0
 
| 
         @@ -0,0 +1,251 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #ifndef MEL_PARSER_STATE19_HPP
         
     | 
| 
      
 2 
     | 
    
         
            +
            #define MEL_PARSER_STATE19_HPP
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            #include "node19.hpp"
         
     | 
| 
      
 5 
     | 
    
         
            +
            #include "node_types19.hpp"
         
     | 
| 
      
 6 
     | 
    
         
            +
            #include "var_table19.hpp"
         
     | 
| 
      
 7 
     | 
    
         
            +
            #include "encoding_compat.hpp"
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            #include "bstrlib.h"
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            #include <vector>
         
     | 
| 
      
 12 
     | 
    
         
            +
            #include <list>
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            namespace melbourne {
         
     | 
| 
      
 15 
     | 
    
         
            +
              namespace grammar19 {
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                enum lex_state_e {
         
     | 
| 
      
 18 
     | 
    
         
            +
                  EXPR_BEG,       /* ignore newline, +/- is a sign. */
         
     | 
| 
      
 19 
     | 
    
         
            +
                  EXPR_END,       /* newline significant, +/- is an operator. */
         
     | 
| 
      
 20 
     | 
    
         
            +
                  EXPR_ENDARG,    /* ditto, and unbound braces. */
         
     | 
| 
      
 21 
     | 
    
         
            +
                  EXPR_ENDFN,     /* ditto, and unbound braces. */
         
     | 
| 
      
 22 
     | 
    
         
            +
                  EXPR_ARG,       /* newline significant, +/- is an operator. */
         
     | 
| 
      
 23 
     | 
    
         
            +
                  EXPR_CMDARG,    /* newline significant, +/- is an operator. */
         
     | 
| 
      
 24 
     | 
    
         
            +
                  EXPR_MID,       /* newline significant, +/- is an operator. */
         
     | 
| 
      
 25 
     | 
    
         
            +
                  EXPR_FNAME,     /* ignore newline, no reserved words. */
         
     | 
| 
      
 26 
     | 
    
         
            +
                  EXPR_DOT,       /* right after `.' or `::', no reserved words. */
         
     | 
| 
      
 27 
     | 
    
         
            +
                  EXPR_CLASS,     /* immediate after `class', no here document. */
         
     | 
| 
      
 28 
     | 
    
         
            +
                  EXPR_VALUE,     /* like EXPR_BEG but label is disallowed. */
         
     | 
| 
      
 29 
     | 
    
         
            +
                  EXPR_MAX_STATE
         
     | 
| 
      
 30 
     | 
    
         
            +
                };
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
            typedef VALUE stack_type;
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
                struct StartPosition {
         
     | 
| 
      
 35 
     | 
    
         
            +
                  int line;
         
     | 
| 
      
 36 
     | 
    
         
            +
                  const char* kind;
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
                  StartPosition(int l, const char* k)
         
     | 
| 
      
 39 
     | 
    
         
            +
                    : line(l)
         
     | 
| 
      
 40 
     | 
    
         
            +
                    , kind(k)
         
     | 
| 
      
 41 
     | 
    
         
            +
                  {}
         
     | 
| 
      
 42 
     | 
    
         
            +
                };
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
                typedef struct rb_parser_state {
         
     | 
| 
      
 45 
     | 
    
         
            +
                  int ruby__end__seen;
         
     | 
| 
      
 46 
     | 
    
         
            +
                  int debug_lines;
         
     | 
| 
      
 47 
     | 
    
         
            +
                  int heredoc_end;
         
     | 
| 
      
 48 
     | 
    
         
            +
                  int command_start;
         
     | 
| 
      
 49 
     | 
    
         
            +
                  NODE *lex_strterm;
         
     | 
| 
      
 50 
     | 
    
         
            +
                  int paren_nest;
         
     | 
| 
      
 51 
     | 
    
         
            +
                  int lpar_beg;
         
     | 
| 
      
 52 
     | 
    
         
            +
                  int class_nest;
         
     | 
| 
      
 53 
     | 
    
         
            +
                  int in_single;
         
     | 
| 
      
 54 
     | 
    
         
            +
                  int in_def;
         
     | 
| 
      
 55 
     | 
    
         
            +
                  int compile_for_eval;
         
     | 
| 
      
 56 
     | 
    
         
            +
                  ID cur_mid;
         
     | 
| 
      
 57 
     | 
    
         
            +
                  char *token_buffer;
         
     | 
| 
      
 58 
     | 
    
         
            +
                  int tokidx;
         
     | 
| 
      
 59 
     | 
    
         
            +
                  int toksiz;
         
     | 
| 
      
 60 
     | 
    
         
            +
                  int emit_warnings;
         
     | 
| 
      
 61 
     | 
    
         
            +
                  /* Mirror'ing the 1.8 parser, There are 2 input methods,
         
     | 
| 
      
 62 
     | 
    
         
            +
                     from IO and directly from a string. */
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
                  /* this function reads a line from lex_io and stores it in
         
     | 
| 
      
 65 
     | 
    
         
            +
                   * line_buffer.
         
     | 
| 
      
 66 
     | 
    
         
            +
                   */
         
     | 
| 
      
 67 
     | 
    
         
            +
                  VALUE (*lex_gets)(rb_parser_state*, VALUE);
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
                  /* If this is set, we use the io method. */
         
     | 
| 
      
 70 
     | 
    
         
            +
                  int lex_io;
         
     | 
| 
      
 71 
     | 
    
         
            +
                  char* lex_io_buf;
         
     | 
| 
      
 72 
     | 
    
         
            +
                  ssize_t lex_io_index;
         
     | 
| 
      
 73 
     | 
    
         
            +
                  ssize_t lex_io_total;
         
     | 
| 
      
 74 
     | 
    
         
            +
                  long lex_io_count;
         
     | 
| 
      
 75 
     | 
    
         
            +
             
     | 
| 
      
 76 
     | 
    
         
            +
                  /* Otherwise, we use this. */
         
     | 
| 
      
 77 
     | 
    
         
            +
                  long lex_gets_ptr;
         
     | 
| 
      
 78 
     | 
    
         
            +
                  VALUE lex_input;
         
     | 
| 
      
 79 
     | 
    
         
            +
                  VALUE lex_lastline;
         
     | 
| 
      
 80 
     | 
    
         
            +
                  VALUE lex_nextline;
         
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
      
 82 
     | 
    
         
            +
                  char *lex_pbeg;
         
     | 
| 
      
 83 
     | 
    
         
            +
                  char *lex_p;
         
     | 
| 
      
 84 
     | 
    
         
            +
                  char *lex_pend;
         
     | 
| 
      
 85 
     | 
    
         
            +
                  int lex_str_used;
         
     | 
| 
      
 86 
     | 
    
         
            +
             
     | 
| 
      
 87 
     | 
    
         
            +
                  enum lex_state_e lex_state;
         
     | 
| 
      
 88 
     | 
    
         
            +
                  int in_defined;
         
     | 
| 
      
 89 
     | 
    
         
            +
                  stack_type cond_stack;
         
     | 
| 
      
 90 
     | 
    
         
            +
                  stack_type cmdarg_stack;
         
     | 
| 
      
 91 
     | 
    
         
            +
             
     | 
| 
      
 92 
     | 
    
         
            +
                  void *lval; /* the parser's yylval */
         
     | 
| 
      
 93 
     | 
    
         
            +
                  bool eofp;
         
     | 
| 
      
 94 
     | 
    
         
            +
             
     | 
| 
      
 95 
     | 
    
         
            +
                  int column;
         
     | 
| 
      
 96 
     | 
    
         
            +
                  NODE *top_node;
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
                  struct local_vars* locals_table;
         
     | 
| 
      
 99 
     | 
    
         
            +
             
     | 
| 
      
 100 
     | 
    
         
            +
                  int ternary_colon;
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
      
 102 
     | 
    
         
            +
                  void **memory_pools;
         
     | 
| 
      
 103 
     | 
    
         
            +
                  int pool_size, current_pool;
         
     | 
| 
      
 104 
     | 
    
         
            +
                  char *memory_cur;
         
     | 
| 
      
 105 
     | 
    
         
            +
                  char *memory_last_addr;
         
     | 
| 
      
 106 
     | 
    
         
            +
                  int memory_size;
         
     | 
| 
      
 107 
     | 
    
         
            +
             
     | 
| 
      
 108 
     | 
    
         
            +
                  bool verbose;
         
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
      
 110 
     | 
    
         
            +
                  bool parse_error;
         
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
      
 112 
     | 
    
         
            +
                  // Reference to the object to call methods on to convert the
         
     | 
| 
      
 113 
     | 
    
         
            +
                  // C parse tree into a Ruby AST.
         
     | 
| 
      
 114 
     | 
    
         
            +
                  VALUE processor;
         
     | 
| 
      
 115 
     | 
    
         
            +
             
     | 
| 
      
 116 
     | 
    
         
            +
                  // Keep track of any object literals created in the parser.
         
     | 
| 
      
 117 
     | 
    
         
            +
                  VALUE references;
         
     | 
| 
      
 118 
     | 
    
         
            +
             
     | 
| 
      
 119 
     | 
    
         
            +
                  // Keeps track of lines that 'end' starters are on, to enable
         
     | 
| 
      
 120 
     | 
    
         
            +
                  // better error reporting.
         
     | 
| 
      
 121 
     | 
    
         
            +
                  std::list<StartPosition>* start_lines;
         
     | 
| 
      
 122 
     | 
    
         
            +
             
     | 
| 
      
 123 
     | 
    
         
            +
                  int line_count;
         
     | 
| 
      
 124 
     | 
    
         
            +
                  bool has_shebang;
         
     | 
| 
      
 125 
     | 
    
         
            +
             
     | 
| 
      
 126 
     | 
    
         
            +
                  char *ruby_sourcefile;
         
     | 
| 
      
 127 
     | 
    
         
            +
                  int ruby_sourceline;
         
     | 
| 
      
 128 
     | 
    
         
            +
             
     | 
| 
      
 129 
     | 
    
         
            +
                  rb_encoding *enc;
         
     | 
| 
      
 130 
     | 
    
         
            +
                  rb_encoding *utf8;
         
     | 
| 
      
 131 
     | 
    
         
            +
                } rb_parser_state;
         
     | 
| 
      
 132 
     | 
    
         
            +
             
     | 
| 
      
 133 
     | 
    
         
            +
             
     | 
| 
      
 134 
     | 
    
         
            +
            #define PARSER_STATE        ((rb_parser_state*)parser_state)
         
     | 
| 
      
 135 
     | 
    
         
            +
            #define PARSER_VAR(var)     (PARSER_STATE->var)
         
     | 
| 
      
 136 
     | 
    
         
            +
             
     | 
| 
      
 137 
     | 
    
         
            +
            #define end_seen            PARSER_VAR(end_seen)
         
     | 
| 
      
 138 
     | 
    
         
            +
            #define ruby__end__seen     PARSER_VAR(ruby__end__seen)
         
     | 
| 
      
 139 
     | 
    
         
            +
            #define ruby_debug_lines    PARSER_VAR(debug_lines)
         
     | 
| 
      
 140 
     | 
    
         
            +
            #define heredoc_end         PARSER_VAR(heredoc_end)
         
     | 
| 
      
 141 
     | 
    
         
            +
            #define command_start       PARSER_VAR(command_start)
         
     | 
| 
      
 142 
     | 
    
         
            +
            #define lex_strterm         PARSER_VAR(lex_strterm)
         
     | 
| 
      
 143 
     | 
    
         
            +
            #define paren_nest          PARSER_VAR(paren_nest)
         
     | 
| 
      
 144 
     | 
    
         
            +
            #define lpar_beg            PARSER_VAR(lpar_beg)
         
     | 
| 
      
 145 
     | 
    
         
            +
            #define class_nest          PARSER_VAR(class_nest)
         
     | 
| 
      
 146 
     | 
    
         
            +
            #define in_single           PARSER_VAR(in_single)
         
     | 
| 
      
 147 
     | 
    
         
            +
            #define in_def              PARSER_VAR(in_def)
         
     | 
| 
      
 148 
     | 
    
         
            +
            #define compile_for_eval    PARSER_VAR(compile_for_eval)
         
     | 
| 
      
 149 
     | 
    
         
            +
            #define cur_mid             PARSER_VAR(cur_mid)
         
     | 
| 
      
 150 
     | 
    
         
            +
            #define tokenbuf            PARSER_VAR(token_buffer)
         
     | 
| 
      
 151 
     | 
    
         
            +
            #define tokidx              PARSER_VAR(tokidx)
         
     | 
| 
      
 152 
     | 
    
         
            +
            #define toksiz              PARSER_VAR(toksiz)
         
     | 
| 
      
 153 
     | 
    
         
            +
            #define emit_warnings       PARSER_VAR(emit_warnings)
         
     | 
| 
      
 154 
     | 
    
         
            +
            #define lex_gets            PARSER_VAR(lex_gets)
         
     | 
| 
      
 155 
     | 
    
         
            +
            #define line_buffer         PARSER_VAR(line_buffer)
         
     | 
| 
      
 156 
     | 
    
         
            +
            #define line_count          PARSER_VAR(line_count)
         
     | 
| 
      
 157 
     | 
    
         
            +
            #define has_shebang         PARSER_VAR(has_shebang)
         
     | 
| 
      
 158 
     | 
    
         
            +
            #define lex_io              PARSER_VAR(lex_io)
         
     | 
| 
      
 159 
     | 
    
         
            +
            #define lex_io_buf          PARSER_VAR(lex_io_buf)
         
     | 
| 
      
 160 
     | 
    
         
            +
            #define lex_io_index        PARSER_VAR(lex_io_index)
         
     | 
| 
      
 161 
     | 
    
         
            +
            #define lex_io_total        PARSER_VAR(lex_io_total)
         
     | 
| 
      
 162 
     | 
    
         
            +
            #define lex_io_count        PARSER_VAR(lex_io_count)
         
     | 
| 
      
 163 
     | 
    
         
            +
            #define lex_gets_ptr        PARSER_VAR(lex_gets_ptr)
         
     | 
| 
      
 164 
     | 
    
         
            +
            #define lex_input           PARSER_VAR(lex_input)
         
     | 
| 
      
 165 
     | 
    
         
            +
            #define lex_lastline        PARSER_VAR(lex_lastline)
         
     | 
| 
      
 166 
     | 
    
         
            +
            #define lex_nextline        PARSER_VAR(lex_nextline)
         
     | 
| 
      
 167 
     | 
    
         
            +
            #define lex_pbeg            PARSER_VAR(lex_pbeg)
         
     | 
| 
      
 168 
     | 
    
         
            +
            #define lex_p               PARSER_VAR(lex_p)
         
     | 
| 
      
 169 
     | 
    
         
            +
            #define lex_pend            PARSER_VAR(lex_pend)
         
     | 
| 
      
 170 
     | 
    
         
            +
            #define lex_str_used        PARSER_VAR(lex_str_used)
         
     | 
| 
      
 171 
     | 
    
         
            +
            #define lex_state           PARSER_VAR(lex_state)
         
     | 
| 
      
 172 
     | 
    
         
            +
            #define in_defined          PARSER_VAR(in_defined)
         
     | 
| 
      
 173 
     | 
    
         
            +
            #define cond_stack          PARSER_VAR(cond_stack)
         
     | 
| 
      
 174 
     | 
    
         
            +
            #define cmdarg_stack        PARSER_VAR(cmdarg_stack)
         
     | 
| 
      
 175 
     | 
    
         
            +
            #define lval                PARSER_VAR(lval)
         
     | 
| 
      
 176 
     | 
    
         
            +
            #define eofp                PARSER_VAR(eofp)
         
     | 
| 
      
 177 
     | 
    
         
            +
            #define column              PARSER_VAR(column)
         
     | 
| 
      
 178 
     | 
    
         
            +
            #define top_node            PARSER_VAR(top_node)
         
     | 
| 
      
 179 
     | 
    
         
            +
            #define locals_table        PARSER_VAR(locals_table)
         
     | 
| 
      
 180 
     | 
    
         
            +
            #define ternary_colon       PARSER_VAR(ternary_colon)
         
     | 
| 
      
 181 
     | 
    
         
            +
            #define memory_pools        PARSER_VAR(memory_pools)
         
     | 
| 
      
 182 
     | 
    
         
            +
            #define pool_size           PARSER_VAR(pool_size)
         
     | 
| 
      
 183 
     | 
    
         
            +
            #define current_pool        PARSER_VAR(current_pool)
         
     | 
| 
      
 184 
     | 
    
         
            +
            #define memory_cur          PARSER_VAR(memory_cur)
         
     | 
| 
      
 185 
     | 
    
         
            +
            #define memory_last_addr    PARSER_VAR(memory_last_addr)
         
     | 
| 
      
 186 
     | 
    
         
            +
            #define memory_size         PARSER_VAR(memory_size)
         
     | 
| 
      
 187 
     | 
    
         
            +
            #define verbose             PARSER_VAR(verbose)
         
     | 
| 
      
 188 
     | 
    
         
            +
            #define parse_error         PARSER_VAR(parse_error)
         
     | 
| 
      
 189 
     | 
    
         
            +
            #define processor           PARSER_VAR(processor)
         
     | 
| 
      
 190 
     | 
    
         
            +
            #define references          PARSER_VAR(references)
         
     | 
| 
      
 191 
     | 
    
         
            +
            #define start_lines         PARSER_VAR(start_lines)
         
     | 
| 
      
 192 
     | 
    
         
            +
            #define ruby_sourcefile     PARSER_VAR(ruby_sourcefile)
         
     | 
| 
      
 193 
     | 
    
         
            +
            #define ruby_sourceline     PARSER_VAR(ruby_sourceline)
         
     | 
| 
      
 194 
     | 
    
         
            +
             
     | 
| 
      
 195 
     | 
    
         
            +
            #define node_newnode(t, a, b, c)  \
         
     | 
| 
      
 196 
     | 
    
         
            +
                parser_node_newnode((rb_parser_state*)parser_state, t, a, b, c)
         
     | 
| 
      
 197 
     | 
    
         
            +
            #define node_add_reference(obj)   \
         
     | 
| 
      
 198 
     | 
    
         
            +
                parser_add_reference((rb_parser_state*)parser_state, obj)
         
     | 
| 
      
 199 
     | 
    
         
            +
             
     | 
| 
      
 200 
     | 
    
         
            +
                NODE *parser_node_newnode(rb_parser_state*, enum node_type, VALUE, VALUE, VALUE);
         
     | 
| 
      
 201 
     | 
    
         
            +
                VALUE parser_add_reference(rb_parser_state* parser_state, VALUE obj);
         
     | 
| 
      
 202 
     | 
    
         
            +
             
     | 
| 
      
 203 
     | 
    
         
            +
            #undef ID_SCOPE_SHIFT
         
     | 
| 
      
 204 
     | 
    
         
            +
            #undef ID_SCOPE_MASK
         
     | 
| 
      
 205 
     | 
    
         
            +
            #undef ID_LOCAL
         
     | 
| 
      
 206 
     | 
    
         
            +
            #undef ID_INSTANCE
         
     | 
| 
      
 207 
     | 
    
         
            +
            #undef ID_GLOBAL
         
     | 
| 
      
 208 
     | 
    
         
            +
            #undef ID_ATTRSET
         
     | 
| 
      
 209 
     | 
    
         
            +
            #undef ID_CONST
         
     | 
| 
      
 210 
     | 
    
         
            +
            #undef ID_CLASS
         
     | 
| 
      
 211 
     | 
    
         
            +
            #undef ID_JUNK
         
     | 
| 
      
 212 
     | 
    
         
            +
            #undef ID_INTERNAL
         
     | 
| 
      
 213 
     | 
    
         
            +
             
     | 
| 
      
 214 
     | 
    
         
            +
                ID parser_intern(const char*);
         
     | 
| 
      
 215 
     | 
    
         
            +
                ID parser_intern2(const char*, long);
         
     | 
| 
      
 216 
     | 
    
         
            +
                ID parser_intern3(const char*, long, rb_encoding*);
         
     | 
| 
      
 217 
     | 
    
         
            +
                ID parser_intern_str(VALUE);
         
     | 
| 
      
 218 
     | 
    
         
            +
                char* parser_id2name(ID);
         
     | 
| 
      
 219 
     | 
    
         
            +
             
     | 
| 
      
 220 
     | 
    
         
            +
            #undef ID2SYM
         
     | 
| 
      
 221 
     | 
    
         
            +
            #undef SYMBOL_FLAG
         
     | 
| 
      
 222 
     | 
    
         
            +
             
     | 
| 
      
 223 
     | 
    
         
            +
            /* ID_SCOPE_SHIFT must be at least 4 because at 3 the values will overlap
         
     | 
| 
      
 224 
     | 
    
         
            +
             * the values of the tokens, causing the parser to mistake the symbol for
         
     | 
| 
      
 225 
     | 
    
         
            +
             * '*' with the token tAREF. Hilarity ensues when Fixnum * Fixnum ends up
         
     | 
| 
      
 226 
     | 
    
         
            +
             * parsed as Fixnum[Fixnum].
         
     | 
| 
      
 227 
     | 
    
         
            +
             */
         
     | 
| 
      
 228 
     | 
    
         
            +
            #define ID_SCOPE_SHIFT  7
         
     | 
| 
      
 229 
     | 
    
         
            +
            #define ID_SCOPE_MASK   0x0f
         
     | 
| 
      
 230 
     | 
    
         
            +
            #define ID_LOCAL        0x00
         
     | 
| 
      
 231 
     | 
    
         
            +
            #define ID_INSTANCE     0x01
         
     | 
| 
      
 232 
     | 
    
         
            +
            #define ID_GLOBAL       0x03
         
     | 
| 
      
 233 
     | 
    
         
            +
            #define ID_ATTRSET      0x04
         
     | 
| 
      
 234 
     | 
    
         
            +
            #define ID_CONST        0x05
         
     | 
| 
      
 235 
     | 
    
         
            +
            #define ID_CLASS        0x06
         
     | 
| 
      
 236 
     | 
    
         
            +
            #define ID_JUNK         0x07
         
     | 
| 
      
 237 
     | 
    
         
            +
            #define ID_INTERNAL     ID_JUNK
         
     | 
| 
      
 238 
     | 
    
         
            +
             
     | 
| 
      
 239 
     | 
    
         
            +
            #ifdef RUBINIUS
         
     | 
| 
      
 240 
     | 
    
         
            +
            #define ID2SYM(id)  (VALUE)((long)(id >> ID_SCOPE_SHIFT))
         
     | 
| 
      
 241 
     | 
    
         
            +
            #else
         
     | 
| 
      
 242 
     | 
    
         
            +
            #define SYMBOL_FLAG     0xe
         
     | 
| 
      
 243 
     | 
    
         
            +
            #define ID2SYM(id)  ((VALUE)(((long)(id >> ID_SCOPE_SHIFT))<<8|SYMBOL_FLAG))
         
     | 
| 
      
 244 
     | 
    
         
            +
            #endif
         
     | 
| 
      
 245 
     | 
    
         
            +
             
     | 
| 
      
 246 
     | 
    
         
            +
            #define INTERNAL_ID_P(a)  ((a & ID_INTERNAL) == ID_INTERNAL)
         
     | 
| 
      
 247 
     | 
    
         
            +
             
     | 
| 
      
 248 
     | 
    
         
            +
              };  // namespace grammar19
         
     | 
| 
      
 249 
     | 
    
         
            +
            };  // namespace melbourne
         
     | 
| 
      
 250 
     | 
    
         
            +
             
     | 
| 
      
 251 
     | 
    
         
            +
            #endif
         
     | 
| 
         @@ -0,0 +1,42 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #include "quark.hpp"
         
     | 
| 
      
 2 
     | 
    
         
            +
            #include "parser_state18.hpp"
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            #include <string.h>
         
     | 
| 
      
 5 
     | 
    
         
            +
            #include <stdlib.h>
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            using namespace melbourne::grammar18;
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            quark melbourne::grammar18::quark_from_string(rb_parser_state* parser_state, const char* str) {
         
     | 
| 
      
 10 
     | 
    
         
            +
              if (str == NULL) {
         
     | 
| 
      
 11 
     | 
    
         
            +
                return QUARK_NOT_FOUND;
         
     | 
| 
      
 12 
     | 
    
         
            +
              }
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
              /* attempt to find it in our cache */
         
     | 
| 
      
 15 
     | 
    
         
            +
              quark_map::iterator it = quark_indexes->find(str);
         
     | 
| 
      
 16 
     | 
    
         
            +
              if (it != quark_indexes->end()) {
         
     | 
| 
      
 17 
     | 
    
         
            +
                return it->second;
         
     | 
| 
      
 18 
     | 
    
         
            +
              }
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
              /* otherwise, we need to duplicate and store the string */
         
     | 
| 
      
 21 
     | 
    
         
            +
              const char* new_quark = strdup(str);
         
     | 
| 
      
 22 
     | 
    
         
            +
              quarks->push_back(new_quark);
         
     | 
| 
      
 23 
     | 
    
         
            +
              size_t index = quarks->size() - 1;
         
     | 
| 
      
 24 
     | 
    
         
            +
              quark_indexes->insert(quark_map::value_type(new_quark,index));
         
     | 
| 
      
 25 
     | 
    
         
            +
              return index;
         
     | 
| 
      
 26 
     | 
    
         
            +
            }
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            const char* melbourne::grammar18::quark_to_string(rb_parser_state* parser_state, quark q) {
         
     | 
| 
      
 29 
     | 
    
         
            +
              if (q >= quarks->size())
         
     | 
| 
      
 30 
     | 
    
         
            +
                return NULL;
         
     | 
| 
      
 31 
     | 
    
         
            +
              return quarks->at(q);
         
     | 
| 
      
 32 
     | 
    
         
            +
            }
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
            void melbourne::grammar18::quark_cleanup(rb_parser_state* parser_state) {
         
     | 
| 
      
 35 
     | 
    
         
            +
              delete quark_indexes;
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
              for (quark_vector::iterator it = quarks->begin(); it != quarks->end(); ++it) {
         
     | 
| 
      
 38 
     | 
    
         
            +
                free((char *)*it);
         
     | 
| 
      
 39 
     | 
    
         
            +
              }
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
              delete quarks;
         
     | 
| 
      
 42 
     | 
    
         
            +
            }
         
     | 
| 
         @@ -0,0 +1,45 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #ifndef MEL_QUARK_HPP
         
     | 
| 
      
 2 
     | 
    
         
            +
            #define MEL_QUARK_HPP
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            #include <stddef.h>
         
     | 
| 
      
 5 
     | 
    
         
            +
            #include <cmath>
         
     | 
| 
      
 6 
     | 
    
         
            +
            #include <vector>
         
     | 
| 
      
 7 
     | 
    
         
            +
            #include <tr1/unordered_map>
         
     | 
| 
      
 8 
     | 
    
         
            +
            #include <string.h>
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            namespace melbourne {
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
              namespace grammar18 {
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                typedef size_t quark;
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
                struct ConstCharHash {
         
     | 
| 
      
 17 
     | 
    
         
            +
                  size_t operator() (const char* value) const {
         
     | 
| 
      
 18 
     | 
    
         
            +
                    size_t length = strlen(value);
         
     | 
| 
      
 19 
     | 
    
         
            +
                    quark hash = 0;
         
     | 
| 
      
 20 
     | 
    
         
            +
                    for (size_t i = 0; i < length; i++) {
         
     | 
| 
      
 21 
     | 
    
         
            +
                      hash = hash * 5 + value[i];
         
     | 
| 
      
 22 
     | 
    
         
            +
                    }
         
     | 
| 
      
 23 
     | 
    
         
            +
                    return hash;
         
     | 
| 
      
 24 
     | 
    
         
            +
                  }
         
     | 
| 
      
 25 
     | 
    
         
            +
                };
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                struct ConstCharEqualTo {
         
     | 
| 
      
 28 
     | 
    
         
            +
                  bool operator() ( const char* lhs, const char* rhs) const {
         
     | 
| 
      
 29 
     | 
    
         
            +
                    return strcmp(lhs, rhs) == 0;
         
     | 
| 
      
 30 
     | 
    
         
            +
                  }
         
     | 
| 
      
 31 
     | 
    
         
            +
                };
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
                struct rb_parser_state;
         
     | 
| 
      
 34 
     | 
    
         
            +
                enum {QUARK_NOT_FOUND = ~0L};
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                quark quark_from_string(rb_parser_state* parser_state, const char* str);
         
     | 
| 
      
 37 
     | 
    
         
            +
                const char* quark_to_string(rb_parser_state* parser_state, const quark quark);
         
     | 
| 
      
 38 
     | 
    
         
            +
                void quark_cleanup(rb_parser_state* parser_state);
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                typedef std::tr1::unordered_map<const char*, quark, ConstCharHash, ConstCharEqualTo> quark_map;
         
     | 
| 
      
 41 
     | 
    
         
            +
                typedef std::vector<const char*> quark_vector;
         
     | 
| 
      
 42 
     | 
    
         
            +
              };
         
     | 
| 
      
 43 
     | 
    
         
            +
            };
         
     | 
| 
      
 44 
     | 
    
         
            +
            #endif
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
         @@ -0,0 +1,224 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #include "melbourne.hpp"
         
     | 
| 
      
 2 
     | 
    
         
            +
            #include "symbols.hpp"
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            #ifdef __cplusplus
         
     | 
| 
      
 5 
     | 
    
         
            +
            extern "C" {
         
     | 
| 
      
 6 
     | 
    
         
            +
            #endif
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            namespace melbourne {
         
     | 
| 
      
 9 
     | 
    
         
            +
              ID rb_sAlias;
         
     | 
| 
      
 10 
     | 
    
         
            +
              ID rb_sAnd;
         
     | 
| 
      
 11 
     | 
    
         
            +
              ID rb_sArgs;
         
     | 
| 
      
 12 
     | 
    
         
            +
              ID rb_sArgsCat;
         
     | 
| 
      
 13 
     | 
    
         
            +
              ID rb_sArgsPush;
         
     | 
| 
      
 14 
     | 
    
         
            +
              ID rb_sArray;
         
     | 
| 
      
 15 
     | 
    
         
            +
              ID rb_sAttrAsgn;
         
     | 
| 
      
 16 
     | 
    
         
            +
              ID rb_sBackRef;
         
     | 
| 
      
 17 
     | 
    
         
            +
              ID rb_sBegin;
         
     | 
| 
      
 18 
     | 
    
         
            +
              ID rb_sBlock;
         
     | 
| 
      
 19 
     | 
    
         
            +
              ID rb_sBlockArg;
         
     | 
| 
      
 20 
     | 
    
         
            +
              ID rb_sBlockPass;
         
     | 
| 
      
 21 
     | 
    
         
            +
              ID rb_sBreak;
         
     | 
| 
      
 22 
     | 
    
         
            +
              ID rb_sCall;
         
     | 
| 
      
 23 
     | 
    
         
            +
              ID rb_sCase;
         
     | 
| 
      
 24 
     | 
    
         
            +
              ID rb_sCDecl;
         
     | 
| 
      
 25 
     | 
    
         
            +
              ID rb_sClass;
         
     | 
| 
      
 26 
     | 
    
         
            +
              ID rb_sColon2;
         
     | 
| 
      
 27 
     | 
    
         
            +
              ID rb_sColon3;
         
     | 
| 
      
 28 
     | 
    
         
            +
              ID rb_sConst;
         
     | 
| 
      
 29 
     | 
    
         
            +
              ID rb_sCVar;
         
     | 
| 
      
 30 
     | 
    
         
            +
              ID rb_sCVAsgn;
         
     | 
| 
      
 31 
     | 
    
         
            +
              ID rb_sCVDecl;
         
     | 
| 
      
 32 
     | 
    
         
            +
              ID rb_sData;
         
     | 
| 
      
 33 
     | 
    
         
            +
              ID rb_sDefined;
         
     | 
| 
      
 34 
     | 
    
         
            +
              ID rb_sDefn;
         
     | 
| 
      
 35 
     | 
    
         
            +
              ID rb_sDefs;
         
     | 
| 
      
 36 
     | 
    
         
            +
              ID rb_sDot2;
         
     | 
| 
      
 37 
     | 
    
         
            +
              ID rb_sDot3;
         
     | 
| 
      
 38 
     | 
    
         
            +
              ID rb_sDRegx;
         
     | 
| 
      
 39 
     | 
    
         
            +
              ID rb_sDRegxOnce;
         
     | 
| 
      
 40 
     | 
    
         
            +
              ID rb_sDStr;
         
     | 
| 
      
 41 
     | 
    
         
            +
              ID rb_sDSym;
         
     | 
| 
      
 42 
     | 
    
         
            +
              ID rb_sDXStr;
         
     | 
| 
      
 43 
     | 
    
         
            +
              ID rb_sEncoding;
         
     | 
| 
      
 44 
     | 
    
         
            +
              ID rb_sEnsure;
         
     | 
| 
      
 45 
     | 
    
         
            +
              ID rb_sEvStr;
         
     | 
| 
      
 46 
     | 
    
         
            +
              ID rb_sFalse;
         
     | 
| 
      
 47 
     | 
    
         
            +
              ID rb_sFCall;
         
     | 
| 
      
 48 
     | 
    
         
            +
              ID rb_sFile;
         
     | 
| 
      
 49 
     | 
    
         
            +
              ID rb_sFixnum;
         
     | 
| 
      
 50 
     | 
    
         
            +
              ID rb_sFlip2;
         
     | 
| 
      
 51 
     | 
    
         
            +
              ID rb_sFlip3;
         
     | 
| 
      
 52 
     | 
    
         
            +
              ID rb_sFloat;
         
     | 
| 
      
 53 
     | 
    
         
            +
              ID rb_sFor;
         
     | 
| 
      
 54 
     | 
    
         
            +
              ID rb_sGAsgn;
         
     | 
| 
      
 55 
     | 
    
         
            +
              ID rb_sGVar;
         
     | 
| 
      
 56 
     | 
    
         
            +
              ID rb_sHash;
         
     | 
| 
      
 57 
     | 
    
         
            +
              ID rb_sIAsgn;
         
     | 
| 
      
 58 
     | 
    
         
            +
              ID rb_sIf;
         
     | 
| 
      
 59 
     | 
    
         
            +
              ID rb_sIter;
         
     | 
| 
      
 60 
     | 
    
         
            +
              ID rb_sIVar;
         
     | 
| 
      
 61 
     | 
    
         
            +
              ID rb_sLAsgn;
         
     | 
| 
      
 62 
     | 
    
         
            +
              ID rb_sLambda;
         
     | 
| 
      
 63 
     | 
    
         
            +
              ID rb_sLit;
         
     | 
| 
      
 64 
     | 
    
         
            +
              ID rb_sLVar;
         
     | 
| 
      
 65 
     | 
    
         
            +
              ID rb_sMAsgn;
         
     | 
| 
      
 66 
     | 
    
         
            +
              ID rb_sMatch;
         
     | 
| 
      
 67 
     | 
    
         
            +
              ID rb_sMatch2;
         
     | 
| 
      
 68 
     | 
    
         
            +
              ID rb_sMatch3;
         
     | 
| 
      
 69 
     | 
    
         
            +
              ID rb_sModule;
         
     | 
| 
      
 70 
     | 
    
         
            +
              ID rb_sNegate;
         
     | 
| 
      
 71 
     | 
    
         
            +
              ID rb_sNext;
         
     | 
| 
      
 72 
     | 
    
         
            +
              ID rb_sNil;
         
     | 
| 
      
 73 
     | 
    
         
            +
              ID rb_sNot;
         
     | 
| 
      
 74 
     | 
    
         
            +
              ID rb_sNthRef;
         
     | 
| 
      
 75 
     | 
    
         
            +
              ID rb_sNumber;
         
     | 
| 
      
 76 
     | 
    
         
            +
              ID rb_sOpAsgn1;
         
     | 
| 
      
 77 
     | 
    
         
            +
              ID rb_sOpAsgn2;
         
     | 
| 
      
 78 
     | 
    
         
            +
              ID rb_sOpAsgnAnd;
         
     | 
| 
      
 79 
     | 
    
         
            +
              ID rb_sOpAsgnOr;
         
     | 
| 
      
 80 
     | 
    
         
            +
              ID rb_sOptArg;
         
     | 
| 
      
 81 
     | 
    
         
            +
              ID rb_sOr;
         
     | 
| 
      
 82 
     | 
    
         
            +
              ID rb_sPostExe;
         
     | 
| 
      
 83 
     | 
    
         
            +
              ID rb_sPostArg;
         
     | 
| 
      
 84 
     | 
    
         
            +
              ID rb_sPreExe;
         
     | 
| 
      
 85 
     | 
    
         
            +
              ID rb_sRedo;
         
     | 
| 
      
 86 
     | 
    
         
            +
              ID rb_sRegex;
         
     | 
| 
      
 87 
     | 
    
         
            +
              ID rb_sResbody;
         
     | 
| 
      
 88 
     | 
    
         
            +
              ID rb_sRescue;
         
     | 
| 
      
 89 
     | 
    
         
            +
              ID rb_sRetry;
         
     | 
| 
      
 90 
     | 
    
         
            +
              ID rb_sReturn;
         
     | 
| 
      
 91 
     | 
    
         
            +
              ID rb_sSClass;
         
     | 
| 
      
 92 
     | 
    
         
            +
              ID rb_sScope;
         
     | 
| 
      
 93 
     | 
    
         
            +
              ID rb_sSelf;
         
     | 
| 
      
 94 
     | 
    
         
            +
              ID rb_sSplat;
         
     | 
| 
      
 95 
     | 
    
         
            +
              ID rb_sStr;
         
     | 
| 
      
 96 
     | 
    
         
            +
              ID rb_sSuper;
         
     | 
| 
      
 97 
     | 
    
         
            +
              ID rb_sSValue;
         
     | 
| 
      
 98 
     | 
    
         
            +
              ID rb_sToAry;
         
     | 
| 
      
 99 
     | 
    
         
            +
              ID rb_sTrue;
         
     | 
| 
      
 100 
     | 
    
         
            +
              ID rb_sUndef;
         
     | 
| 
      
 101 
     | 
    
         
            +
              ID rb_sUntil;
         
     | 
| 
      
 102 
     | 
    
         
            +
              ID rb_sVAlias;
         
     | 
| 
      
 103 
     | 
    
         
            +
              ID rb_sValues;
         
     | 
| 
      
 104 
     | 
    
         
            +
              ID rb_sVCall;
         
     | 
| 
      
 105 
     | 
    
         
            +
              ID rb_sWhen;
         
     | 
| 
      
 106 
     | 
    
         
            +
              ID rb_sWhile;
         
     | 
| 
      
 107 
     | 
    
         
            +
              ID rb_sXStr;
         
     | 
| 
      
 108 
     | 
    
         
            +
              ID rb_sYield;
         
     | 
| 
      
 109 
     | 
    
         
            +
              ID rb_sZArray;
         
     | 
| 
      
 110 
     | 
    
         
            +
              ID rb_sZSuper;
         
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
      
 112 
     | 
    
         
            +
            };
         
     | 
| 
      
 113 
     | 
    
         
            +
             
     | 
| 
      
 114 
     | 
    
         
            +
            #ifdef __cplusplus
         
     | 
| 
      
 115 
     | 
    
         
            +
            }  /* extern "C" { */
         
     | 
| 
      
 116 
     | 
    
         
            +
            #endif
         
     | 
| 
      
 117 
     | 
    
         
            +
             
     | 
| 
      
 118 
     | 
    
         
            +
            namespace melbourne {
         
     | 
| 
      
 119 
     | 
    
         
            +
             
     | 
| 
      
 120 
     | 
    
         
            +
              void init_symbols20() {
         
     | 
| 
      
 121 
     | 
    
         
            +
                rb_sAlias       = rb_intern("process_alias");
         
     | 
| 
      
 122 
     | 
    
         
            +
                rb_sAnd         = rb_intern("process_and");
         
     | 
| 
      
 123 
     | 
    
         
            +
                rb_sArgs        = rb_intern("process_args");
         
     | 
| 
      
 124 
     | 
    
         
            +
                rb_sArgsCat     = rb_intern("process_argscat");
         
     | 
| 
      
 125 
     | 
    
         
            +
                rb_sArgsPush    = rb_intern("process_argspush");
         
     | 
| 
      
 126 
     | 
    
         
            +
                rb_sArray       = rb_intern("process_array");
         
     | 
| 
      
 127 
     | 
    
         
            +
                rb_sAttrAsgn    = rb_intern("process_attrasgn");
         
     | 
| 
      
 128 
     | 
    
         
            +
                rb_sBackRef     = rb_intern("process_back_ref");
         
     | 
| 
      
 129 
     | 
    
         
            +
                rb_sBegin       = rb_intern("process_begin");
         
     | 
| 
      
 130 
     | 
    
         
            +
                rb_sBlock       = rb_intern("process_block");
         
     | 
| 
      
 131 
     | 
    
         
            +
                rb_sBlockArg    = rb_intern("process_block_arg");
         
     | 
| 
      
 132 
     | 
    
         
            +
                rb_sBlockPass   = rb_intern("process_block_pass");
         
     | 
| 
      
 133 
     | 
    
         
            +
                rb_sBreak       = rb_intern("process_break");
         
     | 
| 
      
 134 
     | 
    
         
            +
                rb_sCall        = rb_intern("process_call");
         
     | 
| 
      
 135 
     | 
    
         
            +
                rb_sCase        = rb_intern("process_case");
         
     | 
| 
      
 136 
     | 
    
         
            +
                rb_sCDecl       = rb_intern("process_cdecl");
         
     | 
| 
      
 137 
     | 
    
         
            +
                rb_sClass       = rb_intern("process_class");
         
     | 
| 
      
 138 
     | 
    
         
            +
                rb_sColon2      = rb_intern("process_colon2");
         
     | 
| 
      
 139 
     | 
    
         
            +
                rb_sColon3      = rb_intern("process_colon3");
         
     | 
| 
      
 140 
     | 
    
         
            +
                rb_sConst       = rb_intern("process_const");
         
     | 
| 
      
 141 
     | 
    
         
            +
                rb_sCVar        = rb_intern("process_cvar");
         
     | 
| 
      
 142 
     | 
    
         
            +
                rb_sCVAsgn      = rb_intern("process_cvasgn");
         
     | 
| 
      
 143 
     | 
    
         
            +
                rb_sCVDecl      = rb_intern("process_cvdecl");
         
     | 
| 
      
 144 
     | 
    
         
            +
                rb_sData        = rb_intern("process_data");
         
     | 
| 
      
 145 
     | 
    
         
            +
                rb_sDefined     = rb_intern("process_defined");
         
     | 
| 
      
 146 
     | 
    
         
            +
                rb_sDefn        = rb_intern("process_defn");
         
     | 
| 
      
 147 
     | 
    
         
            +
                rb_sDefs        = rb_intern("process_defs");
         
     | 
| 
      
 148 
     | 
    
         
            +
                rb_sDot2        = rb_intern("process_dot2");
         
     | 
| 
      
 149 
     | 
    
         
            +
                rb_sDot3        = rb_intern("process_dot3");
         
     | 
| 
      
 150 
     | 
    
         
            +
                rb_sDRegx       = rb_intern("process_dregx");
         
     | 
| 
      
 151 
     | 
    
         
            +
                rb_sDRegxOnce   = rb_intern("process_dregx_once");
         
     | 
| 
      
 152 
     | 
    
         
            +
                rb_sDStr        = rb_intern("process_dstr");
         
     | 
| 
      
 153 
     | 
    
         
            +
                rb_sDSym        = rb_intern("process_dsym");
         
     | 
| 
      
 154 
     | 
    
         
            +
                rb_sDXStr       = rb_intern("process_dxstr");
         
     | 
| 
      
 155 
     | 
    
         
            +
                rb_sEncoding    = rb_intern("process_encoding");
         
     | 
| 
      
 156 
     | 
    
         
            +
                rb_sEnsure      = rb_intern("process_ensure");
         
     | 
| 
      
 157 
     | 
    
         
            +
                rb_sEvStr       = rb_intern("process_evstr");
         
     | 
| 
      
 158 
     | 
    
         
            +
                rb_sFalse       = rb_intern("process_false");
         
     | 
| 
      
 159 
     | 
    
         
            +
                rb_sFCall       = rb_intern("process_fcall");
         
     | 
| 
      
 160 
     | 
    
         
            +
                rb_sFile        = rb_intern("process_file");
         
     | 
| 
      
 161 
     | 
    
         
            +
                rb_sFixnum      = rb_intern("process_fixnum");
         
     | 
| 
      
 162 
     | 
    
         
            +
                rb_sFlip2       = rb_intern("process_flip2");
         
     | 
| 
      
 163 
     | 
    
         
            +
                rb_sFlip3       = rb_intern("process_flip3");
         
     | 
| 
      
 164 
     | 
    
         
            +
                rb_sFloat       = rb_intern("process_float");
         
     | 
| 
      
 165 
     | 
    
         
            +
                rb_sFor         = rb_intern("process_for");
         
     | 
| 
      
 166 
     | 
    
         
            +
                rb_sGAsgn       = rb_intern("process_gasgn");
         
     | 
| 
      
 167 
     | 
    
         
            +
                rb_sGVar        = rb_intern("process_gvar");
         
     | 
| 
      
 168 
     | 
    
         
            +
                rb_sHash        = rb_intern("process_hash");
         
     | 
| 
      
 169 
     | 
    
         
            +
                rb_sIAsgn       = rb_intern("process_iasgn");
         
     | 
| 
      
 170 
     | 
    
         
            +
                rb_sIf          = rb_intern("process_if");
         
     | 
| 
      
 171 
     | 
    
         
            +
                rb_sIter        = rb_intern("process_iter");
         
     | 
| 
      
 172 
     | 
    
         
            +
                rb_sIVar        = rb_intern("process_ivar");
         
     | 
| 
      
 173 
     | 
    
         
            +
                rb_sLAsgn       = rb_intern("process_lasgn");
         
     | 
| 
      
 174 
     | 
    
         
            +
                rb_sLambda      = rb_intern("process_lambda");
         
     | 
| 
      
 175 
     | 
    
         
            +
                rb_sLit         = rb_intern("process_lit");
         
     | 
| 
      
 176 
     | 
    
         
            +
                rb_sLVar        = rb_intern("process_lvar");
         
     | 
| 
      
 177 
     | 
    
         
            +
                rb_sMAsgn       = rb_intern("process_masgn");
         
     | 
| 
      
 178 
     | 
    
         
            +
                rb_sMatch       = rb_intern("process_match");
         
     | 
| 
      
 179 
     | 
    
         
            +
                rb_sMatch2      = rb_intern("process_match2");
         
     | 
| 
      
 180 
     | 
    
         
            +
                rb_sMatch3      = rb_intern("process_match3");
         
     | 
| 
      
 181 
     | 
    
         
            +
                rb_sModule      = rb_intern("process_module");
         
     | 
| 
      
 182 
     | 
    
         
            +
                rb_sNegate      = rb_intern("process_negate");
         
     | 
| 
      
 183 
     | 
    
         
            +
                rb_sNext        = rb_intern("process_next");
         
     | 
| 
      
 184 
     | 
    
         
            +
                rb_sNil         = rb_intern("process_nil");
         
     | 
| 
      
 185 
     | 
    
         
            +
                rb_sNot         = rb_intern("process_not");
         
     | 
| 
      
 186 
     | 
    
         
            +
                rb_sNthRef      = rb_intern("process_nth_ref");
         
     | 
| 
      
 187 
     | 
    
         
            +
                rb_sNumber      = rb_intern("process_number");
         
     | 
| 
      
 188 
     | 
    
         
            +
                rb_sOpAsgn1     = rb_intern("process_op_asgn1");
         
     | 
| 
      
 189 
     | 
    
         
            +
                rb_sOpAsgn2     = rb_intern("process_op_asgn2");
         
     | 
| 
      
 190 
     | 
    
         
            +
                rb_sOpAsgnAnd   = rb_intern("process_op_asgn_and");
         
     | 
| 
      
 191 
     | 
    
         
            +
                rb_sOpAsgnOr    = rb_intern("process_op_asgn_or");
         
     | 
| 
      
 192 
     | 
    
         
            +
                rb_sOptArg      = rb_intern("process_opt_arg");
         
     | 
| 
      
 193 
     | 
    
         
            +
                rb_sOr          = rb_intern("process_or");
         
     | 
| 
      
 194 
     | 
    
         
            +
                rb_sPostExe     = rb_intern("process_postexe");
         
     | 
| 
      
 195 
     | 
    
         
            +
                rb_sPostArg     = rb_intern("process_postarg");
         
     | 
| 
      
 196 
     | 
    
         
            +
                rb_sPreExe      = rb_intern("process_preexe");
         
     | 
| 
      
 197 
     | 
    
         
            +
                rb_sRedo        = rb_intern("process_redo");
         
     | 
| 
      
 198 
     | 
    
         
            +
                rb_sRegex       = rb_intern("process_regex");
         
     | 
| 
      
 199 
     | 
    
         
            +
                rb_sResbody     = rb_intern("process_resbody");
         
     | 
| 
      
 200 
     | 
    
         
            +
                rb_sRescue      = rb_intern("process_rescue");
         
     | 
| 
      
 201 
     | 
    
         
            +
                rb_sRetry       = rb_intern("process_retry");
         
     | 
| 
      
 202 
     | 
    
         
            +
                rb_sReturn      = rb_intern("process_return");
         
     | 
| 
      
 203 
     | 
    
         
            +
                rb_sSClass      = rb_intern("process_sclass");
         
     | 
| 
      
 204 
     | 
    
         
            +
                rb_sScope       = rb_intern("process_scope");
         
     | 
| 
      
 205 
     | 
    
         
            +
                rb_sSelf        = rb_intern("process_self");
         
     | 
| 
      
 206 
     | 
    
         
            +
                rb_sSplat       = rb_intern("process_splat");
         
     | 
| 
      
 207 
     | 
    
         
            +
                rb_sStr         = rb_intern("process_str");
         
     | 
| 
      
 208 
     | 
    
         
            +
                rb_sSuper       = rb_intern("process_super");
         
     | 
| 
      
 209 
     | 
    
         
            +
                rb_sSValue      = rb_intern("process_svalue");
         
     | 
| 
      
 210 
     | 
    
         
            +
                rb_sToAry       = rb_intern("process_to_ary");
         
     | 
| 
      
 211 
     | 
    
         
            +
                rb_sTrue        = rb_intern("process_true");
         
     | 
| 
      
 212 
     | 
    
         
            +
                rb_sUndef       = rb_intern("process_undef");
         
     | 
| 
      
 213 
     | 
    
         
            +
                rb_sUntil       = rb_intern("process_until");
         
     | 
| 
      
 214 
     | 
    
         
            +
                rb_sVAlias      = rb_intern("process_valias");
         
     | 
| 
      
 215 
     | 
    
         
            +
                rb_sValues      = rb_intern("process_values");
         
     | 
| 
      
 216 
     | 
    
         
            +
                rb_sVCall       = rb_intern("process_vcall");
         
     | 
| 
      
 217 
     | 
    
         
            +
                rb_sWhen        = rb_intern("process_when");
         
     | 
| 
      
 218 
     | 
    
         
            +
                rb_sWhile       = rb_intern("process_while");
         
     | 
| 
      
 219 
     | 
    
         
            +
                rb_sXStr        = rb_intern("process_xstr");
         
     | 
| 
      
 220 
     | 
    
         
            +
                rb_sYield       = rb_intern("process_yield");
         
     | 
| 
      
 221 
     | 
    
         
            +
                rb_sZArray      = rb_intern("process_zarray");
         
     | 
| 
      
 222 
     | 
    
         
            +
                rb_sZSuper      = rb_intern("process_zsuper");
         
     | 
| 
      
 223 
     | 
    
         
            +
              }
         
     | 
| 
      
 224 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -0,0 +1,119 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #ifndef MEL_SYMBOLS_HPP
         
     | 
| 
      
 2 
     | 
    
         
            +
            #define MEL_SYMBOLS_HPP
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            #ifdef __cplusplus
         
     | 
| 
      
 5 
     | 
    
         
            +
            extern "C" {
         
     | 
| 
      
 6 
     | 
    
         
            +
            #endif
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            namespace melbourne {
         
     | 
| 
      
 9 
     | 
    
         
            +
              extern ID rb_sAlias;
         
     | 
| 
      
 10 
     | 
    
         
            +
              extern ID rb_sAnd;
         
     | 
| 
      
 11 
     | 
    
         
            +
              extern ID rb_sArgs;
         
     | 
| 
      
 12 
     | 
    
         
            +
              extern ID rb_sArgsCat;
         
     | 
| 
      
 13 
     | 
    
         
            +
              extern ID rb_sArgsPush;
         
     | 
| 
      
 14 
     | 
    
         
            +
              extern ID rb_sArray;
         
     | 
| 
      
 15 
     | 
    
         
            +
              extern ID rb_sAttrAsgn;
         
     | 
| 
      
 16 
     | 
    
         
            +
              extern ID rb_sBackRef;
         
     | 
| 
      
 17 
     | 
    
         
            +
              extern ID rb_sBegin;
         
     | 
| 
      
 18 
     | 
    
         
            +
              extern ID rb_sBlock;
         
     | 
| 
      
 19 
     | 
    
         
            +
              extern ID rb_sBlockArg;
         
     | 
| 
      
 20 
     | 
    
         
            +
              extern ID rb_sBlockPass;
         
     | 
| 
      
 21 
     | 
    
         
            +
              extern ID rb_sBreak;
         
     | 
| 
      
 22 
     | 
    
         
            +
              extern ID rb_sCall;
         
     | 
| 
      
 23 
     | 
    
         
            +
              extern ID rb_sCase;
         
     | 
| 
      
 24 
     | 
    
         
            +
              extern ID rb_sCDecl;
         
     | 
| 
      
 25 
     | 
    
         
            +
              extern ID rb_sClass;
         
     | 
| 
      
 26 
     | 
    
         
            +
              extern ID rb_sColon2;
         
     | 
| 
      
 27 
     | 
    
         
            +
              extern ID rb_sColon3;
         
     | 
| 
      
 28 
     | 
    
         
            +
              extern ID rb_sConst;
         
     | 
| 
      
 29 
     | 
    
         
            +
              extern ID rb_sCVar;
         
     | 
| 
      
 30 
     | 
    
         
            +
              extern ID rb_sCVAsgn;
         
     | 
| 
      
 31 
     | 
    
         
            +
              extern ID rb_sCVDecl;
         
     | 
| 
      
 32 
     | 
    
         
            +
              extern ID rb_sData;
         
     | 
| 
      
 33 
     | 
    
         
            +
              extern ID rb_sDefined;
         
     | 
| 
      
 34 
     | 
    
         
            +
              extern ID rb_sDefn;
         
     | 
| 
      
 35 
     | 
    
         
            +
              extern ID rb_sDefs;
         
     | 
| 
      
 36 
     | 
    
         
            +
              extern ID rb_sDot2;
         
     | 
| 
      
 37 
     | 
    
         
            +
              extern ID rb_sDot3;
         
     | 
| 
      
 38 
     | 
    
         
            +
              extern ID rb_sDRegx;
         
     | 
| 
      
 39 
     | 
    
         
            +
              extern ID rb_sDRegxOnce;
         
     | 
| 
      
 40 
     | 
    
         
            +
              extern ID rb_sDStr;
         
     | 
| 
      
 41 
     | 
    
         
            +
              extern ID rb_sDSym;
         
     | 
| 
      
 42 
     | 
    
         
            +
              extern ID rb_sDXStr;
         
     | 
| 
      
 43 
     | 
    
         
            +
              extern ID rb_sEncoding;
         
     | 
| 
      
 44 
     | 
    
         
            +
              extern ID rb_sEnsure;
         
     | 
| 
      
 45 
     | 
    
         
            +
              extern ID rb_sEvStr;
         
     | 
| 
      
 46 
     | 
    
         
            +
              extern ID rb_sFalse;
         
     | 
| 
      
 47 
     | 
    
         
            +
              extern ID rb_sFCall;
         
     | 
| 
      
 48 
     | 
    
         
            +
              extern ID rb_sFile;
         
     | 
| 
      
 49 
     | 
    
         
            +
              extern ID rb_sFixnum;
         
     | 
| 
      
 50 
     | 
    
         
            +
              extern ID rb_sFlip2;
         
     | 
| 
      
 51 
     | 
    
         
            +
              extern ID rb_sFlip3;
         
     | 
| 
      
 52 
     | 
    
         
            +
              extern ID rb_sFloat;
         
     | 
| 
      
 53 
     | 
    
         
            +
              extern ID rb_sFor;
         
     | 
| 
      
 54 
     | 
    
         
            +
              extern ID rb_sGAsgn;
         
     | 
| 
      
 55 
     | 
    
         
            +
              extern ID rb_sGVar;
         
     | 
| 
      
 56 
     | 
    
         
            +
              extern ID rb_sHash;
         
     | 
| 
      
 57 
     | 
    
         
            +
              extern ID rb_sIAsgn;
         
     | 
| 
      
 58 
     | 
    
         
            +
              extern ID rb_sIf;
         
     | 
| 
      
 59 
     | 
    
         
            +
              extern ID rb_sIter;
         
     | 
| 
      
 60 
     | 
    
         
            +
              extern ID rb_sIVar;
         
     | 
| 
      
 61 
     | 
    
         
            +
              extern ID rb_sLAsgn;
         
     | 
| 
      
 62 
     | 
    
         
            +
              extern ID rb_sLambda;
         
     | 
| 
      
 63 
     | 
    
         
            +
              extern ID rb_sLit;
         
     | 
| 
      
 64 
     | 
    
         
            +
              extern ID rb_sLVar;
         
     | 
| 
      
 65 
     | 
    
         
            +
              extern ID rb_sMAsgn;
         
     | 
| 
      
 66 
     | 
    
         
            +
              extern ID rb_sMatch;
         
     | 
| 
      
 67 
     | 
    
         
            +
              extern ID rb_sMatch2;
         
     | 
| 
      
 68 
     | 
    
         
            +
              extern ID rb_sMatch3;
         
     | 
| 
      
 69 
     | 
    
         
            +
              extern ID rb_sModule;
         
     | 
| 
      
 70 
     | 
    
         
            +
              extern ID rb_sNegate;
         
     | 
| 
      
 71 
     | 
    
         
            +
              extern ID rb_sNext;
         
     | 
| 
      
 72 
     | 
    
         
            +
              extern ID rb_sNil;
         
     | 
| 
      
 73 
     | 
    
         
            +
              extern ID rb_sNot;
         
     | 
| 
      
 74 
     | 
    
         
            +
              extern ID rb_sNthRef;
         
     | 
| 
      
 75 
     | 
    
         
            +
              extern ID rb_sNumber;
         
     | 
| 
      
 76 
     | 
    
         
            +
              extern ID rb_sOpAsgn1;
         
     | 
| 
      
 77 
     | 
    
         
            +
              extern ID rb_sOpAsgn2;
         
     | 
| 
      
 78 
     | 
    
         
            +
              extern ID rb_sOpAsgnAnd;
         
     | 
| 
      
 79 
     | 
    
         
            +
              extern ID rb_sOpAsgnOr;
         
     | 
| 
      
 80 
     | 
    
         
            +
              extern ID rb_sOptArg;
         
     | 
| 
      
 81 
     | 
    
         
            +
              extern ID rb_sOr;
         
     | 
| 
      
 82 
     | 
    
         
            +
              extern ID rb_sPostExe;
         
     | 
| 
      
 83 
     | 
    
         
            +
              extern ID rb_sPostArg;
         
     | 
| 
      
 84 
     | 
    
         
            +
              extern ID rb_sPreExe;
         
     | 
| 
      
 85 
     | 
    
         
            +
              extern ID rb_sRedo;
         
     | 
| 
      
 86 
     | 
    
         
            +
              extern ID rb_sRegex;
         
     | 
| 
      
 87 
     | 
    
         
            +
              extern ID rb_sResbody;
         
     | 
| 
      
 88 
     | 
    
         
            +
              extern ID rb_sRescue;
         
     | 
| 
      
 89 
     | 
    
         
            +
              extern ID rb_sRetry;
         
     | 
| 
      
 90 
     | 
    
         
            +
              extern ID rb_sReturn;
         
     | 
| 
      
 91 
     | 
    
         
            +
              extern ID rb_sSClass;
         
     | 
| 
      
 92 
     | 
    
         
            +
              extern ID rb_sScope;
         
     | 
| 
      
 93 
     | 
    
         
            +
              extern ID rb_sSelf;
         
     | 
| 
      
 94 
     | 
    
         
            +
              extern ID rb_sSplat;
         
     | 
| 
      
 95 
     | 
    
         
            +
              extern ID rb_sStr;
         
     | 
| 
      
 96 
     | 
    
         
            +
              extern ID rb_sSuper;
         
     | 
| 
      
 97 
     | 
    
         
            +
              extern ID rb_sSValue;
         
     | 
| 
      
 98 
     | 
    
         
            +
              extern ID rb_sToAry;
         
     | 
| 
      
 99 
     | 
    
         
            +
              extern ID rb_sTrue;
         
     | 
| 
      
 100 
     | 
    
         
            +
              extern ID rb_sUndef;
         
     | 
| 
      
 101 
     | 
    
         
            +
              extern ID rb_sUntil;
         
     | 
| 
      
 102 
     | 
    
         
            +
              extern ID rb_sVAlias;
         
     | 
| 
      
 103 
     | 
    
         
            +
              extern ID rb_sValues;
         
     | 
| 
      
 104 
     | 
    
         
            +
              extern ID rb_sVCall;
         
     | 
| 
      
 105 
     | 
    
         
            +
              extern ID rb_sWhen;
         
     | 
| 
      
 106 
     | 
    
         
            +
              extern ID rb_sWhile;
         
     | 
| 
      
 107 
     | 
    
         
            +
              extern ID rb_sXStr;
         
     | 
| 
      
 108 
     | 
    
         
            +
              extern ID rb_sYield;
         
     | 
| 
      
 109 
     | 
    
         
            +
              extern ID rb_sZArray;
         
     | 
| 
      
 110 
     | 
    
         
            +
              extern ID rb_sZSuper;
         
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
      
 112 
     | 
    
         
            +
              void init_symbols20();
         
     | 
| 
      
 113 
     | 
    
         
            +
            };
         
     | 
| 
      
 114 
     | 
    
         
            +
             
     | 
| 
      
 115 
     | 
    
         
            +
            #ifdef __cplusplus
         
     | 
| 
      
 116 
     | 
    
         
            +
            }  /* extern "C" { */
         
     | 
| 
      
 117 
     | 
    
         
            +
            #endif
         
     | 
| 
      
 118 
     | 
    
         
            +
             
     | 
| 
      
 119 
     | 
    
         
            +
            #endif
         
     |