Skip to content

Commit f07b1a8

Browse files
committed
first commit
Signed-off-by: sxf <sunxfancy@gmail.com>
0 parents  commit f07b1a8

22 files changed

+1469
-0
lines changed

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
build/
2+
build-doc/
3+
__pycache__/
4+
*.pyc
5+
CMakeFiles/
6+
bin/
7+
lib/
8+
libcharsetdetect/
9+
*.cmake
10+
CMakeCache.txt
11+
conaninfo.txt
12+
Makefile

Authors

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## 请贡献者将自己添加到作者列表中,您的一点一滴贡献,都值得我们永远记忆 ##
2+
## 我们也会定期检查并更新该列表,以确认是否全部贡献都得到记录 ##
3+
## 以下列表按照字母序排列,母语非英语的贡献者可以将自己的母语名字添加到英文名后 ##
4+
5+
## Please contribute to the list of authors, your little bit of contribution, are worthy of our memory forever ##
6+
## We also periodically check and update the list to see if all contributions have been recorded ##
7+
## The following list is in alphabetical order, and contributors who are not native English speakers can add their native language names to English names ##
8+
9+
10+
Creator
11+
-------------
12+
13+
14+
15+
16+
17+
Contributor
18+
-------------
19+

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Change Log
2+
===============
3+
4+
### V0.1.1
5+
6+
7+
------------------------
8+
9+
### V0.1.0 2015-11-02
10+
11+
The first commit
12+
这是本项目的第一个版本

