Herb C Reference
Loading...
Searching...
No Matches
ast_nodes.c File Reference
#include <stdio.h>
#include <stdbool.h>
#include <prism.h>
#include "include/analyzed_ruby.h"
#include "include/array.h"
#include "include/ast_node.h"
#include "include/ast_nodes.h"
#include "include/errors.h"
#include "include/token.h"
#include "include/util.h"

Functions

AST_DOCUMENT_NODE_Tast_document_node_init (array_T *children, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_LITERAL_NODE_Tast_literal_node_init (const char *content, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_HTML_OPEN_TAG_NODE_Tast_html_open_tag_node_init (token_T *tag_opening, token_T *tag_name, token_T *tag_closing, array_T *children, bool is_void, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_HTML_CLOSE_TAG_NODE_Tast_html_close_tag_node_init (token_T *tag_opening, token_T *tag_name, token_T *tag_closing, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_HTML_SELF_CLOSE_TAG_NODE_Tast_html_self_close_tag_node_init (token_T *tag_opening, token_T *tag_name, array_T *attributes, token_T *tag_closing, bool is_void, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_HTML_ELEMENT_NODE_Tast_html_element_node_init (struct AST_HTML_OPEN_TAG_NODE_STRUCT *open_tag, token_T *tag_name, array_T *body, struct AST_HTML_CLOSE_TAG_NODE_STRUCT *close_tag, bool is_void, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_HTML_ATTRIBUTE_VALUE_NODE_Tast_html_attribute_value_node_init (token_T *open_quote, array_T *children, token_T *close_quote, bool quoted, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_HTML_ATTRIBUTE_NAME_NODE_Tast_html_attribute_name_node_init (token_T *name, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_HTML_ATTRIBUTE_NODE_Tast_html_attribute_node_init (struct AST_HTML_ATTRIBUTE_NAME_NODE_STRUCT *name, token_T *equals, struct AST_HTML_ATTRIBUTE_VALUE_NODE_STRUCT *value, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_HTML_TEXT_NODE_Tast_html_text_node_init (const char *content, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_HTML_COMMENT_NODE_Tast_html_comment_node_init (token_T *comment_start, array_T *children, token_T *comment_end, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_HTML_DOCTYPE_NODE_Tast_html_doctype_node_init (token_T *tag_opening, array_T *children, token_T *tag_closing, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_WHITESPACE_NODE_Tast_whitespace_node_init (token_T *value, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_ERB_CONTENT_NODE_Tast_erb_content_node_init (token_T *tag_opening, token_T *content, token_T *tag_closing, analyzed_ruby_T *analyzed_ruby, bool parsed, bool valid, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_ERB_END_NODE_Tast_erb_end_node_init (token_T *tag_opening, token_T *content, token_T *tag_closing, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_ERB_ELSE_NODE_Tast_erb_else_node_init (token_T *tag_opening, token_T *content, token_T *tag_closing, array_T *statements, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_ERB_IF_NODE_Tast_erb_if_node_init (token_T *tag_opening, token_T *content, token_T *tag_closing, array_T *statements, AST_NODE_T *subsequent, struct AST_ERB_END_NODE_STRUCT *end_node, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_ERB_BLOCK_NODE_Tast_erb_block_node_init (token_T *tag_opening, token_T *content, token_T *tag_closing, array_T *body, struct AST_ERB_END_NODE_STRUCT *end_node, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_ERB_WHEN_NODE_Tast_erb_when_node_init (token_T *tag_opening, token_T *content, token_T *tag_closing, array_T *statements, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_ERB_CASE_NODE_Tast_erb_case_node_init (token_T *tag_opening, token_T *content, token_T *tag_closing, array_T *children, array_T *conditions, struct AST_ERB_ELSE_NODE_STRUCT *else_clause, struct AST_ERB_END_NODE_STRUCT *end_node, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_ERB_WHILE_NODE_Tast_erb_while_node_init (token_T *tag_opening, token_T *content, token_T *tag_closing, array_T *statements, struct AST_ERB_END_NODE_STRUCT *end_node, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_ERB_UNTIL_NODE_Tast_erb_until_node_init (token_T *tag_opening, token_T *content, token_T *tag_closing, array_T *statements, struct AST_ERB_END_NODE_STRUCT *end_node, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_ERB_FOR_NODE_Tast_erb_for_node_init (token_T *tag_opening, token_T *content, token_T *tag_closing, array_T *statements, struct AST_ERB_END_NODE_STRUCT *end_node, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_ERB_RESCUE_NODE_Tast_erb_rescue_node_init (token_T *tag_opening, token_T *content, token_T *tag_closing, array_T *statements, struct AST_ERB_RESCUE_NODE_STRUCT *subsequent, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_ERB_ENSURE_NODE_Tast_erb_ensure_node_init (token_T *tag_opening, token_T *content, token_T *tag_closing, array_T *statements, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_ERB_BEGIN_NODE_Tast_erb_begin_node_init (token_T *tag_opening, token_T *content, token_T *tag_closing, array_T *statements, struct AST_ERB_RESCUE_NODE_STRUCT *rescue_clause, struct AST_ERB_ELSE_NODE_STRUCT *else_clause, struct AST_ERB_ENSURE_NODE_STRUCT *ensure_clause, struct AST_ERB_END_NODE_STRUCT *end_node, position_T *start_position, position_T *end_position, array_T *errors)
 
AST_ERB_UNLESS_NODE_Tast_erb_unless_node_init (token_T *tag_opening, token_T *content, token_T *tag_closing, array_T *statements, struct AST_ERB_ELSE_NODE_STRUCT *else_clause, struct AST_ERB_END_NODE_STRUCT *end_node, position_T *start_position, position_T *end_position, array_T *errors)
 
const char * ast_node_type_to_string (AST_NODE_T *node)
 
const char * ast_node_human_type (AST_NODE_T *node)
 
void ast_free_base_node (AST_NODE_T *node)
 
static void ast_free_document_node (AST_DOCUMENT_NODE_T *document_node)
 
static void ast_free_literal_node (AST_LITERAL_NODE_T *literal_node)
 
static void ast_free_html_open_tag_node (AST_HTML_OPEN_TAG_NODE_T *html_open_tag_node)
 
static void ast_free_html_close_tag_node (AST_HTML_CLOSE_TAG_NODE_T *html_close_tag_node)
 
static void ast_free_html_self_close_tag_node (AST_HTML_SELF_CLOSE_TAG_NODE_T *html_self_close_tag_node)
 
static void ast_free_html_element_node (AST_HTML_ELEMENT_NODE_T *html_element_node)
 
static void ast_free_html_attribute_value_node (AST_HTML_ATTRIBUTE_VALUE_NODE_T *html_attribute_value_node)
 
static void ast_free_html_attribute_name_node (AST_HTML_ATTRIBUTE_NAME_NODE_T *html_attribute_name_node)
 
static void ast_free_html_attribute_node (AST_HTML_ATTRIBUTE_NODE_T *html_attribute_node)
 
static void ast_free_html_text_node (AST_HTML_TEXT_NODE_T *html_text_node)
 
static void ast_free_html_comment_node (AST_HTML_COMMENT_NODE_T *html_comment_node)
 
static void ast_free_html_doctype_node (AST_HTML_DOCTYPE_NODE_T *html_doctype_node)
 
static void ast_free_whitespace_node (AST_WHITESPACE_NODE_T *whitespace_node)
 
static void ast_free_erb_content_node (AST_ERB_CONTENT_NODE_T *erb_content_node)
 
static void ast_free_erb_end_node (AST_ERB_END_NODE_T *erb_end_node)
 
static void ast_free_erb_else_node (AST_ERB_ELSE_NODE_T *erb_else_node)
 
static void ast_free_erb_if_node (AST_ERB_IF_NODE_T *erb_if_node)
 
static void ast_free_erb_block_node (AST_ERB_BLOCK_NODE_T *erb_block_node)
 
static void ast_free_erb_when_node (AST_ERB_WHEN_NODE_T *erb_when_node)
 
static void ast_free_erb_case_node (AST_ERB_CASE_NODE_T *erb_case_node)
 
static void ast_free_erb_while_node (AST_ERB_WHILE_NODE_T *erb_while_node)
 
static void ast_free_erb_until_node (AST_ERB_UNTIL_NODE_T *erb_until_node)
 
static void ast_free_erb_for_node (AST_ERB_FOR_NODE_T *erb_for_node)
 
static void ast_free_erb_rescue_node (AST_ERB_RESCUE_NODE_T *erb_rescue_node)
 
static void ast_free_erb_ensure_node (AST_ERB_ENSURE_NODE_T *erb_ensure_node)
 
static void ast_free_erb_begin_node (AST_ERB_BEGIN_NODE_T *erb_begin_node)
 
static void ast_free_erb_unless_node (AST_ERB_UNLESS_NODE_T *erb_unless_node)
 
void ast_node_free (AST_NODE_T *node)
 

Function Documentation

◆ ast_document_node_init()

AST_DOCUMENT_NODE_T * ast_document_node_init ( array_T children,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_literal_node_init()

AST_LITERAL_NODE_T * ast_literal_node_init ( const char *  content,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_html_open_tag_node_init()

AST_HTML_OPEN_TAG_NODE_T * ast_html_open_tag_node_init ( token_T tag_opening,
token_T tag_name,
token_T tag_closing,
array_T children,
bool  is_void,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_html_close_tag_node_init()

AST_HTML_CLOSE_TAG_NODE_T * ast_html_close_tag_node_init ( token_T tag_opening,
token_T tag_name,
token_T tag_closing,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_html_self_close_tag_node_init()

AST_HTML_SELF_CLOSE_TAG_NODE_T * ast_html_self_close_tag_node_init ( token_T tag_opening,
token_T tag_name,
array_T attributes,
token_T tag_closing,
bool  is_void,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_html_element_node_init()

AST_HTML_ELEMENT_NODE_T * ast_html_element_node_init ( struct AST_HTML_OPEN_TAG_NODE_STRUCT open_tag,
token_T tag_name,
array_T body,
struct AST_HTML_CLOSE_TAG_NODE_STRUCT close_tag,
bool  is_void,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_html_attribute_value_node_init()

AST_HTML_ATTRIBUTE_VALUE_NODE_T * ast_html_attribute_value_node_init ( token_T open_quote,
array_T children,
token_T close_quote,
bool  quoted,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_html_attribute_name_node_init()

AST_HTML_ATTRIBUTE_NAME_NODE_T * ast_html_attribute_name_node_init ( token_T name,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_html_attribute_node_init()

AST_HTML_ATTRIBUTE_NODE_T * ast_html_attribute_node_init ( struct AST_HTML_ATTRIBUTE_NAME_NODE_STRUCT name,
token_T equals,
struct AST_HTML_ATTRIBUTE_VALUE_NODE_STRUCT value,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_html_text_node_init()

AST_HTML_TEXT_NODE_T * ast_html_text_node_init ( const char *  content,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_html_comment_node_init()

AST_HTML_COMMENT_NODE_T * ast_html_comment_node_init ( token_T comment_start,
array_T children,
token_T comment_end,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_html_doctype_node_init()

AST_HTML_DOCTYPE_NODE_T * ast_html_doctype_node_init ( token_T tag_opening,
array_T children,
token_T tag_closing,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_whitespace_node_init()

AST_WHITESPACE_NODE_T * ast_whitespace_node_init ( token_T value,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_erb_content_node_init()

AST_ERB_CONTENT_NODE_T * ast_erb_content_node_init ( token_T tag_opening,
token_T content,
token_T tag_closing,
analyzed_ruby_T analyzed_ruby,
bool  parsed,
bool  valid,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_erb_end_node_init()

AST_ERB_END_NODE_T * ast_erb_end_node_init ( token_T tag_opening,
token_T content,
token_T tag_closing,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_erb_else_node_init()

AST_ERB_ELSE_NODE_T * ast_erb_else_node_init ( token_T tag_opening,
token_T content,
token_T tag_closing,
array_T statements,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_erb_if_node_init()

AST_ERB_IF_NODE_T * ast_erb_if_node_init ( token_T tag_opening,
token_T content,
token_T tag_closing,
array_T statements,
AST_NODE_T subsequent,
struct AST_ERB_END_NODE_STRUCT end_node,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_erb_block_node_init()

AST_ERB_BLOCK_NODE_T * ast_erb_block_node_init ( token_T tag_opening,
token_T content,
token_T tag_closing,
array_T body,
struct AST_ERB_END_NODE_STRUCT end_node,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_erb_when_node_init()

AST_ERB_WHEN_NODE_T * ast_erb_when_node_init ( token_T tag_opening,
token_T content,
token_T tag_closing,
array_T statements,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_erb_case_node_init()

AST_ERB_CASE_NODE_T * ast_erb_case_node_init ( token_T tag_opening,
token_T content,
token_T tag_closing,
array_T children,
array_T conditions,
struct AST_ERB_ELSE_NODE_STRUCT else_clause,
struct AST_ERB_END_NODE_STRUCT end_node,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_erb_while_node_init()

AST_ERB_WHILE_NODE_T * ast_erb_while_node_init ( token_T tag_opening,
token_T content,
token_T tag_closing,
array_T statements,
struct AST_ERB_END_NODE_STRUCT end_node,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_erb_until_node_init()

AST_ERB_UNTIL_NODE_T * ast_erb_until_node_init ( token_T tag_opening,
token_T content,
token_T tag_closing,
array_T statements,
struct AST_ERB_END_NODE_STRUCT end_node,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_erb_for_node_init()

AST_ERB_FOR_NODE_T * ast_erb_for_node_init ( token_T tag_opening,
token_T content,
token_T tag_closing,
array_T statements,
struct AST_ERB_END_NODE_STRUCT end_node,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_erb_rescue_node_init()

AST_ERB_RESCUE_NODE_T * ast_erb_rescue_node_init ( token_T tag_opening,
token_T content,
token_T tag_closing,
array_T statements,
struct AST_ERB_RESCUE_NODE_STRUCT subsequent,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_erb_ensure_node_init()

AST_ERB_ENSURE_NODE_T * ast_erb_ensure_node_init ( token_T tag_opening,
token_T content,
token_T tag_closing,
array_T statements,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_erb_begin_node_init()

AST_ERB_BEGIN_NODE_T * ast_erb_begin_node_init ( token_T tag_opening,
token_T content,
token_T tag_closing,
array_T statements,
struct AST_ERB_RESCUE_NODE_STRUCT rescue_clause,
struct AST_ERB_ELSE_NODE_STRUCT else_clause,
struct AST_ERB_ENSURE_NODE_STRUCT ensure_clause,
struct AST_ERB_END_NODE_STRUCT end_node,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_erb_unless_node_init()

AST_ERB_UNLESS_NODE_T * ast_erb_unless_node_init ( token_T tag_opening,
token_T content,
token_T tag_closing,
array_T statements,
struct AST_ERB_ELSE_NODE_STRUCT else_clause,
struct AST_ERB_END_NODE_STRUCT end_node,
position_T start_position,
position_T end_position,
array_T errors 
)

◆ ast_node_type_to_string()

const char * ast_node_type_to_string ( AST_NODE_T node)

◆ ast_node_human_type()

const char * ast_node_human_type ( AST_NODE_T node)

◆ ast_free_base_node()

void ast_free_base_node ( AST_NODE_T node)

◆ ast_free_document_node()

static void ast_free_document_node ( AST_DOCUMENT_NODE_T document_node)
static

◆ ast_free_literal_node()

static void ast_free_literal_node ( AST_LITERAL_NODE_T literal_node)
static

◆ ast_free_html_open_tag_node()

static void ast_free_html_open_tag_node ( AST_HTML_OPEN_TAG_NODE_T html_open_tag_node)
static

◆ ast_free_html_close_tag_node()

static void ast_free_html_close_tag_node ( AST_HTML_CLOSE_TAG_NODE_T html_close_tag_node)
static

◆ ast_free_html_self_close_tag_node()

static void ast_free_html_self_close_tag_node ( AST_HTML_SELF_CLOSE_TAG_NODE_T html_self_close_tag_node)
static

◆ ast_free_html_element_node()

static void ast_free_html_element_node ( AST_HTML_ELEMENT_NODE_T html_element_node)
static

◆ ast_free_html_attribute_value_node()

static void ast_free_html_attribute_value_node ( AST_HTML_ATTRIBUTE_VALUE_NODE_T html_attribute_value_node)
static

◆ ast_free_html_attribute_name_node()

static void ast_free_html_attribute_name_node ( AST_HTML_ATTRIBUTE_NAME_NODE_T html_attribute_name_node)
static

◆ ast_free_html_attribute_node()

static void ast_free_html_attribute_node ( AST_HTML_ATTRIBUTE_NODE_T html_attribute_node)
static

◆ ast_free_html_text_node()

static void ast_free_html_text_node ( AST_HTML_TEXT_NODE_T html_text_node)
static

◆ ast_free_html_comment_node()

static void ast_free_html_comment_node ( AST_HTML_COMMENT_NODE_T html_comment_node)
static

◆ ast_free_html_doctype_node()

static void ast_free_html_doctype_node ( AST_HTML_DOCTYPE_NODE_T html_doctype_node)
static

◆ ast_free_whitespace_node()

static void ast_free_whitespace_node ( AST_WHITESPACE_NODE_T whitespace_node)
static

◆ ast_free_erb_content_node()

static void ast_free_erb_content_node ( AST_ERB_CONTENT_NODE_T erb_content_node)
static

◆ ast_free_erb_end_node()

static void ast_free_erb_end_node ( AST_ERB_END_NODE_T erb_end_node)
static

◆ ast_free_erb_else_node()

static void ast_free_erb_else_node ( AST_ERB_ELSE_NODE_T erb_else_node)
static

◆ ast_free_erb_if_node()

static void ast_free_erb_if_node ( AST_ERB_IF_NODE_T erb_if_node)
static

◆ ast_free_erb_block_node()

static void ast_free_erb_block_node ( AST_ERB_BLOCK_NODE_T erb_block_node)
static

◆ ast_free_erb_when_node()

static void ast_free_erb_when_node ( AST_ERB_WHEN_NODE_T erb_when_node)
static

◆ ast_free_erb_case_node()

static void ast_free_erb_case_node ( AST_ERB_CASE_NODE_T erb_case_node)
static

◆ ast_free_erb_while_node()

static void ast_free_erb_while_node ( AST_ERB_WHILE_NODE_T erb_while_node)
static

◆ ast_free_erb_until_node()

static void ast_free_erb_until_node ( AST_ERB_UNTIL_NODE_T erb_until_node)
static

◆ ast_free_erb_for_node()

static void ast_free_erb_for_node ( AST_ERB_FOR_NODE_T erb_for_node)
static

◆ ast_free_erb_rescue_node()

static void ast_free_erb_rescue_node ( AST_ERB_RESCUE_NODE_T erb_rescue_node)
static

◆ ast_free_erb_ensure_node()

static void ast_free_erb_ensure_node ( AST_ERB_ENSURE_NODE_T erb_ensure_node)
static

◆ ast_free_erb_begin_node()

static void ast_free_erb_begin_node ( AST_ERB_BEGIN_NODE_T erb_begin_node)
static

◆ ast_free_erb_unless_node()

static void ast_free_erb_unless_node ( AST_ERB_UNLESS_NODE_T erb_unless_node)
static

◆ ast_node_free()

void ast_node_free ( AST_NODE_T node)