Skip to content

Latest commit

 

History

History
112 lines (98 loc) · 7.44 KB

configuration.md

File metadata and controls

112 lines (98 loc) · 7.44 KB

Documentation

Configuration

Numeric variables

BIPLAN supports only one numeric variable type that is by default long but can be easily changed with the use of constants:

// Sets the BIPLAN numeric type to int
#define BP_VAR_T int
#include "BIPLAN.h"

Each variable is just an entry of a statically allocated array. The BP_VARIABLES constant can be used as shown below to configure the maximum amount of variables available:

#define BP_VARIABLES 50
#include "BIPLAN.h"

BIPLAN supports up to 91 - BP_PARAMS user-defined variables, such as @my_var = 1 although it can get or set more variables using the access operator $[].


Strings

Each string is just an entry of a statically allocated array, the BP_STRINGS constant can be used as shown below to configure the maximum amount of strings available:

#define BP_STRINGS 50
#include "BIPLAN.h"

BIPLAN supports up to 91 - BP_ARGS strings defined by the user, such as :my_string = "Hello world!" although it can get or set more strings using the access operator :[]. The maximum length of strings can be configured as follows:

// Sets BIPLAN string maximum length to 50
#define BP_STRING_MAX 50
#include "BIPLAN.h"

Functions

Each function is just an entry of a global array of functions. The BP_FUNCTIONS constant can be used as shown below to configure the maximum amount of functions available:

#define BP_FUNCTIONS 50
#include "BIPLAN.h"

The maximum amount of parameters available can be configured as follows:

#define BP_PARAMS 5
#include "BIPLAN.h"

Consider that program parameters are stored in the variable address-space, so the maximum amount of user-defined variables is affected by the number of supported parameters.

The maximum function call depth can be configured as follows:

#define BP_FUN_DEPTH 5
#include "BIPLAN.h"

BIPLAN supports a maximum amount of 91 functions defined by the user.


Keyword length

You can configure the maximum length of user-defined keywords using the BP_KEYWORD_MAX as follows:

#define BP_KEYWORD_MAX 20
#include "BIPLAN.h"

Macro length

The maximum length of user-defined macros can be configured defining BP_MACRO_MAX before including BIPLAN.h:

// The maximum length of a macro is 512 characters
#define BP_MACRO_MAX 512
#include "BIPLAN.h"

Program arguments

The maximum amount of program arguments can be configured defining BP_ARGS before including BIPLAN.h:

// Accept up to 10 program arguments
#define BP_ARGS 10
#include "BIPLAN.h"

Consider that program arguments are stored in the string address-space, so the maximum amount of user-defined strings is affected by the number of supported program arguments.


for and while

Each for variable is just an entry of a statically allocated array. The BP_FOR_VARIABLES constant can be used as shown below to configure the maximum amount of variables available:

#define BP_FOR_VARIABLES 50
#include "BIPLAN.h"

The maximum value supported is 91.

The maximum amount of nested for and while can be configured defining BP_CYCLE_DEPTH before including BIPLAN.h:

// Accept up to 10 nested for/while
#define BP_CYCLE_DEPTH 10
#include "BIPLAN.h"

Consider that one address in the variable address-space is used for each level of nesting, so the maximum amount of user-defined variables is affected by the nest level supported.