CMakeLists.txt

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
cmake_minimum_required(VERSION 2.8)
2+
project("proj")
3+
4+
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/build/conanbuildinfo.cmake)
5+
include(${CMAKE_CURRENT_SOURCE_DIR}/build/conanbuildinfo.cmake)
6+
else()
7+
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
8+
endif()
9+
conan_basic_setup()
10+
11+
SET(VERSION_MAJOR "0")
12+
SET(VERSION_MINOR "1")
13+
SET(VERSION_PATCH "0")
14+
15+
SET (CMAKE_BUILD_TYPE Debug) # 默认构建Debug模式
16+
17+
include_directories(src include)
18+
19+
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
20+
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
21+
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
22+
23+
24+
25+
file(GLOB_RECURSE source_files
26+
${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp
27+
)
28+
list(REMOVE_ITEM source_files ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp)
29+
30+
31+
# 生成动态库目标
32+
add_library(${PROJECT_NAME} SHARED ${source_files})
33+
# 生成静态库目标
34+
add_library(${PROJECT_NAME}_static STATIC ${source_files})
35+
36+
add_executable(${PROJECT_NAME}_run ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp)
37+
target_link_libraries(${PROJECT_NAME}_run ${PROJECT_NAME})
38+
39+
40+
# 指定静态库的输出名称
41+
set_target_properties(${PROJECT_NAME}_static PROPERTIES OUTPUT_NAME "${PROJECT_NAME}")
42+
43+
# 指定可执行文件的输出名称
44+
set_target_properties(${PROJECT_NAME}_run PROPERTIES OUTPUT_NAME "${PROJECT_NAME}")
45+
46+
# 使动态库和静态库同时存在
47+
set_target_properties(${PROJECT_NAME} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
48+
set_target_properties(${PROJECT_NAME}_static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
49+
50+
# 指定动态库版本
51+
# VERSION 动态库版本
52+
# SOVERSION API版本
53+
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} SOVERSION ${VERSION_MAJOR})
54+
55+
56+
add_subdirectory(doc)
57+
add_subdirectory(test)

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016 西风逍遥游
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Readme.md

Whitespace-only changes.

appveyor.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
platform:
2+
- x86
3+
- x86_64
4+
5+
configuration:
6+
- Release
7+
8+
clone_depth: 3
9+
10+
install:
11+
- git submodule update --init --recursive
12+
13+
before_build:
14+
- mkdir build
15+
- cd build
16+
- cmake -DCMAKE_BUILD_TYPE=Release ..
17+
18+
build_script:
19+
-

conanfile.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
from conans import ConanFile, CMake, tools
2+
import os
3+
4+
5+
class EstringConan(ConanFile):
6+
name = "estring"
7+
version = "1.0"
8+
license = "MIT"
9+
url = "<Package recipe repository url here, for issues about the package>"
10+
settings = "os", "compiler", "build_type", "arch"
11+
options = {"shared": [True, False]}
12+
default_options = "shared=False"
13+
generators = "cmake"
14+
15+
def source(self):
16+
self.run("git clone https://github.com/memsharded/hello.git")
17+
self.run("cd hello && git checkout static_shared")
18+
# This small hack might be useful to guarantee proper /MT /MD linkage in MSVC
19+
# if the packaged project doesn't have variables to set it properly
20+
tools.replace_in_file("hello/CMakeLists.txt", "PROJECT(MyHello)", '''PROJECT(MyHello)
21+
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
22+
conan_basic_setup()''')
23+
24+
def build(self):
25+
cmake = CMake(self.settings)
26+
shared = "-DBUILD_SHARED_LIBS=ON" if self.options.shared else ""
27+
self.run('cmake hello %s %s' % (cmake.command_line, shared))
28+
self.run("cmake --build . %s" % cmake.build_config)
29+
30+
def package(self):
31+
self.copy("*.h", dst="include", src="hello")
32+
self.copy("*hello.lib", dst="lib", keep_path=False)
33+
self.copy("*.dll", dst="bin", keep_path=False)
34+
self.copy("*.so", dst="lib", keep_path=False)
35+
self.copy("*.a", dst="lib", keep_path=False)
36+
37+
def package_info(self):
38+
self.cpp_info.libs = ["hello"]

doc/CMakeLists.txt

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FIND_PACKAGE(Doxygen)
2+
OPTION(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND})
3+
4+
IF(BUILD_DOCUMENTATION)
5+
IF(NOT DOXYGEN_FOUND)
6+
MESSAGE(FATAL_ERROR "Doxygen is needed to build the documentation.")
7+
ENDIF()
8+
9+
CONFIGURE_FILE(Doxyfile.in Doxyfile @ONLY)
10+
CONFIGURE_FILE(Doxyfile.zh-cn.in Doxyfile.zh-cn @ONLY)
11+
12+
file(GLOB_RECURSE MARKDOWN_DOC ${PROJECT_SOURCE_DIR}/doc/*.md)
13+
14+
add_custom_command(OUTPUT html
15+
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
16+
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.zh-cn
17+
DEPENDS ${MARKDOWN_DOC} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile*
18+
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
19+
)
20+
21+
ADD_CUSTOM_TARGET(doc
22+
ALL DEPENDS html
23+
COMMENT "Generating API documentation with Doxygen"
24+
VERBATIM)
25+
26+
INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/build-doc/html DESTINATION doc COMPONENT doc)
27+
ENDIF()

doc/Doxyfile.in

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
PROJECT_NAME = "@CMAKE_PROJECT_NAME@"
2+
PROJECT_NUMBER = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_RELEASE@
3+
STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@
4+
INPUT = @doxy_main_page@ \
5+
@PROJECT_SOURCE_DIR@
6+
OUTPUT_DIRECTORY = @PROJECT_SOURCE_DIR@/build-doc
7+
FILE_PATTERNS = *.h \
8+
*.cpp \
9+
*.en.md
10+
IMAGE_PATH = ./doc
11+
OUTPUT_LANGUAGE = English
12+
RECURSIVE = YES
13+
EXTRACT_ALL = YES
14+
EXTRACT_PRIVATE = YES
15+
EXTRACT_STATIC = YES
16+
BRIEF_MEMBER_DESC = YES
17+
REPEAT_BRIEF = YES
18+
EXCLUDE_PATTERNS = extlib build bin third_party cmake example lib header_libs
19+
USE_MDFILE_AS_MAINPAGE = index.en.md
20+
SEARCHENGINE = YES
21+
SERVER_BASED_SEARCH = NO
22+
REFERENCED_BY_RELATION = YES
23+
REFERENCES_RELATION = YES
24+
25+
#---------------------------------------------------------------------------
26+
# Configuration options related to the HTML output
27+
#---------------------------------------------------------------------------
28+
29+
GENERATE_HTML = YES
30+
HTML_OUTPUT = html
31+
HTML_FILE_EXTENSION = .html
32+
HTML_HEADER = ./doc/misc/header.html
33+
HTML_FOOTER = ./doc/misc/footer.html
34+
HTML_EXTRA_STYLESHEET = ./doc/misc/doxygenextra.css
35+
HTML_TIMESTAMP = YES
36+
DISABLE_INDEX = YES
37+
GENERATE_TREEVIEW = YES
38+
TREEVIEW_WIDTH = 250
39+
40+
GENERATE_LATEX = NO
41+
GENERATE_RTF = NO
42+
GENERATE_MAN = NO
43+
GENERATE_XML = NO

doc/Doxyfile.zh-cn.in

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
PROJECT_NAME = "@CMAKE_PROJECT_NAME@"
2+
PROJECT_NUMBER = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_RELEASE@
3+
STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@
4+
INPUT = @doxy_main_page@ \
5+
@PROJECT_SOURCE_DIR@
6+
OUTPUT_DIRECTORY = @PROJECT_SOURCE_DIR@/build-doc
7+
FILE_PATTERNS = *.h \
8+
*.cpp \
9+
*.cn.md
10+
11+
IMAGE_PATH = ./doc
12+
OUTPUT_LANGUAGE = Chinese
13+
RECURSIVE = YES
14+
EXTRACT_ALL = YES
15+
EXTRACT_PRIVATE = YES
16+
EXTRACT_STATIC = YES
17+
BRIEF_MEMBER_DESC = YES
18+
REPEAT_BRIEF = YES
19+
BUILTIN_STL_SUPPORT = YES
20+
EXCLUDE_PATTERNS = extlib build bin third_party cmake example lib header_libs
21+
USE_MDFILE_AS_MAINPAGE = index.zh-cn.md
22+
SEARCHENGINE = YES
23+
SERVER_BASED_SEARCH = NO
24+
REFERENCED_BY_RELATION = YES
25+
REFERENCES_RELATION = YES
26+
27+
#---------------------------------------------------------------------------
28+
# Configuration options related to the HTML output
29+
#---------------------------------------------------------------------------
30+
31+
GENERATE_HTML = YES
32+
HTML_OUTPUT = html/zh-cn
33+
HTML_FILE_EXTENSION = .html
34+
HTML_HEADER = ./doc/misc/header.html
35+
HTML_FOOTER = ./doc/misc/footer.html
36+
HTML_EXTRA_STYLESHEET = ./doc/misc/doxygenextra.css
37+
HTML_TIMESTAMP = YES
38+
DISABLE_INDEX = YES
39+
GENERATE_TREEVIEW = YES
40+
TREEVIEW_WIDTH = 250
41+
42+
GENERATE_LATEX = NO
43+
GENERATE_RTF = NO
44+
GENERATE_MAN = NO
45+
GENERATE_XML = NO

doc/index.cn.md

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Elite - 精锐编译器
2+
==================
3+
4+
Elite是一款脚本化驱动的编译器,一般的编程语言,语法是固定的,只能使用有限的表达方式,而Elite的语法并非固定,而是由脚本配置而成的,如果需要,随时都可以自由更改。
5+
6+
这个特点,使得Elite非常容易自由开发,成为一款领域专业语言(DSL),在自由配置后,方便地表达专业的相关内容。
7+
8+
## 其他语言文档
9+
10+
- [English Documents](../index.html)
11+
- [中文文档](#)
12+
13+
## 下载、使用和贡献代码
14+
15+
Elite是一款开源项目,任何人都可以免费使用,修改和发布该项目代码,遵循MIT协议。
16+
17+
- 下载:<https://github.com/elite-lang/Elite>
18+
- [编译安装指南](md-install.html)
19+
- [贡献本项目](md-develop.html)
20+
21+
## Elite语言正在解决哪方面的问题
22+
23+
在专用编程中,有很多东西很难用通用编程语言去描述,人们为了在通用语言中描述这些不好描述的内容,创建了配置文件。然而一旦不好描述的部分占了主体,那么势必造成配置过于繁琐,使用过于复杂等问题。针对这种情况,一般会开发领域专用语言,但问题依旧存在。领域专用语言,难以和通用语言例如C、Java,进行通信,较难使用可靠的开发库。
24+
25+
Elite是一款可自定语法的编程语言,通过自行配置语法,能够方便的定制需要的语言形式,从而将自己包装成一款领域专用语言,包装后的语言拥有和通用语言一样的编程能力,但又多了自定义的语法形式,避免了过度使用配置文档的问题。
26+
27+
## 什么项目适合用Elite开发
28+
29+
1. 专业领域的程序库
30+
2. 具有复杂难以理解配置项的软件包
31+
3. 拥有复杂抽象模型的软件框架
32+
4. 快速开发编译器语法原型
33+
5. 拥有特定语法的交互式控制台程序
34+
35+
36+
## 加入我们
37+
38+
目前,项目还处于开发初期,非常欢迎热爱开源的朋友们参加此项目,这是一个中等规模的C++项目,加入我们的团队,不但能够促进该项目更快的发展,更能带给您不一样的思路和体验。
39+
40+
希望和我们交流非常容易,可以选择发邮件或在github上直接和我们联系,都可以。
41+
42+
- github:<https://github.com/elite-lang/Elite>
43+
- 邮箱:<mailto:sunxfancy@gmail.com>
44+
- gitter:[参与讨论] (https://gitter.im/elite-lang/Elite?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
45+
46+
## 开源协议
47+
48+
MIT协议,允许任何人基于该项目开发其他项目,无论是开源的还是商业的,仅仅需要您在使用时,附带我们的版权声明即可。
49+
50+
## 关于本文档
51+
52+
本文档分为三部分,其一是用户帮助文档,其二是开发者文档,最后还包括全部代码的注释文档。本文档也属于开源项目的一部分,欢迎大家帮助我们完善和改进本文档。本文档使用Markdown格式编写,使用doxygen工具生成。
53+
54+
关于文档的构建与使用:[文件构建参考](md-doc.html)

0 commit comments

Comments
 (0)