1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
= Rexical
home :: http://github.com/sparklemotion/rexical/tree/master
== 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.
See COPYING for more details.
|