Tenncor
Classes | Enumerations | Functions
def.h File Reference
#include <stdio.h>
#include "opt/parse/list.h"
Include dependency graph for def.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Branch
 Branching (Functor or Group) node. More...
 
struct  Subgraph
 Rule tree node. More...
 
struct  Arg
 Argument for a branching node. More...
 
struct  Conversion
 Represent a conversion between two rule trees. More...
 
struct  Property
 
struct  Statement
 Generic statement representation. More...
 

Enumerations

enum  SUBGRAPH_TYPE { SCALAR = 0, ANY, BRANCH }
 Rule tree node type. More...
 
enum  STMT_TYPE { SYMBOL_DEF = 0, PROPERTY_DEF, CONVERSION }
 Statement type enum. More...
 
enum  PTR_TYPE { STATEMENT = 0, ARGUMENT }
 Pointer enumeration to store in PtrList. More...
 

Functions

void subgraph_recursive_free (struct Subgraph *sg)
 Recursively free the subgraph and all of its descendants. More...
 
void arg_recursive_free (struct Arg *arg)
 Recursively free the argument and all it's contents. More...
 
void conversion_recursive_free (struct Conversion *conv)
 Recursively free the conversion and its subgraphs. More...
 
void statement_recursive_free (void *ptr)
 
void statements_free (struct PtrList *stmts)
 Recursively free all statements and their contents. More...
 
int parse_str (struct PtrList **stmts, const char *str)
 Return 0 if successfully populate statements from parsed string. More...
 
int parse_file (struct PtrList **stmts, FILE *file)
 Return 0 if successfully populate statements from parsed file. More...
 

Enumeration Type Documentation

◆ PTR_TYPE

enum PTR_TYPE

Pointer enumeration to store in PtrList.

Enumerator
STATEMENT 
ARGUMENT 

◆ STMT_TYPE

enum STMT_TYPE

Statement type enum.

Enumerator
SYMBOL_DEF 

Symbol definition (declaration of ANY nodes)

PROPERTY_DEF 

Property association statement.

CONVERSION 

Rule tree conversion statement.

◆ SUBGRAPH_TYPE

Rule tree node type.

Enumerator
SCALAR 

Definitive scalar constant.

ANY 

Rule tree leaf that represents any real node.

BRANCH 

Branching node.

Function Documentation

◆ arg_recursive_free()

void arg_recursive_free ( struct Arg arg)

Recursively free the argument and all it's contents.

◆ conversion_recursive_free()

void conversion_recursive_free ( struct Conversion conv)

Recursively free the conversion and its subgraphs.

◆ parse_file()

int parse_file ( struct PtrList **  stmts,
FILE *  file 
)

Return 0 if successfully populate statements from parsed file.

◆ parse_str()

int parse_str ( struct PtrList **  stmts,
const char *  str 
)

Return 0 if successfully populate statements from parsed string.

◆ statement_recursive_free()

void statement_recursive_free ( void *  ptr)

Safely free statement and it's contents recursively Statement::type_=SYMBOL_DEF: free string Statement::type_=PROPERTY_DEF: free property Statement::type_=CONVERSION: conversion_recursive_free conversion

◆ statements_free()

void statements_free ( struct PtrList stmts)

Recursively free all statements and their contents.

◆ subgraph_recursive_free()

void subgraph_recursive_free ( struct Subgraph sg)

Recursively free the subgraph and all of its descendants.