电子发烧友App

硬声App

0
  • 聊天消息
  • 系统消息
  • 评论与回复
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
创作中心

完善资料让更多小伙伴认识你,还能领取20积分哦,立即完善>

3天内不再提示
电子发烧友网>电子资料下载>电子资料>jMiniLang Kotlin实现的编译器和虚拟机

jMiniLang Kotlin实现的编译器和虚拟机

2022-06-10 | zip | 5.19 MB | 次下载 | 免费

资料介绍

授权协议 MIT
开发语言 Kotlin
操作系统 跨平台
软件类型 开源软件
所属分类 开发工具编译器

软件简介

jMiniLang 项目是一个 LR 编译器、虚拟机一体化工程,并且对虚拟机进行了拓展,参考了操作系统设计的思想。

Features(特性)

  1. 词法分析阶段。Lexer which generates NFA and DFA.
  2. 语法分析、词法分析、制导翻译。Parser which implements LALR(1) Grammar with optional semantic action.
  3. 语义分析。Customized semantic analysis.
  4. 可打印语法树。Printable syntax tree.
  5. 基于栈的自定义指令集。Stack-based instruction design.
  6. Kotlin本地方法导入。Native method.
  7. 代码页导入/导出。Import and export of code page.
  8. 代码页序列化。Serializable code page.
  9. 匿名函数及闭包。Lambda functions and Closure.
  10. 语法/词法错误提示。Display grammar and semantic errors.
  11. 管道机制。Pipe.
  12. 多进程机制。Multiple process.
  13. 同步/异步执行代码。Load file with Sync/Async.
  14. 虚拟机。Virtual machine.
  15. 支持彩色界面。Support Colorful GUI.
  16. 函数式编程Functional programming.
  17. LISP.
  18. 网络流。Socket stream.
  19. 虚拟文件系统。Save/Load file or VFS.
  20. 基于原型的类设计。Class prototype.
  21. Bash Interface.
  22. 数组/词典初始化。Array/Map initialize list.
  23. 异常机制。Try/Catch/Throw.
  24. 行为树。Behavior Tree, including PC network simulator.
  25. 用户级进程。RING 3 Process, including User Service, fork.
  26. 网页服务器。Web Server, including Online Compiler and Runner.
  27. C语言解析。CParser class on ModuleUser.

What it generates(产生)

  • 正则表达式、状态机。Structures of Regex, NFA and DFA Table.
  • 分析表。Structures of LL/LR Table.
  • 语义分析指令。Structures of semantic instructions.
  • 语法树。Structures of syntax tree.
  • 代码页。Structures of code page.
  • 虚拟机指令。Virtual machine instructions.
  • 运行时环境。Runtime environment.

Virtual Machine OS

An OS running on jMiniLang compiler and interpreter.

