private.h File Reference

Internal header. More...

#include "kuroko/kuroko.h"
#include "methods.h"
#include <kuroko/debug.h>
Include dependency graph for private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ParsedFormatSpec
 
struct  BreakpointEntry
 
struct  DebuggerState
 

Macros

#define CACHED_METHOD(a, b, c)   METHOD_ ## a,
 
#define SPECIAL_ATTRS(a, b)   METHOD_ ## a,
 
#define FORMAT_OP_EQ   (1 << 0)
 
#define FORMAT_OP_REPR   (1 << 1)
 
#define FORMAT_OP_STR   (1 << 2)
 
#define FORMAT_OP_FORMAT   (1 << 3)
 
#define krk_hash_advance(hash, c)   do { hash = (int)(c) + (hash << 6) + (hash << 16) - hash; } while (0)
 
#define MAX_BREAKPOINTS   32
 

Enumerations

enum  KrkSpecialMethods { METHOD__MAX }
 Index numbers for always-available interned strings representing important method and member names. More...
 

Functions

void _createAndBind_numericClasses (void)
 
void _createAndBind_strClass (void)
 
void _createAndBind_listClass (void)
 
void _createAndBind_tupleClass (void)
 
void _createAndBind_bytesClass (void)
 
void _createAndBind_dictClass (void)
 
void _createAndBind_functionClass (void)
 
void _createAndBind_rangeClass (void)
 
void _createAndBind_setClass (void)
 
void _createAndBind_generatorClass (void)
 
void _createAndBind_sliceClass (void)
 
void _createAndBind_builtins (void)
 
void _createAndBind_type (void)
 
void _createAndBind_exceptions (void)
 Bind native methods and classes for exceptions. More...
 
void _createAndBind_longClass (void)
 
void _createAndBind_compilerClass (void)
 

Detailed Description

Internal header.

These functions are not part of the public API for Kuroko. They are used internally by the interpreter library.

Definition in file private.h.

Enumeration Type Documentation

◆ KrkSpecialMethods

Index numbers for always-available interned strings representing important method and member names.

The VM must look up many methods and members by fixed names. To avoid continuously having to box and unbox these from C strings to the appropriate interned KrkString, we keep an array of the KrkString pointers in the global VM state.

These values are the offsets into that index for each of the relevant function names (generally with extra underscores removed). For example METHOD_INIT is the offset for the string value for "__init__".

Definition at line 38 of file private.h.

Function Documentation

◆ _createAndBind_exceptions()

void _createAndBind_exceptions ( void  )

Bind native methods and classes for exceptions.

Called on VM initialization to create the base classes for exception types and bind the native methods for exception objects.

Definition at line 184 of file exceptions.c.