Files
bfc/README.md

69 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2020-10-01 20:43:00 +05:30
# bfc (*.bfe)
2020-09-30 01:15:57 +05:30
An extension of a language that shall not be named
2020-10-01 22:03:09 +05:30
Requires:
1. cxxopts -> v2.2.1
2. antlr4
2020-10-01 20:43:00 +05:30
*HelloWorld.bfe*
2020-09-30 01:27:09 +05:30
```
-[-7>+<]>-.-[->+5<]>++.+7..+3.[-3>+<]>-5.--[->+4<]>-.-8.+3.-6.-8.
```
2020-10-01 22:05:24 +05:30
## Usage
```sh
./bfc -h #Help
./bfc prog.bfe #Execute
./bfc prog.bfe -t #Translate file to bf
```
2020-10-01 20:43:00 +05:30
## Syntax
**Basic**
```bf
,. IO
<> Address manipulation
+- Value manipulation
[] Looping construct
```
**Comments**
`//` - Single Line
`/* */` - Multi Line
**Repeats**
```
<symbol><number>
(<symbols>)<number>
```
Eg.
```
+65. //prints A
>
(+65>)3 //stores AAA
(<.)3 //prints AAA
2020-10-01 22:13:11 +05:30
```
## Setup oddities (dev)
1. Copy antlr4's cpp libs to `./libs/antlr4`. (Please take care that the include folder points straight to the files not to `antlr-runtime`)
2. Copy `antlr-4.8-complete.jar` to `./thirdparty/antlr`.
3. Generate parsers to `./libs/generated` or use VSCode with the ANTLR extension.
## Todo (Tentative)
- [ ] Grammar
- [X] Number shorthand
- [X] Loop statements
- [ ] Shorthand segments
- [X] Processing
- [X] Translate to bf
- [X] Execute results