Skip to content

Commit

Permalink
renaming to rex to rexical
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Jun 7, 2009
1 parent 3a23828 commit 6d9a629
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 38 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rdoc
@@ -1,3 +1,9 @@
=== 1.0.3

* Bug fixes

* renamed to "Rexical" because someone already has "rex".

=== 1.0.2

* Bug fixes
Expand Down
10 changes: 5 additions & 5 deletions README.ja
@@ -1,7 +1,7 @@
Rex README
Rexical README
===========

Rex �� Ruby �Τ���Υ�����ʥ����ͥ졼���Ǥ���
Rexical �� Ruby �Τ���Υ�����ʥ����ͥ졼���Ǥ���
lex �� Ruby �Ǥ��������ޤ���
Racc �ȤȤ�˻Ȥ��褦���߷פ���Ƥ��ޤ���

Expand Down Expand Up @@ -35,7 +35,7 @@ Rex README
�ƥ���
------

sample/ �ʲ��ˤ����Ĥ� Rex ��ʸˡ�ե�����Υ���ץ뤬�Ѱ�
sample/ �ʲ��ˤ����Ĥ� Rexical ��ʸˡ�ե�����Υ���ץ뤬�Ѱ�
���Ƥ���ޤ����ʲ���¹Ԥ��Ƥ���������

$ rex sample1.rex --stub
Expand All @@ -48,7 +48,7 @@ Rex README
$ rex calc3.rex
$ ruby calc3.tab.rb

Rex �ξܤ���ʸˡ�� doc/ �ǥ��쥯�ȥ�ʲ��򸫤Ƥ���������
Rexical �ξܤ���ʸˡ�� doc/ �ǥ��쥯�ȥ�ʲ��򸫤Ƥ���������
�ޤ�������� sample/ �ǥ��쥯�ȥ�ʲ��򸫤Ƥ���������


Expand All @@ -63,7 +63,7 @@ Rex README
�Х��ʤ�
--------

Rex ��ȤäƤ��ƥХ��餷�����ݤ����������顢�����Υ��ɥ쥹�ޤ�
Rexical ��ȤäƤ��ƥХ��餷�����ݤ����������顢�����Υ��ɥ쥹�ޤ�
�᡼��򤯤�������
���ΤȤ��ϤǤ�������Х���Ƹ��Ǥ���ʸˡ�ե�������դ��Ƥ���������

Expand Down
13 changes: 6 additions & 7 deletions README.rdoc
@@ -1,11 +1,10 @@
= Rex
= Rexical

* http://rex.rubyforge.org
* http://github.com/aaronp/rex/tree/master
* http://github.com/tenderlove/rexical/tree/master

== DESCRIPTION

Rex is a lexical scanner generator.
Rexical is a lexical scanner generator.
It is written in Ruby itself, and generates Ruby program.
It is designed for use with Racc.

Expand Down Expand Up @@ -43,11 +42,11 @@ Here is the command line usage:

== INSTALL

* sudo gem install rex
* sudo gem install rexical

== LICENSE

Rex is distributed under the terms of the GNU Lesser General
Rexical is distributed under the terms of the GNU Lesser General
Public License version 2. Note that you do NOT need to follow
LGPL for your own parser (Rex outputs). You can provide those
LGPL for your own parser (Rexical outputs). You can provide those
files under any licenses you want.
5 changes: 3 additions & 2 deletions Rakefile
Expand Up @@ -4,12 +4,13 @@ require 'rubygems'
require 'hoe'

$LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')
require 'rex'
require 'rexical'

HOE = Hoe.new('rex', Rex::VERSION) do |p|
HOE = Hoe.new('rexical', Rexical::VERSION) do |p|
p.readme_file = 'README.rdoc'
p.history_file = 'CHANGELOG.rdoc'
p.developer('Aaron Patterson', 'aaronp@rubyforge.org')
p.rubyforge_name = 'ruby-rex'
p.extra_rdoc_files = FileList['*.rdoc']
end

Expand Down
4 changes: 2 additions & 2 deletions bin/rex
Expand Up @@ -13,6 +13,6 @@
## ---------------------------------------------------------------------

require 'rubygems'
require 'rex'
require 'rexical'

Rex::Cmd.new.run
Rexical::Cmd.new.run
3 changes: 0 additions & 3 deletions lib/rex.rb

This file was deleted.

3 changes: 3 additions & 0 deletions lib/rexical.rb
@@ -0,0 +1,3 @@
require 'rexical/generator'
require 'rexical/info'
require 'rexical/rexcmd'
6 changes: 3 additions & 3 deletions lib/rex/generator.rb → lib/rexical/generator.rb
Expand Up @@ -9,7 +9,7 @@
#

require 'strscan'
module Rex
module Rexical

