-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpecifications.txt
54 lines (44 loc) · 1.88 KB
/
Specifications.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Introduction
============
- It is an interpreter made specifically for Brainf**k language.
- Allows inline as well as multiline commenting.
- Ignores spaces between scripts.
Features
========
* A bf supported file i.e. .bf/.b can be interpreted
* A session can be created for user to enter the brainf**k commands as in bash shell. The session can be closed by "exit()" or "!" command.
*
Symbols Used
============
* > : Move the pointer one cell to the left
* < : Move the pointer one cell to the right
* + : Increment the value present in the current cell
* - : Decrement the value present in the current cell
* [ : Skips to '[' if value at current cell is '0', else follow next instruction
* ] : Move backwards if value at current cell is not '0' else keep going
* . : print the value corresponding to the ascii value at the current cell
* , : takes and store the ascii value of the input by user and store it in current cell.
Error/Exit Codes
================
- Exit(1): The file does not exit or is not accessible.
- Exit(2): Unsupported file format. Only ".b" and ".bf" file formats are supported in this version.
- Exit(3): Cannot open file in read mode, check if its permissible or not in use anywhere.
- Exit(4): Unrecognised symbol/character. Please follow Specifications.txt
- Unauthorized access to private memory location
- Memory cell's value can't be negative, the value of cell's reached its boundaries
- Already at leftmost cell/pointer can't perform this operation.
Comments
========
* Comments are supported as:
- Inline Comments using "//"
- Multiline Comments using "/**/"
Dependencies
============
This project as far has no dependencies, but there are some libraries that may not be preinstalled on your system, which are described below:
* "regex.h" library
Functions
========
1.
2.
3.
Note: I can make this program only using the array and flag and without incorporating pointers within.