Cthulhu  0.2.10
Cthulhu compiler collection
ast.h File Reference
#include "core/where.h"
#include "cthulhu/tree/ops.h"
#include <gmp.h>
#include <stdbool.h>
#include "oberon/oberon.inc"
Include dependency graph for ast.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  obr_symbol_t
 
struct  obr_t
 

Macros

#define OBR_VIS(ID, STR, SYMBOL)   ID,
 

Enumerations

enum  obr_visibility_t
 
enum  obr_kind_t {
  eObrTypeName , eObrTypeQual , eObrTypePointer , eObrTypeArray ,
  eObrTypeRecord , eObrTypeSignature , eObrExprDigit , eObrExprString ,
  eObrExprName , eObrExprField , eObrExprCall , eObrExprUnary ,
  eObrExprBinary , eObrExprCompare , eObrExprIs , eObrExprIn ,
  eObrExprCast , eObrStmtReturn , eObrStmtWhile , eObrStmtLoop ,
  eObrStmtRepeat , eObrStmtAssign , eObrStmtBlock , eObrStmtBranch ,
  eObrStmtBreak , eObrDeclVar , eObrDeclConst , eObrDeclType ,
  eObrDeclProcedure , eObrField , eObrParam , eObrReceiver ,
  eObrModule , eObrImport
}
 

Functions

obr_tobr_module (scan_t *scan, where_t where, char *name, char *end, const vector_t *imports, vector_t *decls, vector_t *init)
 
obr_tobr_import (scan_t *scan, where_t where, char *name, char *symbol)
 
obr_tobr_decl_type (scan_t *scan, where_t where, obr_symbol_t *symbol, obr_t *type)
 
obr_tobr_decl_var (obr_symbol_t *symbol, obr_t *type)
 
obr_tobr_decl_const (scan_t *scan, where_t where, obr_symbol_t *symbol, obr_t *value)
 
obr_tobr_decl_procedure (scan_t *scan, where_t where, obr_symbol_t *symbol, obr_t *receiver, const vector_t *params, obr_t *result, vector_t *locals, vector_t *body, char *end)
 
obr_tobr_expr_name (scan_t *scan, where_t where, char *name)
 
obr_tobr_expr_field (scan_t *scan, where_t where, obr_t *expr, char *field)
 
obr_tobr_expr_call (scan_t *scan, where_t where, obr_t *expr, const vector_t *args)
 
obr_tobr_expr_cast (scan_t *scan, where_t where, obr_t *expr, obr_t *cast)
 
obr_tobr_expr_is (scan_t *scan, where_t where, obr_t *lhs, obr_t *rhs)
 
obr_tobr_expr_in (scan_t *scan, where_t where, obr_t *lhs, obr_t *rhs)
 
obr_tobr_expr_compare (scan_t *scan, where_t where, compare_t op, obr_t *lhs, obr_t *rhs)
 
obr_tobr_expr_binary (scan_t *scan, where_t where, binary_t op, obr_t *lhs, obr_t *rhs)
 
obr_tobr_expr_unary (scan_t *scan, where_t where, unary_t op, obr_t *expr)
 
obr_tobr_expr_digit (scan_t *scan, where_t where, const mpz_t digit)
 
obr_tobr_expr_string (scan_t *scan, where_t where, char *text, size_t length)
 
obr_tobr_stmt_return (scan_t *scan, where_t where, obr_t *expr)
 
obr_tobr_stmt_while (scan_t *scan, where_t where, obr_t *cond, vector_t *then)
 
obr_tobr_stmt_loop (scan_t *scan, where_t where, vector_t *loop)
 
obr_tobr_stmt_repeat (scan_t *scan, where_t where, vector_t *repeat, obr_t *until)
 
obr_tobr_stmt_assign (scan_t *scan, where_t where, obr_t *dst, obr_t *src)
 
obr_tobr_stmt_block (scan_t *scan, where_t where, vector_t *stmts)
 
obr_tobr_stmt_branch (scan_t *scan, where_t where, obr_t *cond, vector_t *then, obr_t *other)
 
obr_tobr_stmt_break (scan_t *scan, where_t where)
 
obr_tobr_type_name (scan_t *scan, where_t where, char *symbol)
 
obr_tobr_type_qual (scan_t *scan, where_t where, char *name, char *symbol)
 
obr_tobr_type_pointer (scan_t *scan, where_t where, obr_t *type)
 
obr_tobr_type_array (scan_t *scan, where_t where, const vector_t *sizes, obr_t *type)
 
