Skip to content

Chalarangelo/bf-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BF interpreter

A simple Brainf*ck interpreter written in JavaScript.

Usage

Note: You may need to run chmod for the executables.

chmod +x ./bin/execute
chmod +x ./bin/parse

Parsing

Parsing only supports text input at this time.

./bin/parse <bf_code>

It produces a JSON output (AST) that can be used for execution.

Execution

The executing script can be run with an AST file as input.

./bin/execute <ast_file>

You can also use parse mode with the -p or --parse flag:

./bin/execute -p='<bf_code>'

You can also use parse mode with a .b file, using the -b or --bf flag:

./bin/execute -b='<bf_file>'

You may enter debug mode with the -d or --debug flag:

./bin/execute -d <ast_file>

You may provide input with the -i or --input flag:

./bin/execute -i='<input>' <ast_file>

You may provide a starting memory configuration with the -m or --memory flag:

./bin/execute -m='<memory>' <ast_file>

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A simple Brainf*ck interpreter

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published