[DRE-commits] [rexical] 03/04: Adding documentation

Balasankar C balasankarc-guest at moszumanska.debian.org
Thu May 14 19:00:48 UTC 2015


This is an automated email from the git hooks/post-receive script.

balasankarc-guest pushed a commit to branch master
in repository rexical.

commit e0cf8b45387ccb432e8f9152a3b790f4d0dbcec4
Author: Balasankar C <balasankarc at autistici.org>
Date:   Fri May 15 00:25:01 2015 +0530

    Adding documentation
---
 debian/en.html                  | 157 ++++++++++++++++++++++++++++++++++++++++
 debian/rex.1                    |  62 ++++++++++++++++
 debian/rexical.doc-base.rexical |  10 +++
 debian/rexical.docs             |   3 +
 debian/rexical.examples         |   1 +
 debian/rexical.manpages         |   1 +
 6 files changed, 234 insertions(+)

diff --git a/debian/en.html b/debian/en.html
new file mode 100644
index 0000000..0ec9f4e
--- /dev/null
+++ b/debian/en.html
@@ -0,0 +1,157 @@
+<?xml version="1.0" ?>
+<!DOCTYPE html 
+  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>DOCUMENTATION.en.rdoc</title>
+</head>
+<body>
+<h1><a name="label-0" id="label-0">REX: Ruby Lex for Racc</a></h1><!-- RDLabel: "REX: Ruby Lex for Racc" -->
+<h2><a name="label-1" id="label-1">About</a></h2><!-- RDLabel: "About" -->
+<pre>Lexical Scanner Generator for Ruby, with Racc.</pre>
+<h2><a name="label-2" id="label-2">Usage</a></h2><!-- RDLabel: "Usage" -->
+<pre>rex [options] grammarfile
+
+-o  --output-file  filename   designated output filename.
+-s  --stub                    append stub main for debug.
+-i  --ignorecase              ignore char case
+-C  --check-only              syntax check only.
+    --independent             independent mode.
+-d  --debug                   print debug information
+-h  --help                    print usage.
+    --version                 print version.
+    --copyright               print copyright.</pre>
+<h2><a name="label-3" id="label-3">Default Output Filename</a></h2><!-- RDLabel: "Default Output Filename" -->
+<pre>It destinate from foo.rex  to foo.rex.rb.
+This name is for a follow description.
+
+  require 'foo.rex' </pre>
+<h2><a name="label-4" id="label-4">Grammar File Format</a></h2><!-- RDLabel: "Grammar File Format" -->
+<pre>A definition is given in order of a header part, a rule part, 
+and the footer part.  One or more sections are included in a rule part.
+As for each section, the head of the sentence starts by the keyword.
+
+Summary:
+
+  [Header Part]
+  "class" Foo
+  ["option"
+    [options] ]
+  ["inner"
+    [methods] ]
+  ["macro"
+    [macro-name  regular-expression] ]
+  "rule"
+    [start-state]  pattern  [actions]
+  "end"
+  [Footer Part]</pre>
+<h3><a name="label-5" id="label-5">Grammar File Example</a></h3><!-- RDLabel: "Grammar File Example" -->
+<pre>class Foo
+macro
+  BLANK         \s+
+  DIGIT         \d+
+rule
+  {BLANK}
+  {DIGIT}       { [:NUMBER, text.to_i] }
+  .             { [text, text] }
+end</pre>
+<h2><a name="label-6" id="label-6">Header Part ( Optional )</a></h2><!-- RDLabel: "Header Part ( Optional )" -->
+<pre>All the contents described before the definition of a rule part are 
+posted to head of the output file.</pre>
+<h2><a name="label-7" id="label-7">Footer Part ( Optional )</a></h2><!-- RDLabel: "Footer Part ( Optional )" -->
+<pre>All the contents described after the definition of a rule part are 
+posted to tail of the output file.</pre>
+<h2><a name="label-8" id="label-8">Rule Part</a></h2><!-- RDLabel: "Rule Part" -->
+<pre>Rule part is from the line which begins from the "class" keyword 
+to the line which begins from the "end" keyword.
+The class name outputted after a keyword "class" is specified.
+If embellished with a module name, it will become a class in a module.
+The class which inherited Racc::Parser is generated.</pre>
+<h3><a name="label-9" id="label-9">Rule Header Example</a></h3><!-- RDLabel: "Rule Header Example" -->
+<pre>class Foo
+class Bar::Foo</pre>
+<h2><a name="label-10" id="label-10">Option Section ( Optional )</a></h2><!-- RDLabel: "Option Section ( Optional )" -->
+<pre>"option" is start keyword.
+
+  "ignorecase"  when pattern match, ignore char case.
+  "stub"        append stub main for debug.
+  "independent" independent mode, for it is not inherited Racc.</pre>
+<h2><a name="label-11" id="label-11">Inner Section ( Optional )</a></h2><!-- RDLabel: "Inner Section ( Optional )" -->
+<pre>"inner" is start keyword.
+The contents defined here are defined by the inside of the class 
+of the generated scanner.</pre>
+<h2><a name="label-12" id="label-12">Macro Section ( Optional )</a></h2><!-- RDLabel: "Macro Section ( Optional )" -->
+<pre>"macro" is start keyword.
+One regular expression is named.
+A blank character (0x20) can be included by escaping by \ .</pre>
+<h3><a name="label-13" id="label-13">Macro Section Example</a></h3><!-- RDLabel: "Macro Section Example" -->
+<pre>DIGIT         \d+
+IDENT         [a-zA-Z_][a-zA-Z0-9_]*
+BLANK         [\ \t]+
+REMIN         \/\*
+REMOUT        \*\/</pre>
+<h2><a name="label-14" id="label-14">Rule Section</a></h2><!-- RDLabel: "Rule Section" -->
+<pre>"rule" is start keyword.
+
+[state]  pattern  [actions]</pre>
+<h3><a name="label-15" id="label-15">state: Start State ( Optional )</a></h3><!-- RDLabel: "state: Start State ( Optional )" -->
+<pre>A start state is expressed with the identifier which prefaces ":".
+When the continuing alphabetic character is a capital letter, 
+it will be in an exclusive start state.
+When it is a small letter, it will be in an inclusive start state.
+Initial value and default value of a start state is nil.</pre>
+<h3><a name="label-16" id="label-16">pattern: String Pattern</a></h3><!-- RDLabel: "pattern: String Pattern" -->
+<pre>The regular expression for specifying a character string.
+The macro definition bundled with { } can be used for description 
+of a regular expression.  A macro definition is used in order to use 
+a regular expression including a blank.</pre>
+<h3><a name="label-17" id="label-17">actions: Processing Actions ( Optional )</a></h3><!-- RDLabel: "actions: Processing Actions ( Optional )" -->
+<pre>Action is performed when a pattern is suited.
+The processing which creates a suitable token is defined.
+The arrangement whose token has the second clause of classification 
+and a value, or nil.
+The following elements can be used in order to create a token.
+
+  lineno    Line number     ( Read Only )
+  text      Matched string  ( Read Only )
+  state     Start state     ( Read/Write )
+
+Action is bundled with { }.  It is the block of Ruby.
+Don't use the function to change the flow of control exceeding a block.
+( return, exit, next, break, ... )
+If action is omitted, the character string which matched will be canceled 
+and will progress to the next scan.</pre>
+<h3><a name="label-18" id="label-18">Rule Part Example</a></h3><!-- RDLabel: "Rule Part Example" -->
+<pre>{REMIN}                 { state = :REM ; [:REM_IN, text] }</pre>
+<dl>
+<dt><a name="label-19" id="label-19">REM  {REMOUT}                { state = nil ; [:REM_OUT, text] }</a></dt><!-- RDLabel: "REM  {REMOUT}                { state = nil ; [:REM_OUT, text] }" -->
+<dt><a name="label-20" id="label-20">REM  (.+)(?={REMOUT})        { [:COMMENT, text] }</a></dt><!-- RDLabel: "REM  (.+)(?={REMOUT})        { [:COMMENT, text] }" -->
+<dd>
+{BLANK}
+-?{DIGIT}               { [:NUMBER, text.to_i] }
+{WORD}                  { [:word, text] }
+.                       { [text, text] }
+</dd>
+</dl>
+<h2><a name="label-21" id="label-21">Comment ( Optional )</a></h2><!-- RDLabel: "Comment ( Optional )" -->
+<pre>From "#" to the end of the line becomes a comment in each line.</pre>
+<h2><a name="label-22" id="label-22">Usage for Generated Class</a></h2><!-- RDLabel: "Usage for Generated Class" -->
+<h3><a name="label-23" id="label-23">scan_setup()</a></h3><!-- RDLabel: "scan_setup()" -->
+<pre>The event for initializing at the time of the execution start of a scanner.
+It is redefined and used.</pre>
+<h3><a name="label-24" id="label-24">scan_str( str )</a></h3><!-- RDLabel: "scan_str( str )" -->
+<pre>Parse the string described by the defined grammar.
+Token is stored in an inside.</pre>
+<h3><a name="label-25" id="label-25">scan_file( filename )</a></h3><!-- RDLabel: "scan_file( filename )" -->
+<pre>Parse the file described by the defined grammar.
+Token is stored in an inside.</pre>
+<h3><a name="label-26" id="label-26">next_token</a></h3><!-- RDLabel: "next_token" -->
+<pre>One token stored in the inside is taken out.
+The last returns nil.</pre>
+<h2><a name="label-27" id="label-27">Notice</a></h2><!-- RDLabel: "Notice" -->
+<pre>This specification is provisional and may be changed without a preliminary 
+announcement.</pre>
+
+</body>
+</html>
diff --git a/debian/rex.1 b/debian/rex.1
new file mode 100644
index 0000000..eb06971
--- /dev/null
+++ b/debian/rex.1
@@ -0,0 +1,62 @@
+.TH rexical 1 "May 2015"
+.SH NAME
+.PP
+
+rex \- Ruby Lex for Racc
+.SH SYNOPSIS
+rex [options] grammarfile
+.PP
+.SH DESCRIPTION
+.PP
+Rexical is a lexical scanner generator that is used with Racc to generate Ruby programs.
+Rexical is written in Ruby.
+.SH OPTIONS
+.TP
+.fi
+.B
+\-o, \-\-output-file  filename
+designated output filename.
+.TP
+.fi
+.B
+\-s, \-\-stub
+append stub main for debug.
+.TP
+.fi
+.B
+\-i, \-\-ignorecase
+ignore char case
+.TP
+.fi
+.B
+\-C, \-\-check-only
+syntax check only.
+.TP
+.fi
+.B
+\-\-independent
+independent mode.
+.TP
+.fi
+.B
+\-d, \-\-debug
+print debug information
+.TP
+.fi
+.B
+\-h, \-\-help
+print usage.
+.TP
+.fi
+.B
+\-\-version
+print version.
+.TP
+.fi
+.B
+\-\-copyright
+print copyright.
+
+.SH SEE ALSO
+.PP
+/usr/share/doc/rexical/en.html (English)
diff --git a/debian/rexical.doc-base.rexical b/debian/rexical.doc-base.rexical
new file mode 100644
index 0000000..71fdcdf
--- /dev/null
+++ b/debian/rexical.doc-base.rexical
@@ -0,0 +1,10 @@
+Document: rexical
+Title: Rex Manual
+Author: ARIMA Yasuhiro
+Abstract: Rexical is a lexical scanner generator that is used with Racc to generate 
+ Ruby programs.
+Section: Programming/Ruby
+
+Format: HTML
+Index: /usr/share/doc/rexical/en.html
+Files: /usr/share/doc/rexical/*.html
diff --git a/debian/rexical.docs b/debian/rexical.docs
new file mode 100644
index 0000000..827c181
--- /dev/null
+++ b/debian/rexical.docs
@@ -0,0 +1,3 @@
+README.rdoc
+README.ja
+debian/en.html
diff --git a/debian/rexical.examples b/debian/rexical.examples
new file mode 100644
index 0000000..640e65f
--- /dev/null
+++ b/debian/rexical.examples
@@ -0,0 +1 @@
+sample/*
diff --git a/debian/rexical.manpages b/debian/rexical.manpages
new file mode 100644
index 0000000..fc931d1
--- /dev/null
+++ b/debian/rexical.manpages
@@ -0,0 +1 @@
+debian/rex.1

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/rexical.git



More information about the Pkg-ruby-extras-commits mailing list