obr_tobr_type_record (scan_t *scan, where_t where, vector_t *fields)
 
obr_tobr_field (obr_symbol_t *symbol, obr_t *type)
 
obr_tobr_param (obr_symbol_t *symbol, obr_t *type, bool mut)
 
obr_tobr_receiver (scan_t *scan, where_t where, bool mut, char *name, char *type)
 
obr_symbol_tobr_symbol (scan_t *scan, where_t where, char *name, obr_visibility_t visibility)
 
vector_tobr_expand_vars (scan_t *scan, vector_t *symbols, obr_t *type)
 
vector_tobr_expand_fields (scan_t *scan, vector_t *symbols, obr_t *type)
 
vector_tobr_expand_params (scan_t *scan, vector_t *symbols, obr_t *type, bool mut)
 

Macro Definition Documentation

◆ OBR_VIS

#define OBR_VIS (   ID,
  STR,
  SYMBOL 
)    ID,

Definition at line 24 of file ast.h.

Enumeration Type Documentation

◆ obr_kind_t

enum obr_kind_t

ast

Enumerator
eObrTypeName 
eObrTypeQual 
eObrTypePointer 
eObrTypeArray 
eObrTypeRecord 
eObrTypeSignature 
eObrExprDigit 
eObrExprString 
eObrExprName 
eObrExprField 
eObrExprCall 
eObrExprUnary 
eObrExprBinary 
eObrExprCompare 
eObrExprIs 
eObrExprIn 
eObrExprCast 
eObrStmtReturn 
eObrStmtWhile 
eObrStmtLoop 
eObrStmtRepeat 
eObrStmtAssign 
eObrStmtBlock 
eObrStmtBranch 
eObrStmtBreak 
eObrDeclVar 
eObrDeclConst 
eObrDeclType 
eObrDeclProcedure 
eObrField 
eObrParam 
eObrReceiver 
eObrModule 
eObrImport 

Definition at line 41 of file ast.h.

◆ obr_visibility_t

symbols

Definition at line 22 of file ast.h.

Function Documentation

◆ obr_decl_const()

obr_t* obr_decl_const ( scan_t scan,
where_t  where,
obr_symbol_t symbol,
obr_t value 
)

Definition at line 108 of file ast.c.

◆ obr_decl_procedure()

obr_t* obr_decl_procedure ( scan_t scan,
where_t  where,
obr_symbol_t symbol,
obr_t receiver,
const vector_t params,
obr_t result,
vector_t locals,
vector_t body,
char *  end 
)

Definition at line 115 of file ast.c.

◆ obr_decl_type()

obr_t* obr_decl_type ( scan_t scan,
where_t  where,
obr_symbol_t symbol,
obr_t type 
)

Definition at line 94 of file ast.c.

◆ obr_decl_var()

obr_t* obr_decl_var ( obr_symbol_t symbol,
obr_t type 
)

Definition at line 101 of file ast.c.

◆ obr_expand_fields()

vector_t* obr_expand_fields ( scan_t scan,
vector_t symbols,
obr_t type 
)

Definition at line 384 of file ast.c.

◆ obr_expand_params()

vector_t* obr_expand_params ( scan_t scan,
vector_t symbols,
obr_t type,
bool  mut 
)

Definition at line 389 of file ast.c.

◆ obr_expand_vars()

vector_t* obr_expand_vars ( scan_t scan,
vector_t symbols,
obr_t type 
)

Definition at line 379 of file ast.c.

◆ obr_expr_binary()

obr_t* obr_expr_binary ( scan_t scan,
where_t  where,
binary_t  op,
obr_t lhs,
obr_t rhs 
)

Definition at line 193 of file ast.c.

◆ obr_expr_call()

obr_t* obr_expr_call ( scan_t scan,
where_t  where,
obr_t expr,
const vector_t args 
)

Definition at line 160 of file ast.c.

◆ obr_expr_cast()

obr_t* obr_expr_cast ( scan_t scan,
where_t  where,
obr_t expr,
obr_t cast 
)

Definition at line 152 of file ast.c.

◆ obr_expr_compare()

obr_t* obr_expr_compare ( scan_t scan,
where_t  where,
compare_t  op,
obr_t lhs,
obr_t rhs 
)

Definition at line 184 of file ast.c.

◆ obr_expr_digit()

obr_t* obr_expr_digit ( scan_t scan,
where_t  where,
const mpz_t  digit 
)

Definition at line 210 of file ast.c.

◆ obr_expr_field()

