PageRenderTime 25ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/README.md

https://git.sr.ht/~humaid/yabfig/
Markdown | 92 lines | 77 code | 15 blank | 0 comment | 0 complexity | 4c934d46a76635888ea2eb42d435daed MD5 | raw file
Possible License(s): BSD-3-Clause
  1. # yabfig
  2. [Visit the project page on humaidq.ae](https://humaidq.ae/projects/yabfig/)
  3. ## 1. Description
  4. ![Screenshot](https://humaidq.ae/projects/screenshots/yabfig.jpg)
  5. yabfig is a [BF](https://en.wikipedia.org/wiki/brainfuck)
  6. interpreter written in Go. It has also been extended to lint
  7. code (by removing un-interpreted characters) and to include a gdb-style
  8. interpreter.
  9. ## 2. Requirements
  10. The following packages must be installed on your system.
  11. - Go *(tested with 1.12)*
  12. - Git
  13. ## 3. Copying and contributing
  14. This program is written by Humaid AlQassimi,
  15. and is distributed under the
  16. [BSD 2 Clause](https://humaidq.ae/license/bsd-2-clause) license.
  17. ## 4. Download and install
  18. ```sh
  19. $ go get -u git.sr.ht/~humaid/yabfig
  20. $ go install git.sr.ht/~humaid/yabfig
  21. ```
  22. ## 5. Usage
  23. ```sh
  24. Usage: yabfig [option] <file>
  25. Options:
  26. -lint Lint (format) a Brainfuck file by removing spaces and non-instruction characters and output it to standard output.
  27. -debug Run an interactive gdb-style debugger.
  28. ```
  29. To run the example program `hello-world.bf`:
  30. ```sh
  31. $ yabfig programs/hello-world.bf
  32. ```
  33. Using the debugger to set breakpoints:
  34. ```sh
  35. $ yabfig -debug programs/hello-world.bf
  36. yabfig debugger for Brainfuck.
  37. Commands are similar to gdb, type "help" for a list of compatible commands.
  38. (yabfig-dbg) help
  39. List of commands:
  40. run -- Run the program
  41. print [pos] -- Print value at memory position
  42. next [count] -- Execute next instruction[s]
  43. jump [pos] -- Jump to a program position and resume
  44. break [pos] -- Add breakpoint at program position
  45. clear [pos] -- Delete breakpoint at program position
  46. watch [n = x] -- Set watchpoint when memory position n is x
  47. kill -- Kill program execution
  48. (yabfig-dbg) b 98
  49. Breakpoint #1 at position 98
  50. (yabfig-dbg) b 102
  51. Breakpoint #2 at position 102
  52. (yabfig-dbg) b 106
  53. Breakpoint #3 at position 106
  54. (yabfig-dbg) r
  55. Running program: programs/hello-world.bf
  56. Hello WorldBreakpoint hit at position 98
  57. (yabfig-dbg) c
  58. !Breakpoint hit at position 102
  59. (yabfig-dbg) c
  60. Breakpoint hit at position 106
  61. (yabfig-dbg) c
  62. Program exited
  63. (yabfig-dbg)
  64. ```
  65. ## 6. Change log
  66. - v0.1 *(Mar 8 2019)*
  67. - Initial release
  68. - v0.2 *(Mar 18 2019)*
  69. - Added linter
  70. - Added unit tests
  71. - Interpreter as a struct with methods
  72. - v0.2.1 *(Mar 18 2019)*
  73. - Add GoDoc
  74. - Move Interpreter to a separate package
  75. - v0.3 *(Mar 22 2019)*
  76. - Add a simple gdb-style debugger
  77. - Improve interpreter functions