rexical is a lexical scanner generator for ruby
Ruby Other
Latest commit b822313 Jul 17, 2014 @tenderlove Merge pull request #4 from s-marshall/master
Update English README and DOCUMENTATION
Permalink
Failed to load latest commit information.
bin renaming to rex to rexical Jun 7, 2009
lib
sample Fixed broken samples and readme wrt macros, which need to be surround… Jul 16, 2014
test
.gitignore ignore pkg director Dec 8, 2010
CHANGELOG.rdoc fixing scanner states Dec 14, 2010
DOCUMENTATION.en.rdoc Update DOCUMENTATION.en.rdoc Aug 13, 2012
DOCUMENTATION.ja.rdoc moving around documentation adding manifest Jul 23, 2008
Manifest.txt fixing manifest Jul 1, 2009
README.ja
README.rdoc Merge pull request #4 from s-marshall/master Jul 16, 2014
Rakefile removed rubyforge_name from rakefile Apr 17, 2014

README.rdoc

Rexical

DESCRIPTION

Rexical is a lexical scanner generator that is used with Racc to generate Ruby programs. Rexical is written in Ruby.

SYNOPSIS

Several examples of Rexical grammar files are provided in the sample directory.

Here is an example of a lexical definition:

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

Here are examples of 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

The description files for lexical analysis in the sample directory are the files ending with the .rex extension.

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.