Zen-C
Loading...
Searching...
No Matches
parser_stmt.c File Reference
#include "parser.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "../ast/ast.h"
#include "../plugins/plugin_manager.h"
#include "../zen/zen_facts.h"
#include "zprep_plugin.h"
#include "../codegen/codegen.h"
Include dependency graph for parser_stmt.c:

Macros

#define APPEND_STMT(node)
 

Functions

char * run_comptime_block (ParserContext *ctx, Lexer *l)
 
ASTNodeparse_match (ParserContext *ctx, Lexer *l)
 Parses a match statement.
 
ASTNodeparse_loop (ParserContext *ctx, Lexer *l)
 Parses a loop.
 
ASTNodeparse_repeat (ParserContext *ctx, Lexer *l)
 Parses a repeat loop.
 
ASTNodeparse_unless (ParserContext *ctx, Lexer *l)
 Parses an unless statement.
 
ASTNodeparse_guard (ParserContext *ctx, Lexer *l)
 Parses a guard statement.
 
ASTNodeparse_defer (ParserContext *ctx, Lexer *l)
 Parses a defer statement.
 
ASTNodeparse_asm (ParserContext *ctx, Lexer *l)
 Parses an asm statement.
 
ASTNodeparse_test (ParserContext *ctx, Lexer *l)
 Parses a test definition.
 
ASTNodeparse_assert (ParserContext *ctx, Lexer *l)
 Parses an assert statement.
 
ASTNodeparse_return (ParserContext *ctx, Lexer *l)
 Parses a return statement.
 
ASTNodeparse_if (ParserContext *ctx, Lexer *l)
 Parses an if statement.
 
ASTNodeparse_while (ParserContext *ctx, Lexer *l)
 Parses a while loop.
 
ASTNodeparse_for (ParserContext *ctx, Lexer *l)
 Parses a for loop.
 
char * process_printf_sugar (ParserContext *ctx, const char *content, int newline, const char *target, char ***used_syms, int *count, int check_symbols)
 Processes a formatted string.
 
ASTNodeparse_macro_call (ParserContext *ctx, Lexer *l, char *macro_name)
 Parses a macro call.
 
ASTNodeparse_statement (ParserContext *ctx, Lexer *l)
 Parses a statement.
 
ASTNodeparse_block (ParserContext *ctx, Lexer *l)
 Parses a block of statements { ... }.
 
ASTNodeparse_include (ParserContext *ctx, Lexer *l)
 Parses an include statement.
 
ASTNodeparse_import (ParserContext *ctx, Lexer *l)
 Parses an import statement.
 
ASTNodeparse_comptime (ParserContext *ctx, Lexer *l)
 Parses a comptime statement.
 
ASTNodeparse_plugin (ParserContext *ctx, Lexer *l)
 Parses a plugin statement.
 

Variables

char * curr_func_ret = NULL
 
char * g_current_filename
 

Macro Definition Documentation

◆ APPEND_STMT

#define APPEND_STMT (   node)
Value:
if (!stmts_head) \
{ \
stmts_head = node; \
stmts_tail = node; \
} \
else \
{ \
stmts_tail->next = node; \
stmts_tail = node; \
}

Function Documentation

◆ parse_asm()

ASTNode * parse_asm ( ParserContext ctx,
Lexer l 
)

Parses an asm statement.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_assert()

ASTNode * parse_assert ( ParserContext ctx,
Lexer l 
)

Parses an assert statement.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_block()

ASTNode * parse_block ( ParserContext ctx,
Lexer l 
)

Parses a block of statements { ... }.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_comptime()

ASTNode * parse_comptime ( ParserContext ctx,
Lexer l 
)

Parses a comptime statement.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_defer()

ASTNode * parse_defer ( ParserContext ctx,
Lexer l 
)

Parses a defer statement.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_for()

ASTNode * parse_for ( ParserContext ctx,
Lexer l 
)

Parses a for loop.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_guard()

ASTNode * parse_guard ( ParserContext ctx,
Lexer l 
)

Parses a guard statement.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_if()

ASTNode * parse_if ( ParserContext ctx,
Lexer l 
)

Parses an if statement.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_import()

ASTNode * parse_import ( ParserContext ctx,
Lexer l 
)

Parses an import statement.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_include()

ASTNode * parse_include ( ParserContext ctx,
Lexer l 
)

Parses an include statement.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_loop()

ASTNode * parse_loop ( ParserContext ctx,
Lexer l 
)

Parses a loop.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_macro_call()

ASTNode * parse_macro_call ( ParserContext ctx,
Lexer l,
char *  macro_name 
)

Parses a macro call.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_match()

ASTNode * parse_match ( ParserContext ctx,
Lexer l 
)

Parses a match statement.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_plugin()

ASTNode * parse_plugin ( ParserContext ctx,
Lexer l 
)

Parses a plugin statement.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_repeat()

ASTNode * parse_repeat ( ParserContext ctx,
Lexer l 
)

Parses a repeat loop.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_return()

ASTNode * parse_return ( ParserContext ctx,
Lexer l 
)

Parses a return statement.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_statement()

ASTNode * parse_statement ( ParserContext ctx,
Lexer l 
)

Parses a statement.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_test()

ASTNode * parse_test ( ParserContext ctx,
Lexer l 
)

Parses a test definition.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_unless()

ASTNode * parse_unless ( ParserContext ctx,
Lexer l 
)

Parses an unless statement.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_while()

ASTNode * parse_while ( ParserContext ctx,
Lexer l 
)

Parses a while loop.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_printf_sugar()

char * process_printf_sugar ( ParserContext ctx,
const char *  content,
int  newline,
const char *  target,
char ***  used_syms,
int *  count,
int  check_symbols 
)

Processes a formatted string.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_comptime_block()

char * run_comptime_block ( ParserContext ctx,
Lexer l 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ curr_func_ret

char* curr_func_ret = NULL

◆ g_current_filename

char* g_current_filename
extern