commit 74bf959e4c82d5cef783aaa6eea5ec98cc41aa8e Author: gu-gu-gu Date: Fri Feb 14 10:53:34 2020 +0800 init package diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..4dce588 --- /dev/null +++ b/README.en.md @@ -0,0 +1,36 @@ +# antlr + +#### Description +{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} + +#### Software Architecture +Software architecture description + +#### Installation + +1. xxxx +2. xxxx +3. xxxx + +#### Instructions + +1. xxxx +2. xxxx +3. xxxx + +#### Contribution + +1. Fork the repository +2. Create Feat_xxx branch +3. Commit your code +4. Create Pull Request + + +#### Gitee Feature + +1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md +2. Gitee blog [blog.gitee.com](https://blog.gitee.com) +3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) +4. The most valuable open source project [GVP](https://gitee.com/gvp) +5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) +6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md new file mode 100644 index 0000000..d0ca23e --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# antlr + +#### 介绍 +{**以下是码云平台说明,您可以替换此简介** +码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 +无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} + +#### 软件架构 +软件架构说明 + + +#### 安装教程 + +1. xxxx +2. xxxx +3. xxxx + +#### 使用说明 + +1. xxxx +2. xxxx +3. xxxx + +#### 参与贡献 + +1. Fork 本仓库 +2. 新建 Feat_xxx 分支 +3. 提交代码 +4. 新建 Pull Request + + +#### 码云特技 + +1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md +2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) +3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 +4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 +5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) +6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/antlr-2.7.7-newgcc.patch b/antlr-2.7.7-newgcc.patch new file mode 100644 index 0000000..c501bd0 --- /dev/null +++ b/antlr-2.7.7-newgcc.patch @@ -0,0 +1,12 @@ +diff -up ./lib/cpp/antlr/CharScanner.hpp.sav ./lib/cpp/antlr/CharScanner.hpp +--- ./lib/cpp/antlr/CharScanner.hpp.sav 2009-03-20 14:42:43.000000000 -0400 ++++ ./lib/cpp/antlr/CharScanner.hpp 2009-03-20 14:43:29.000000000 -0400 +@@ -11,6 +11,8 @@ + #include + + #include ++#include ++#include + + #ifdef HAS_NOT_CCTYPE_H + #include diff --git a/antlr-2.7.7.pom b/antlr-2.7.7.pom new file mode 100644 index 0000000..354e82d --- /dev/null +++ b/antlr-2.7.7.pom @@ -0,0 +1,22 @@ + + 4.0.0 + antlr + antlr + jar + 2.7.7 + AntLR Parser Generator + + A framework for constructing recognizers, compilers, + and translators from grammatical descriptions containing + Java, C#, C++, or Python actions. + + http://www.antlr.org/ + + + BSD License + http://www.antlr.org/license.html + repo + + + + diff --git a/antlr-2.7.7.tar.gz b/antlr-2.7.7.tar.gz new file mode 100644 index 0000000..e06850c Binary files /dev/null and b/antlr-2.7.7.tar.gz differ diff --git a/antlr-build.xml b/antlr-build.xml new file mode 100644 index 0000000..d280255 --- /dev/null +++ b/antlr-build.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/antlr-examples-license.patch b/antlr-examples-license.patch new file mode 100644 index 0000000..14dda64 --- /dev/null +++ b/antlr-examples-license.patch @@ -0,0 +1,98 @@ +diff -up antlr-2.7.7/examples/java/unicode.IDENTs/ShowString.java.licensefix antlr-2.7.7/examples/java/unicode.IDENTs/ShowString.java +--- antlr-2.7.7/examples/java/unicode.IDENTs/ShowString.java.licensefix 2012-08-16 10:16:12.157567962 -0400 ++++ antlr-2.7.7/examples/java/unicode.IDENTs/ShowString.java 2012-08-16 10:17:46.425574161 -0400 +@@ -1,19 +1,33 @@ + + /* +- * Copyright (c) 1995-1998 Sun Microsystems, Inc. All Rights Reserved. ++ * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. + * +- * Permission to use, copy, modify, and distribute this software +- * and its documentation for NON-COMMERCIAL purposes and without +- * fee is hereby granted provided that this copyright notice +- * appears in all copies. Please refer to the file "copyright.html" +- * for further important copyright and licensing information. ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: + * +- * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF +- * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +- * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +- * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR +- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR +- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. ++ * - Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * ++ * - Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * - Neither the name of Oracle or the names of its ++ * contributors may be used to endorse or promote products derived ++ * from this software without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + import java.awt.*; +diff -up antlr-2.7.7/examples/java/unicode.IDENTs/StreamConverter.java.licensefix antlr-2.7.7/examples/java/unicode.IDENTs/StreamConverter.java +--- antlr-2.7.7/examples/java/unicode.IDENTs/StreamConverter.java.licensefix 2012-08-16 10:18:24.649576674 -0400 ++++ antlr-2.7.7/examples/java/unicode.IDENTs/StreamConverter.java 2012-08-16 10:18:49.002578275 -0400 +@@ -1,19 +1,33 @@ + + /* +- * Copyright (c) 1995-1998 Sun Microsystems, Inc. All Rights Reserved. ++ * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. + * +- * Permission to use, copy, modify, and distribute this software +- * and its documentation for NON-COMMERCIAL purposes and without +- * fee is hereby granted provided that this copyright notice +- * appears in all copies. Please refer to the file "copyright.html" +- * for further important copyright and licensing information. ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: + * +- * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF +- * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +- * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +- * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR +- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR +- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. ++ * - Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * ++ * - Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * - Neither the name of Oracle or the names of its ++ * contributors may be used to endorse or promote products derived ++ * from this software without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + import java.io.*; diff --git a/antlr-script b/antlr-script new file mode 100644 index 0000000..6389106 --- /dev/null +++ b/antlr-script @@ -0,0 +1,25 @@ +#!/bin/sh +# +# antlr script +# JPackage Project + +# Source functions library +if [ -f /usr/share/java-utils/java-functions ] ; then + . /usr/share/java-utils/java-functions +else + echo "Can't find functions library, aborting" + exit 1 +fi + +# Configuration +MAIN_CLASS="antlr.Tool" +BASE_FLAGS="" +BASE_JARS="antlr.jar" + +# Set parameters +set_jvm +set_classpath $BASE_JARS +set_flags $BASE_FLAGS + +# Let's start +run "$@" diff --git a/antlr.spec b/antlr.spec new file mode 100644 index 0000000..ec5ee4d --- /dev/null +++ b/antlr.spec @@ -0,0 +1,128 @@ +%global debug_package %{nil} + +Name: antlr +Version: 2.7.7 +Release: 58 +Summary: A parser generator that uses LL(*) for parsing +Epoch: 0 +License: ANTLR-PD +URL: http://www.antlr2.org/ +Source0: https://www.antlr2.org/download/antlr-2.7.7.tar.gz +Source1: %{name}-build.xml +Source2: %{name}-script +Source3: http://repo2.maven.org/maven2/antlr/antlr/%{version}/%{name}-%{version}.pom +Patch0001: antlr-2.7.7-newgcc.patch +Patch0002: antlr-examples-license.patch + +BuildRequires: gcc-c++ make ant java-devel >= 1:1.7.0 java-javadoc javapackages-local +BuildRequires: doxygen graphviz python2-devel python2-setuptools + +%description +ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, +processing, executing, or translating structured text or binary files. + +%package tool +Summary: A parser generator that uses LL(*) for parsing +Provides: %{name} = %{version}-%{release} +BuildArch: noarch + +%description tool +ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, +processing, executing, or translating structured text or binary files. + +%package help +Summary: Help document for antlr +Provides: %{name}-manual = %{epoch}:%{version}-%{release} %{name}-javadoc = %{epoch}:%{version}-%{release} +Obsoletes: %{name}-manual < %{epoch}:%{version}-%{release} %{name}-javadoc < %{epoch}:%{version}-%{release} +BuildArch: noarch + +%description help +Help document for antlr. + +%package C++ +Summary: C++ library for antlr generated parsers +Provides: antlr-static = %{version}-%{release} + +%description C++ +This package provides a static C++ library for parsers. + +%package C++-doc +Summary: Documentation for C++ library +BuildArch: noarch + +%description C++-doc +This package contains the documentation for C++ library. + +%package -n python2-antlr +Summary: Python Code Generator for ANTLR +%{?python_provide:%python_provide python2-%{name}} +Provides: %{name}-python = %{version}-%{release} +Obsoletes: %{name}-python < 2.7.7-48 +BuildArch: noarch + +%description -n python2-antlr +Generate Lexers, Parsers and TreeParsers in Python. + +%prep +%autosetup -n %{name}-%{version} -p1 +find . -name "*.jar" -exec rm -f {} \; +cp -p %{SOURCE1} build.xml +sed -i 's/\r//' LICENSE.txt + +%mvn_file antlr:antlr antlr + +%build +ant -Dj2se.apidoc=%{_javadocdir}/java +cp work/lib/antlr.jar . +export CLASSPATH=. +%configure --without-examples +make CXXFLAGS="${CXXFLAGS} -fPIC" DEBUG=1 verbose=1 +rm antlr.jar doc/{Makefile,Makefile.in} +chmod 0644 doc/* + +cd lib/cpp + doxygen doxygen.cfg + find gen_doc -type f -exec chmod 0644 {} \; +cd - + +cd lib/python +%py2_build +cd ../../ + +%install +%mvn_artifact %{SOURCE3} work/lib/%{name}.jar +%mvn_alias %{name}:%{name} %{name}:%{name}all +%mvn_install -J work/api + +install -Dp -m755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/antlr +install -d $RPM_BUILD_ROOT%{_includedir}/%{name} +install -p -m644 lib/cpp/antlr/*.hpp $RPM_BUILD_ROOT%{_includedir}/%{name} +install -Dp -m644 lib/cpp/src/libantlr.a $RPM_BUILD_ROOT%{_libdir}/libantlr.a +install -p -m755 scripts/antlr-config $RPM_BUILD_ROOT%{_bindir}/antlr-config + +cd lib/python +%py2_install +cd ../.. + +%files tool -f .mfiles +%license LICENSE.txt +%{_bindir}/antlr + +%files C++ +%{_includedir}/%{name} +%{_libdir}/libantlr.a +%{_bindir}/antlr-config + +%files C++-doc +%doc lib/cpp/gen_doc/html/ + +%files help -f .mfiles-javadoc +%doc doc/* + +%files -n python2-%{name} +%{python2_sitelib}/antlr/* +%{python2_sitelib}/antlr-* + +%changelog +* Tue Jan 21 2020 chenli - 2.7.7-58 +- Package init