Now has commands:(现在主窗口支持的cmd命令)

  • echo
  • dup
  • pipe
  • grep
  • proc
  • range
  • task
  • sleep
  • time
  • count
  • msg
  • news(refer: https://github.com/bajdcc/NewsApp)
  • bash
  • replace
  • util
  • ai
  • pc
  • music

Tasks:(使用方法如:@system halt

  • System
  • Utility
  • Remote
  • UI
  • Store
  • Proc

UI:(使用方法如:@ui on clock

  • Clock
  • Hitokoto
  • Monitor

Toggle UI:

  • task ui on/off clock
  • task ui on/off hitokoto
  • task ui on/off monitor

Implemented IPC, usage:(微服务)

  • task system now -> Get system time
  • task util calc 1+2*3 -> Val = 7
  • task ui print hello world -> Remote window
  • task ui path M 100 100 L 200 200 -> SVG

Utility:

  • task util doc g_func_fold -> Document
  • task util reverse ...
  • task util toupper ...
  • task util sum ...
  • task util product ...
  • task util palindrome ...

Tests:(测试命令,直接在主窗口cmd输入,Ctrl-C中止)

  • test philo/philo2: Multi-processing and synchronization
  • test lisp: LISP language
  • test font: Support Chinese Language(wide font)
  • test fork: Test fork
  • test class: Test AOP and Prototype for class
  • test bash: Test bash interface
  • test try: Test try/catch
  • test badapple: Test ascii output, code in BadApple
  • test dialog: Test JOptionPane.showXXXDialog
  • test linq: Test LINQ
  • test proc: Test Ring 3 API
  • test proc2: Test Ring 3 code with input
  • test web: HTTP Web Server

Implemented MSG, usage:(远程控制)

  • Create server: msg server PORT | filter pipe
  • Create client: other pipe | msg connect IP:PORT

PC command:

  • pc add A 10 10 100 100
  • pc remove A
  • pc msg A B

LINQ:

  • from(list) or from(array)
  • range(begin, end)
  • Function: select, where, first, last, max, sum, for_each, group_by, distinct, union, etc.

TASK PROC:

  • exec:执行代码
  • exec_file:读文件执行代码
  • kill:中止用户进程
  • info:取得用户进程状态(用于浏览器远程回调)

USER HANDLE:(用户级进程支持的句柄种类)

  • pipe:管道,类似Go中的chan,用于跨进程同步,读阻塞,写不阻塞。
  • share:共享,同步跨进程数据共享。
  • file:文件,虚拟文件接口,同步操作。
  • window:窗口,创建JFrame窗口,异步,包括绘制、消息。
  • net:网络,包括HTTP请求,OkHttp实现,异步。

Dependencies:(使用的开源库,下面为部分)

  • JSON格式化:fastjson
  • 实现远程命令SSH:netty
  • 后端及API:spring-boot
  • 网页模版:thymeleaf
  • 前端交互:vue
  • 前端样式:layui
  • Markdown文档转换:flexmark
  • 数据结构:guava
  • HTTP请求:okhttp
  • JAR打包:shadow

Manual

Simplified Chinese Version

Example

Web Server

  1. Spring Boot API, port 8080
  2. Java NIO, port 8088
  3. Render Markdown using FlexMark

Front-end: LayUI(前端)

1. Spring Boot API

Front-end: LayUI + Vue.js API: Json + RestController

Back-end: jMiniLang API Handler (RING 3 Process)

Run on Server

** Online Compiler Example V: GUI User Window **

 

下载该资料的人也在下载 下载该资料的人还在阅读
更多 >

评论

查看更多

下载排行

本周

  1. 1山景DSP芯片AP8248A2数据手册
  2. 1.06 MB  |  532次下载  |  免费
  3. 2RK3399完整板原理图(支持平板,盒子VR)
  4. 3.28 MB  |  339次下载  |  免费
  5. 3TC358743XBG评估板参考手册
  6. 1.36 MB  |  330次下载  |  免费
  7. 4DFM软件使用教程
  8. 0.84 MB  |  295次下载  |  免费
  9. 5元宇宙深度解析—未来的未来-风口还是泡沫
  10. 6.40 MB  |  227次下载  |  免费
  11. 6迪文DGUS开发指南
  12. 31.67 MB  |  194次下载  |  免费
  13. 7元宇宙底层硬件系列报告
  14. 13.42 MB  |  182次下载  |  免费
  15. 8FP5207XR-G1中文应用手册
  16. 1.09 MB  |  178次下载  |  免费

本月

  1. 1OrCAD10.5下载OrCAD10.5中文版软件
  2. 0.00 MB  |  234315次下载  |  免费
  3. 2555集成电路应用800例(新编版)
  4. 0.00 MB  |  33566次下载  |  免费
  5. 3接口电路图大全
  6. 未知  |  30323次下载  |  免费
  7. 4开关电源设计实例指南
  8. 未知  |  21549次下载  |  免费
  9. 5电气工程师手册免费下载(新编第二版pdf电子书)
  10. 0.00 MB  |  15349次下载  |  免费
  11. 6数字电路基础pdf(下载)
  12. 未知  |  13750次下载  |  免费
  13. 7电子制作实例集锦 下载
  14. 未知  |  8113次下载  |  免费
  15. 8《LED驱动电路设计》 温德尔著
  16. 0.00 MB  |  6656次下载  |  免费

总榜

  1. 1matlab软件下载入口
  2. 未知  |  935054次下载  |  免费
  3. 2protel99se软件下载(可英文版转中文版)
  4. 78.1 MB  |  537798次下载  |  免费
  5. 3MATLAB 7.1 下载 (含软件介绍)
  6. 未知  |  420027次下载  |  免费
  7. 4OrCAD10.5下载OrCAD10.5中文版软件
  8. 0.00 MB  |  234315次下载  |  免费
  9. 5Altium DXP2002下载入口
  10. 未知  |  233046次下载  |  免费
  11. 6电路仿真软件multisim 10.0免费下载
  12. 340992  |  191187次下载  |  免费
  13. 7十天学会AVR单片机与C语言视频教程 下载
  14. 158M  |  183279次下载  |  免费
  15. 8proe5.0野火版下载(中文版免费下载)
  16. 未知  |  138040次下载  |  免费