G2Basic 0.1.1 (1e793fc)
BASIC interpreter for microcontrollers
Loading...
Searching...
No Matches
Embedding API

Functions a host program calls to run BASIC. More...

Collaboration diagram for Embedding API:

Modules

 Setup and output
 Resetting the interpreter and routing its output.
 
 Custom functions
 Making C functions callable from BASIC expressions.
 
 Execution
 Entering program lines, running statements, and running programs.
 

Detailed Description

Functions a host program calls to run BASIC.

The interpreter keeps a single global state: variables, registered functions, the stored program, and the FOR and GOSUB stacks. It is not reentrant or thread-safe. Call it from one execution context at a time, never from an interrupt handler. State is allocated with calloc and released only by the next g2basic_init() call.