All pastes #954301 Raw Edit

Untitled

public text v1 · immutable
#954301 ·published 2008-03-23 20:41 UTC
rendered paste body
/* lisp.h */                                                                                                                                                                                                        
#ifndef _LISP_H                                                                                                                                                                                                     
#define _LISP_H                                                                                                                                                                                                     
                                                                                                                                                                                                                    
#define MAX_NODES 100           /* essentially, the number of fun args */                                                                                                                                           
                                                                                                                                                                                                                    
typedef union                   /* Contains all types of data. */                                                                                                                                                   
{                                                                                                                                                                                                                   
    int i;                                                                                                                                                                                                          
    double d;                                                                                                                                                                                                       
    char c,                                                                                                                                                                                                         
        * s;                                                                                                                                                                                                        
} u_type;                                                                                                                                                                                                           
                                                                                                                                                                                                                    
typedef union                   /* an S-expression structure. */                                                                                                                                                    
{                                                                                                                                                                                                                   
    u_type v;                                                                                                                                                                                                       
    s_exp* n[MAX_NODES];                                                                                                                                                                                            
} utag_sxp;                                                                                                                                                                                                         
typedef struct                                                                                                                                                                                                      
{                                                                                                                                                                                                                   
    enum { B_NODE, L_NODE } state;                                                                                                                                                                                  
    utag_sxp v;                                                                                                                                                                                                     
} s_exp;                                                                                                                                                                                                            
#endif