Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

rexical is a lexical scanner generator for ruby

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 sample
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore ignore pkg director December 08, 2010
Octocat-spinner-32 CHANGELOG.rdoc
Octocat-spinner-32 DOCUMENTATION.en.rdoc
Octocat-spinner-32 DOCUMENTATION.ja.rdoc
Octocat-spinner-32 Manifest.txt
Octocat-spinner-32 README.ja
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
README.rdoc

Rexical

DESCRIPTION

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

SYNOPSIS

Here is a sample lexical definition:

class Sample
macro
  BLANK         [\ \t]+
rule
  BLANK         # no action
  \d+           { [:digit, text.to_i] }
  \w+           { [:word, text] }
  \n
  .             { [text, text] }
end

Here is the command line usage:

$ rex  sample1.rex  --stub
$ ruby sample1.rex.rb  sample1.c

$ rex  sample2.rex  --stub
$ ruby sample2.rex.rb  sample2.bas

$ racc calc3.racc
$ rex  calc3.rex
$ ruby calc3.tab.rb

REQUIREMENTS

  • ruby version 1.8.x or later.

INSTALL

  • sudo gem install rexical

LICENSE

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 (Rexical outputs). You can provide those files under any licenses you want.

Something went wrong with that request. Please try again.