Noble Ape
The Central Directories of the Noble Ape Simulation.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
interpret.c File Reference

This handles the interpretation end of ApeScript (i.e. after parsing). Unlike the parsing code that should be run only once in general use, the interpretation code is run multiple times in a simulation cycle. Thus slightly more care must be taken in optimizing the interpret code. More...

#include "noble.h"
Include dependency graph for interpret.c:

Go to the source code of this file.

Functions

void interpret_individual (n_individual_interpret *individual)
void interpret_cleanup (n_interpret **to_clean)
n_int interpret_cycle (n_interpret *code, n_individual_interpret *individual, n_int exit_offset, void *structure, void *data, script_external *start, script_external *end)

Detailed Description

This handles the interpretation end of ApeScript (i.e. after parsing). Unlike the parsing code that should be run only once in general use, the interpretation code is run multiple times in a simulation cycle. Thus slightly more care must be taken in optimizing the interpret code.

Definition in file interpret.c.


Function Documentation

void interpret_cleanup ( n_interpret **  to_clean)

Makes sure all the data associated with the interpreter is freed etc.

Parameters:
to_cleanThe pointer to the n_interpret struct that is being expunged.

Definition at line 602 of file interpret.c.

Here is the call graph for this function:

Here is the caller graph for this function:

n_int interpret_cycle ( n_interpret code,
n_individual_interpret individual,
n_int  exit_offset,
void *  structure,
void *  data,
script_external start,
script_external end 
)

This processes a single cycle of the ApeScript interpreter.

Parameters:
codethe ApeScript code to be executed.
exit_offsetif greater than minus one, the value entry to indicate exiting interpreter.
structurethe structure to be passed into the start and end functions.
startthe function to be run at the start of the ApeScript cycle.
endthe function to be run at the end of the ApeScript cycle.
Returns:
-1 in error case, 0 in leave and don't cycle back, 1 in leave and continue to cycle back.

Definition at line 627 of file interpret.c.

void interpret_individual ( n_individual_interpret individual)

Definition at line 591 of file interpret.c.