Herb C Reference
Loading...
Searching...
No Matches
analyze.c File Reference
#include "include/analyze.h"
#include "include/analyze_helpers.h"
#include "include/analyzed_ruby.h"
#include "include/array.h"
#include "include/ast_nodes.h"
#include "include/errors.h"
#include "include/extract.h"
#include "include/location.h"
#include "include/position.h"
#include "include/pretty_print.h"
#include "include/prism_helpers.h"
#include "include/token_struct.h"
#include "include/util.h"
#include "include/visitor.h"
#include <prism.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Functions

static analyzed_ruby_Therb_analyze_ruby (char *source)
 
static bool analyze_erb_content (const AST_NODE_T *node, void *data)
 
static size_t process_block_children (AST_NODE_T *node, array_T *array, size_t index, array_T *children_array, analyze_ruby_context_T *context, control_type_t parent_type)
 
static size_t process_subsequent_block (AST_NODE_T *node, array_T *array, size_t index, AST_NODE_T **subsequent_out, analyze_ruby_context_T *context, control_type_t parent_type)
 
static control_type_t detect_control_type (AST_ERB_CONTENT_NODE_T *erb_node)
 
static bool is_subsequent_type (control_type_t parent_type, control_type_t child_type)
 
static bool is_terminator_type (control_type_t parent_type, control_type_t child_type)
 
static AST_NODE_Tcreate_control_node (AST_ERB_CONTENT_NODE_T *erb_node, array_T *children, AST_NODE_T *subsequent, AST_ERB_END_NODE_T *end_node, control_type_t control_type)
 
static size_t process_control_structure (AST_NODE_T *node, array_T *array, size_t index, array_T *output_array, analyze_ruby_context_T *context, control_type_t initial_type)
 
static array_Trewrite_node_array (AST_NODE_T *node, array_T *array, analyze_ruby_context_T *context)
 
static bool transform_erb_nodes (const AST_NODE_T *node, void *data)
 
void herb_analyze_parse_tree (AST_DOCUMENT_NODE_T *document, const char *source)
 
void herb_analyze_parse_errors (AST_DOCUMENT_NODE_T *document, const char *source)
 

Function Documentation

◆ herb_analyze_ruby()

static analyzed_ruby_T * herb_analyze_ruby ( char *  source)
static

◆ analyze_erb_content()

static bool analyze_erb_content ( const AST_NODE_T node,
void *  data 
)
static

◆ process_block_children()

static size_t process_block_children ( AST_NODE_T node,
array_T array,
size_t  index,
array_T children_array,
analyze_ruby_context_T context,
control_type_t  parent_type 
)
static

◆ process_subsequent_block()

static size_t process_subsequent_block ( AST_NODE_T node,
array_T array,
size_t  index,
AST_NODE_T **  subsequent_out,
analyze_ruby_context_T context,
control_type_t  parent_type 
)
static

◆ detect_control_type()

static control_type_t detect_control_type ( AST_ERB_CONTENT_NODE_T erb_node)
static

◆ is_subsequent_type()

static bool is_subsequent_type ( control_type_t  parent_type,
control_type_t  child_type 
)
static

◆ is_terminator_type()

static bool is_terminator_type ( control_type_t  parent_type,
control_type_t  child_type 
)
static

◆ create_control_node()

static AST_NODE_T * create_control_node ( AST_ERB_CONTENT_NODE_T erb_node,
array_T children,
AST_NODE_T subsequent,
AST_ERB_END_NODE_T end_node,
control_type_t  control_type 
)
static

◆ process_control_structure()

static size_t process_control_structure ( AST_NODE_T node,
array_T array,
size_t  index,
array_T output_array,
analyze_ruby_context_T context,
control_type_t  initial_type 
)
static

◆ rewrite_node_array()

static array_T * rewrite_node_array ( AST_NODE_T node,
array_T array,
analyze_ruby_context_T context 
)
static

◆ transform_erb_nodes()

static bool transform_erb_nodes ( const AST_NODE_T node,
void *  data 
)
static

◆ herb_analyze_parse_tree()

void herb_analyze_parse_tree ( AST_DOCUMENT_NODE_T document,
const char *  source 
)

◆ herb_analyze_parse_errors()

void herb_analyze_parse_errors ( AST_DOCUMENT_NODE_T document,
const char *  source 
)