Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

chrisvrose/bfc

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(+97>)3<3+>+5>+2<2(.>)3 (*.bfe)

A slight syntactic superset of BF.

Development requirements:

  1. cxxopts -> v2.2.1
  2. antlr4 -> v4

HelloWorld.bfe

-[-7>+<]>-.-[->+5<]>++.+7..+3.[-3>+<]>-5.--[->+4<]>-.-8.+3.-6.-8.

Functions

  1. Interpret bfe(and bf) files
  2. Convert bf/bfe to bf
  3. Convert bf/bfe to C++ (not optimized)

Usage

./bfc -h #Help
./bfc prog.bfe #Execute
./bfc prog.bfe -a bf #Translate file to bf
./bfc prog.bfe -a cpp # Translate file to cpp

Syntax

Basic

,. 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

Setup oddities (dev)

  1. Generate parsers to ./libs/generated or use VSCode with the ANTLR extension or use a downloaded ANTLR JAR.

Todo (Tentative)

  • Grammar
    • Number shorthand
    • Loop statements
    • Ignore rest
    • Shorthand segments
  • Processing
    • Translate to bf
    • Execute results

About

A Parser and interpreter for BFE, a syntactic superset of bf

Topics

Resources

Stars

Watchers

Forks

Releases

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.