アプリ版:「スタンプのみでお礼する」機能のリリースについて

Extended regular expression matching and search library,

このソースコードを見ています。
構文解析ルーチンのような感じがしますが、
そう理解してよいのでしょうか?

 また、
LL(1)文法でかかれたものを
コンパイラコンパイラ(構文解析作成ソフト)
にかけたら、
これと同じような働きをするものを作れますか?
 もし可能なら、
参考になるサイト、文献などを教えてください。
LGPLライセンスで困っています。
これにつかまりたくないのです。

よろしくお願いします。

A 回答 (2件)

とりあえず、以下の二つのライブラリは(修正)BSDライセンスで配布されています。



Oniguruma ---- (C) K.Kosako
http://www.geocities.jp/kosako3/oniguruma/
License

When this software is partly used or it is distributed with Ruby,
this of Ruby follows the license of Ruby.
It follows the BSD license in the case of the one except for it.

PCRE LICENCE
------------

PCRE is a library of functions to support regular expressions whose syntax
and semantics are as close as possible to those of the Perl 5 language.


The latest release of PCRE is always available from

ftp://ftp.csx.cam.ac.uk/pub/software/programming …

Release 7 of PCRE is distributed under the terms of the "BSD" licence, as
specified below. The documentation for PCRE, supplied in the "doc"
directory, is distributed under the same terms as the software itself.


ただし関数のインターフェースに多少違う部分がありますので、差し替えるだけで
無修正でというわけにはいかないでしょう。

自前で作ってみたいという話なら…なにかあったかな?
    • good
    • 0
この回答へのお礼

ありがとうございました。
GPL

LGPL
では
だいぶ影響がちがうので
マニュアルにLGPLのファイルを
記述することにしました。
なんとなく2つを区別しないで考えていました。

お礼日時:2008/09/21 08:20

> 構文解析ルーチンのような感じがしますが、そう理解してよいのでしょうか?



Regular expression がどういったものなのかわかっていますか?

質問の内容が支離滅裂で、要するに何がしたいのかがわかりません。
LL文法とかいう単語が出てくるところをみると、プログラミング言語の構文解析をしたいのですか?

Regular expression を扱うためにコンパイラコンパイラは
あまり使わないんじゃないですかねえ。
わたしの記憶にはそういう例はありません。

> 参考になるサイト、文献などを教えてください。

Dragon Book.
http://www.amazon.co.jp/dp/0321486811

この回答への補足

/* Extended regular expression matching and search library,
* version 0.12.
* (Implements POSIX draft P1003.2/D11.2, except for some of the
* internationalization features.)
*
* Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
*
* This file is part of the GNU C Library. Its master source is NOT part of
* the C library, however. The master source lives in /gd/gnu/lib.
*
* The GNU C Library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* The GNU C Library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with the GNU C Library; see the file COPYING.LIB. If not,
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/

/*
* Modifications:
*
* Use _regex.h instead of regex.h. tlr, 1999-01-06
* Make REGEX_MALLOC depend on HAVE_ALLOCA &c.
* tlr, 1999-02-14
* Don't switch on regex debugging when debugging mutt.
* tlr, 1999-02-25
*/

/* The following doesn't mix too well with autoconfiguring
* the use of alloca. So let's disable it for AIX.
*/

#include "stdafx.h"

#if 0

/* AIX requires this to be the first thing in the file. */
# if defined (_AIX) && !defined (REGEX_MALLOC)
# pragma alloca
# endif

#endif

#undef_GNU_SOURCE
#define _GNU_SOURCE

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#undef DEBUG

#if (defined(HAVE_ALLOCA_H) && !defined(_AIX))
# include <alloca.h>
#endif
以下省略

上のようなソースコードが必要なのですが、
このままでは使えないので(LGPLのため)、
同じ働きをするソースコードを自分で作りたいのです。

正規表現が、BNF文法と同じに見えたので
構文解析ルーチンを作るのをまねれば
上のソースコードと同じ働きをする
物が作れるかなと思ったのです。

わかりづらくて
迷惑をおかけいたしました。
よろしくご指導ください。

補足日時:2008/09/19 07:09
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!