Skip to content

Commit

Permalink
update md
Browse files Browse the repository at this point in the history
  • Loading branch information
lfkdsk committed Sep 19, 2016
1 parent 819ad3b commit 9ac1391
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 50 deletions.
51 changes: 1 addition & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ Exercise for learn knowledge about computer language compile.
>
> Dev TimeLine : [TimeLine](TimeLine.md)
>
> 科科 所谓蛤语言
[![](https://jitpack.io/v/lfkdsk/HobbyScript.svg)](https://jitpack.io/#lfkdsk/HobbyScript)

![](Tmp/mo.png)

### With Gradle

Step 1. Add the JitPack repository to your build file
Expand All @@ -35,53 +32,7 @@ Step 2. Add the dependency

### Introduction

>如果想了解正经的编译原理的学习和实现可以参考:
>
>1. [master-branch](https://github.com/lfkdsk/HobbyScript) 项目的主分支一种弱类型语言的解释器和局部中间代码编译器的实现。
>2. [hh-runtime](https://github.com/lfkdsk/HobbyScript/tree/hh-runtime) 正在通过将HobbyScript转换到Java然后运行在JVM上的分支。
>3. [time-line](https://github.com/lfkdsk/HobbyScript/blob/master/TimeLine.md) 开发过程中的TimeLine
>4. [若梦浮生](http://lfkdsk.github.io/) 我的博客里有相关的博文。
我的经历呢,就是上学期上过了编译原理这门课,然后参照学过的知识开发了HobbyScript这个只有学习性和练习性的编程语言。看到逼乎上有人发图在C++里通过宏定义实现的膜法(大概是什么鬼的中文编程的问题里的回答)。然后呢我就修改了词法分析里面的正则匹配模式(没错,词法分析偷懒用了正则=-=),抓取中文token,就有了[hh-zh](https://github.com/lfkdsk/HobbyScript/tree/hh-zh) 这个实现“中文编程”的奇怪分支。

之后我就想搞一门从词法分析开始的膜法而不是只使用宏定义,之前master分支已经写好了,所以修改只需要修改一些Token 规则就可以了,然后我就提交了一份"branch for ha" ,仅供娱乐。修改“hh-ha”大概做了三件事:

1. 修改正则规则
2. 修改Token关键字和native函数关键字
3. +1s

### 语法规则

语法部分参考 [time-line](https://github.com/lfkdsk/HobbyScript/blob/master/TimeLine.md) 的语法规则部分。

### 关键字对照表

由于这个分支是从之前的版本分出来的所以真值类型的支持有问题233333。

| Token | HaToken |
| :----------------------- | :-------: |
| if | 如果你一定要问我 |
| else | 我一句话不说也不好 |
| while | 问来问去 |
| function | 搞个大新闻 |
| true | 吼啊 |
| false | 没听说过 |
| break | 跑得比谁都快 |
| closure | 人生经验 |
| class | 西方那一套 |
| initial | 扬州 |
| this ||
| super | 长者 |
| import | 滋词 |
| logInfo(native function) | 谈笑风生 |

我还没想好for关键字应该怎么设定,大家来众筹啊!

### Picture

运行图:

![ha](Tmp/ha.png)
**无可奉告!**

## License

Expand Down
Binary file removed Tmp/ha.png
Binary file not shown.
Binary file removed Tmp/mo.png
Binary file not shown.

0 comments on commit 9ac1391

Please sign in to comment.