obr_t* obr_expr_field ( scan_t scan,
where_t  where,
obr_t expr,
char *  field 
)

Definition at line 144 of file ast.c.

◆ obr_expr_in()

obr_t* obr_expr_in ( scan_t scan,
where_t  where,
obr_t lhs,
obr_t rhs 
)

Definition at line 176 of file ast.c.

◆ obr_expr_is()

obr_t* obr_expr_is ( scan_t scan,
where_t  where,
obr_t lhs,
obr_t rhs 
)

Definition at line 168 of file ast.c.

◆ obr_expr_name()

obr_t* obr_expr_name ( scan_t scan,
where_t  where,
char *  name 
)

Definition at line 137 of file ast.c.

◆ obr_expr_string()

obr_t* obr_expr_string ( scan_t scan,
where_t  where,
char *  text,
size_t  length 
)

Definition at line 217 of file ast.c.

◆ obr_expr_unary()

obr_t* obr_expr_unary ( scan_t scan,
where_t  where,
unary_t  op,
obr_t expr 
)

Definition at line 202 of file ast.c.

◆ obr_field()

obr_t* obr_field ( obr_symbol_t symbol,
obr_t type 
)

Definition at line 327 of file ast.c.

◆ obr_import()

obr_t* obr_import ( scan_t scan,
where_t  where,
char *  name,
char *  symbol 
)

Definition at line 85 of file ast.c.

◆ obr_module()

obr_t* obr_module ( scan_t scan,
where_t  where,
char *  name,
char *  end,
const vector_t imports,
vector_t decls,
vector_t init 
)

Definition at line 72 of file ast.c.

◆ obr_param()

obr_t* obr_param ( obr_symbol_t symbol,
obr_t type,
bool  mut 
)

Definition at line 334 of file ast.c.

◆ obr_receiver()

obr_t* obr_receiver ( scan_t scan,
where_t  where,
bool  mut,
char *  name,
char *  type 
)

Definition at line 342 of file ast.c.

◆ obr_stmt_assign()

obr_t* obr_stmt_assign ( scan_t scan,
where_t  where,
obr_t dst,
obr_t src 
)

Definition at line 262 of file ast.c.

◆ obr_stmt_block()

obr_t* obr_stmt_block ( scan_t scan,
where_t  where,
vector_t stmts 
)

Definition at line 270 of file ast.c.

◆ obr_stmt_branch()

obr_t* obr_stmt_branch ( scan_t scan,
where_t  where,
obr_t cond,
vector_t then,
obr_t other 
)

Definition at line 277 of file ast.c.

◆ obr_stmt_break()

obr_t* obr_stmt_break ( scan_t scan,
where_t  where 
)

Definition at line 249 of file ast.c.

◆ obr_stmt_loop()

obr_t* obr_stmt_loop ( scan_t scan,
where_t  where,
vector_t loop 
)

Definition at line 242 of file ast.c.

◆ obr_stmt_repeat()

obr_t* obr_stmt_repeat ( scan_t scan,
where_t  where,
vector_t repeat,
obr_t until 
)

Definition at line 254 of file ast.c.

◆ obr_stmt_return()

obr_t* obr_stmt_return ( scan_t scan,
where_t  where,
obr_t expr 
)

Definition at line 227 of file ast.c.

◆ obr_stmt_while()

obr_t* obr_stmt_while ( scan_t scan,
where_t  where,
obr_t cond,
vector_t then 
)

Definition at line 234 of file ast.c.

◆ obr_symbol()

obr_symbol_t* obr_symbol ( scan_t scan,
where_t  where,
char *  name,
obr_visibility_t  visibility 
)

Definition at line 352 of file ast.c.

◆ obr_type_array()

obr_t* obr_type_array ( scan_t scan,
where_t  where,
const vector_t sizes,
obr_t type 
)

Definition at line 310 of file ast.c.

◆ obr_type_name()

obr_t* obr_type_name ( scan_t scan,
where_t  where,
char *  symbol 
)

Definition at line 288 of file ast.c.

◆ obr_type_pointer()

obr_t* obr_type_pointer ( scan_t scan,
where_t  where,
obr_t type 
)

Definition at line 303 of file ast.c.

◆ obr_type_qual()

obr_t* obr_type_qual ( scan_t scan,
where_t  where,
char *  name,
char *  symbol 
)

Definition at line 295 of file ast.c.

◆ obr_type_record()

obr_t* obr_type_record ( scan_t scan,
where_t  where,
vector_t fields 
)

Definition at line 318 of file ast.c.