An open API service indexing awesome lists of open source software.

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)

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.