Coder Social home page Coder Social logo

rexical's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.