Files
bfc/README.md

76 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2020-10-04 14:47:24 +05:30
# (+97>)3<3+>+5>+2<2(.>)3 (*.bfe)
2020-09-30 01:15:57 +05:30
2020-10-30 20:35:01 +05:30
A slight syntactic superset of BF.
2020-09-30 01:15:57 +05:30
2020-10-30 20:35:01 +05:30
Development requirements:
2020-10-01 22:03:09 +05:30
1. cxxopts -> v2.2.1
2021-04-04 18:23:58 +05:30
2. antlr4 -> v4
2020-10-01 22:03:09 +05:30
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-30 20:35:01 +05:30
## Functions
1. Interpret bfe(and bf) files
2. Convert bf/bfe to bf
3. Convert bf/bfe to C++ (not optimized)
2020-10-01 22:05:24 +05:30
## Usage
```sh
./bfc -h #Help
./bfc prog.bfe #Execute
2020-10-30 20:35:01 +05:30
./bfc prog.bfe -a bf #Translate file to bf
./bfc prog.bfe -a cpp # Translate file to cpp
2020-10-01 22:05:24 +05:30
```
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)
2021-04-13 11:25:39 +05:30
1. Generate parsers to `./libs/generated` or use VSCode with the ANTLR extension or use a downloaded ANTLR JAR.
2020-10-01 22:13:11 +05:30
## Todo (Tentative)
- [ ] Grammar
- [X] Number shorthand
- [X] Loop statements
2021-04-13 11:25:39 +05:30
- [X] Ignore rest
2020-10-01 22:13:11 +05:30
- [ ] Shorthand segments
- [X] Processing
- [X] Translate to bf
- [X] Execute results