## ---------------------------------------------------------------------
class ParseError < StandardError ; end
Expand Down Expand Up @@ -388,7 +388,7 @@ def write_scanner f = scanner_io
flag = ""
flag += "i" if @opt['--ignorecase']
## header
f.printf REX_HEADER, Rex::VERSION, grammar_file
f.printf REX_HEADER, Rexical::VERSION, grammar_file

unless @opt['--independent']
f.printf "require 'racc/parser'\n"
Expand Down Expand Up @@ -514,7 +514,7 @@ def scan_evaluate( str )
## test

if __FILE__ == $0
rex = Rex::Generator.new(nil)
rex = Rexical::Generator.new(nil)
rex.grammar_file = "sample.rex"
rex.read_grammar
rex.parse
Expand Down
2 changes: 1 addition & 1 deletion lib/rex/info.rb → lib/rexical/info.rb
Expand Up @@ -8,7 +8,7 @@
# the GNU Lesser General Public License version 2 or later.
#

module Rex
module Rexical
VERSION = '1.0.2'
Copyright = 'Copyright (c) 2005-2006 ARIMA Yasuhiro'
Mailto = 'arima.yasuhiro@nifty.com'
Expand Down
12 changes: 6 additions & 6 deletions lib/rex/rexcmd.rb → lib/rexical/rexcmd.rb
Expand Up @@ -12,7 +12,7 @@
## ---------------------------------------------------------------------

require 'getoptlong'
module Rex
module Rexical

class Cmd
OPTIONS = <<-EOT
Expand All @@ -35,7 +35,7 @@ def run
usage 'too many grammar files given' if ARGV.size > 1
filename = ARGV[0]

rex = Rex::Generator.new(@opt)
rex = Rexical::Generator.new(@opt)
begin
rex.grammar_file = filename
rex.read_grammar
Expand All @@ -47,7 +47,7 @@ def run
rex.write_scanner
@status = 0

rescue Rex::ParseError, Errno::ENOENT
rescue Rexical::ParseError, Errno::ENOENT
msg = $!.to_s
unless /\A\d/ === msg
msg[0,0] = ' '
Expand Down Expand Up @@ -91,12 +91,12 @@ def initialize
usage if @opt['--help']

if @opt['--version']
puts "#{@cmd} version #{Rex::Version}"
puts "#{@cmd} version #{Rexical::Version}"
exit 0
end
if @opt['--copyright']
puts "#{@cmd} version #{Rex::Version}"
puts "#{Rex::Copyright} <#{Rex::Mailto}>"
puts "#{@cmd} version #{Rexical::Version}"
puts "#{Rexical::Copyright} <#{Rexical::Mailto}>"
exit 0
end
end
Expand Down
18 changes: 9 additions & 9 deletions test/test_generator.rb
@@ -1,11 +1,11 @@
require 'test/unit'
require 'tempfile'
require 'rex'
require 'rexical'
require 'stringio'

class TestGenerator < Test::Unit::TestCase
def test_header_is_written_after_module
rex = Rex::Generator.new(
rex = Rexical::Generator.new(
"--independent" => true
)
rex.grammar_file = File.join File.dirname(__FILE__), 'assets', 'test.rex'
Expand All @@ -26,15 +26,15 @@ def test_header_is_written_after_module
end

def test_read_non_existent_file
rex = Rex::Generator.new(nil)
rex = Rexical::Generator.new(nil)
rex.grammar_file = 'non_existent_file'
assert_raises Errno::ENOENT do
rex.read_grammar
end
end

def test_scanner_inherits
rex = Rex::Generator.new(
rex = Rexical::Generator.new(
"--independent" => true
)
rex.grammar_lines = StringScanner.new %q{
Expand All @@ -53,7 +53,7 @@ class Calculator < Bar
end

def test_scanner_inherits_many_levels
rex = Rex::Generator.new(
rex = Rexical::Generator.new(
"--independent" => true
)
rex.grammar_lines = StringScanner.new %q{
Expand All @@ -72,7 +72,7 @@ class Calculator < Foo::Bar
end

def test_simple_scanner
rex = Rex::Generator.new(
rex = Rexical::Generator.new(
"--independent" => true
)
rex.grammar_lines = StringScanner.new %q{
Expand Down Expand Up @@ -101,7 +101,7 @@ class Calculator
end

def test_simple_scanner_with_macros
rex = Rex::Generator.new(
rex = Rexical::Generator.new(
"--independent" => true
)
rex.grammar_lines = StringScanner.new %q{
Expand Down Expand Up @@ -132,7 +132,7 @@ class Calculator
end

def test_nested_macros
rex = Rex::Generator.new(
rex = Rexical::Generator.new(
"--independent" => true
)
rex.grammar_lines = StringScanner.new %q{
Expand All @@ -153,7 +153,7 @@ class Calculator
end

def test_more_nested_macros
rex = Rex::Generator.new(
rex = Rexical::Generator.new(
"--independent" => true
)
rex.grammar_lines = StringScanner.new %q{
Expand Down

0 comments on commit 6d9a629

Please sign in to comment.