https://github.com/hpedrorodrigues/pinglang
A small language project to help me learn more about compilers (Formal language theory)
https://github.com/hpedrorodrigues/pinglang
abstract-syntax-tree language
Last synced: 7 months ago
JSON representation
A small language project to help me learn more about compilers (Formal language theory)
- Host: GitHub
- URL: https://github.com/hpedrorodrigues/pinglang
- Owner: hpedrorodrigues
- License: mit
- Created: 2017-05-19T00:21:11.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-20T19:17:17.000Z (over 8 years ago)
- Last Synced: 2025-03-08T09:09:22.092Z (7 months ago)
- Topics: abstract-syntax-tree, language
- Language: JavaScript
- Homepage:
- Size: 28.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ping Lang
A very small language project to help me to learn more about Abstract Syntax Tree.
**This compiler is WIP**.
A example of this language specification can be found [here](./sample/sample.ping).
## Supported keywords
List of commands supported and planning to implement:
- [x] `show`: Just prints a message in your `stdout`
- [x] `#`: Add a comment to your code
- [ ] `def`: Add a variable## Usage
### Node
```javascript
var Ping = require('ping')
var code = 'show "just a message" # Just a comment';console.log(Ping.compile(code));
```### Browser
```html
```
```javascript
var code = 'show "just a message"';
var result = Ping.compile(code);document.body.innerHTML = result;
```## Build
Type `npm run build` in your tty and be happy. :D
## Sample
Type `npm run sample` in your tty and see `dist/result/result.js` file.