Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the latest version of Racc 1.4.x #2186

Closed
wants to merge 11 commits into from
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
#
# This file was generated by RubyGems.
#
# The application 'racc' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0.a"

if ARGV.first
str = ARGV.first
str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
version = $1
ARGV.shift
end
end

if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('racc', 'racc', version)
else
gem "racc", version
load Gem.bin_path("racc", "racc", version)
end
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
#
# This file was generated by RubyGems.
#
# The application 'racc' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0.a"

if ARGV.first
str = ARGV.first
str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
version = $1
ARGV.shift
end
end

if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('racc', 'racc2y', version)
else
gem "racc", version
load Gem.bin_path("racc", "racc2y", version)
end
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
#
# This file was generated by RubyGems.
#
# The application 'racc' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0.a"

if ARGV.first
str = ARGV.first
str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
version = $1
ARGV.shift
end
end

if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('racc', 'y2racc', version)
else
gem "racc", version
load Gem.bin_path("racc", "y2racc", version)
end
@@ -11,7 +11,7 @@
*/

#include "ruby/ruby.h"
#include <ruby.h>

#ifndef FALSE
#define FALSE 0
@@ -24,7 +24,7 @@
Important Constants
----------------------------------------------------------------------- */

#define RACC_VERSION "1.4.5"
#define RACC_VERSION "1.4.15"

#define DEFAULT_TOKEN -1
#define ERROR_TOKEN 1
@@ -72,6 +72,10 @@ static ID id_d_e_pop;
# define LONG2NUM(i) INT2NUM(i)
#endif

#ifndef HAVE_RB_ARY_SUBSEQ
# define rb_ary_subseq(ary, beg, len) rb_ary_new4(len, RARRAY_PTR(ary) + beg)
#endif

static ID value_to_id _((VALUE v));
static inline long num_to_long _((VALUE n));

File renamed without changes.
@@ -2,5 +2,7 @@
# $Id$

require 'mkmf'
have_func('rb_block_call', 'ruby/ruby.h')

have_func('rb_ary_subseq')

create_makefile 'racc/cparse'
@@ -0,0 +1,6 @@
require 'racc/compat'
require 'racc/debugflags'
require 'racc/grammar'
require 'racc/state'
require 'racc/exception'
require 'racc/info'
@@ -0,0 +1,32 @@
#
# $Id: 14fa1118eb3a23e85265e4f7afe2d5a297d69f9c $
#
# Copyright (c) 1999-2006 Minero Aoki
#
# This program is free software.
# You can distribute/modify this program under the terms of
# the GNU LGPL, Lesser General Public License version 2.1.
# For details of the GNU LGPL, see the file "COPYING".
#

unless Object.method_defined?(:__send)
class Object
alias __send __send__
end
end

unless Object.method_defined?(:__send!)
class Object
alias __send! __send__
end
end

unless Array.method_defined?(:map!)
class Array
if Array.method_defined?(:collect!)
alias map! collect!
else
alias map! filter
end
end
end
@@ -0,0 +1,59 @@
#
# $Id: 74ff4369ce53c7f45cfc2644ce907785104ebf6e $
#
# Copyright (c) 1999-2006 Minero Aoki
#
# This program is free software.
# You can distribute/modify this program under the terms of
# the GNU LGPL, Lesser General Public License version 2.1.
# For details of LGPL, see the file "COPYING".
#

module Racc

class DebugFlags
def DebugFlags.parse_option_string(s)
parse = rule = token = state = la = prec = conf = false
s.split(//).each do |ch|
case ch
when 'p' then parse = true
when 'r' then rule = true
when 't' then token = true
when 's' then state = true
when 'l' then la = true
when 'c' then prec = true
when 'o' then conf = true
else
raise "unknown debug flag char: #{ch.inspect}"
end
end
new(parse, rule, token, state, la, prec, conf)
end

def initialize(parse = false, rule = false, token = false, state = false,
la = false, prec = false, conf = false)
@parse = parse
@rule = rule
@token = token
@state = state
@la = la
@prec = prec
@any = (parse || rule || token || state || la || prec)
@status_logging = conf
end

attr_reader :parse
attr_reader :rule
attr_reader :token
attr_reader :state
attr_reader :la
attr_reader :prec

def any?
@any
end

attr_reader :status_logging
end

end
@@ -0,0 +1,13 @@
#
# $Id: d5858363d1d4a4b5a2ca8d193b5153a49312188e $
#
# Copyright (c) 1999-2006 Minero Aoki
#
# This program is free software.
# You can distribute/modify this program under the same terms of ruby.
# see the file "COPYING".

module Racc
class Error < StandardError; end
class CompileError < Error; end
end
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.