Finally people that "program" in HTML and call themselves "programmers" can be programmers for real.
All code written in programming language HTML (PL/HTML for short) is syntactically valid HTML code
(validated using [W3C validator][1]), which was one of the main goals during language design.
Also names of all statements were handpicked from the list of HTML elements in such a way that name or
description of an element describes the meaning of the statement (`var`, `input`, `output`, etc).
[1]: https://validator.w3.org/#validate-by-input
Following program displays first `n` Fibonacci numbers.
```html
`Fibonacci numbers`abcin
a
b
i
c
a
b
i
```
Other examples can be found in the *tests/* folder.
# Specification
* Keywords: `doctype`, `lang`, `html`, `head`, `title`,`body`, `main`, `var`, `class`, `output`, `input`, `name`, `data`, `value`, `div`, `if`, `while`
* Builtin types: `integer`, `real`, `boolean`, `string`
* Arithmetical operators: `+`, `-`, `*`, `/`, `%`, `(`, `)`
* Logical operators: `∧`, `∨`, `!`
* Comparison operators: `<`, `>`, `≤`, `≥`, `=`, `≠`
* Special characters: `\\`, `\t`, `\n`
# How to Use
1. Install [Go compiler](https://golang.org/dl/).
2. Build executable with `go build`.
3. Run interpreter through command line.
```bat
plhtml []
```
# References
Useful reading materials:
- [CS143 Compilers](https://web.stanford.edu/class/archive/cs/cs143/cs143.1128/)
- [Implementing Lexers and Parsers](http://www.cse.chalmers.se/edu/year/2015/course/DAT150/lectures/proglang-04.html)
- [A Simple Recursive Descent Parser](http://math.hws.edu/javanotes/c9/s5.html)
- [Let’s Build A Simple Interpreter](https://ruslanspivak.com/lsbasi-part1/)
Source code of compilers for some programming languages:
- [Go](https://github.com/golang/go/blob/master/src/go)
- [TypeScript](https://github.com/microsoft/TypeScript/tree/master/src/compiler)