1 Star 0 Fork 1

秋来冬风 / U语言

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

U语言

项目已经迁移到 https://gitee.com/u-language/u-language

介绍

U语言是开发者对编译技术的实践,更多的是开发者对编译技术的实验。


重大事件记录

2023/1/23 无限期暂停开发mode=fasm模式:自2022年8月实现一个实验性的将ast转换为fasm汇编代码功能以来,fasm/amd64及其配套的包,消耗了最多的时间,写出的代码可维护性最差,可读性最差,实现的功能最差,严重拖慢了开发进度,现在决定无限期暂停开发mode=fasm模式。


源码编译依赖

go 版本 1.18+


安装教程

  1. 下载源代码
  2. cd pkg
  3. go build main.go

编译器工作流程

graph TD
err(报错退出 errcode)
lex(词法分析器 lex)
ast(抽象语法树 ast)
types(类型检查器 types)
cast(C代码转换器 cast)
amd64(汇编转换器 fasm/amd64)
ir(中间表示 ir)
fd(结果输出)
main(入口) -->parser(解析器 parser)
parser --调用--> lex --发现代码错误-->err
lex --结果转换ast--> ast --发现代码错误-->err
ast --类型检查--> types --发现代码错误-->err
types -.mode==c.-> cast
types -.mode==fasm.-> amd64 
cast --> fd
amd64 --调用了--> ir
amd64 --> fd

参与贡献

  1. Fork 本仓库
  2. 新建 Fork_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
BSD 3-Clause License Copyright (c) 2022, 秋来冬风 All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * 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 the copyright holder nor 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 HOLDER 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.

简介

U语言是开发者对编译技术的实践,更多的是开发者对编译技术的实验。 展开 收起
Go
BSD-3-Clause
取消

发行版 (7)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/qiulaidongfeng/u-language.git
git@gitee.com:qiulaidongfeng/u-language.git
qiulaidongfeng
u-language
U语言
master

搜索帮助