Purple
0.1
Standard Language Specification
|
Function headers for abstract syntax tree parsing. More...
#include <stdlib.h>
#include "scan.h"
#include "translate/symbol_table.h"
#include "utils/logging.h"
Go to the source code of this file.
Classes | |
struct | ASTNode |
Component of the abstract syntax tree built during parsing. More... | |
Typedefs | |
typedef struct ASTNode | ASTNode |
Component of the abstract syntax tree built during parsing. More... | |
Functions | |
ASTNode * | create_ast_node (TokenType ttype, ASTNode *left, ASTNode *mid, ASTNode *right, Type type, char *symbol_name) |
Constructs a new AST Node with the provided values. More... | |
void | add_position_info (ASTNode *dest, position p) |
Add position information to an ASTNode. More... | |
ASTNode * | create_ast_nonidentifier_leaf (TokenType ttype, Type type) |
Constructs a new AST Leaf Node with the provided values for a token that is not an identifier. More... | |
ASTNode * | create_ast_identifier_leaf (TokenType ttype, char *symbol_name) |
Constructs a new AST Leaf Node with the provided values for a token that is an identifier. More... | |
ASTNode * | create_unary_ast_node (TokenType ttype, ASTNode *child, Type type, char *symbol_name) |
Constructs a new AST Unary Parent Node with the provided values. More... | |
void | ast_debug_level_order (ASTNode *root, LogLevel log_level) |
Print out an AST's level order traversal. More... | |
Function headers for abstract syntax tree parsing.
Print out an AST's level order traversal.
root | Root of AST |
log_level | Log level to print at |
Constructs a new AST Leaf Node with the provided values for a token that is an identifier.
ttype | TokenType of the new AST Node |
symbol_name | The identifier for the provided Token information |
ASTNode * create_ast_node | ( | TokenType | ttype, |
ASTNode * | left, | ||
ASTNode * | mid, | ||
ASTNode * | right, | ||
Type | type, | ||
char * | symbol_name | ||
) |
Constructs a new AST Node with the provided values.
ttype | TokenType of the new AST Node |
left | Left child subtree of the new AST Node |
mid | Middle child subtree of the new AST Node |
right | Right child subtree of the new AST Node |
type | Type of the new AST Node |
symbol_name | The identifier for the provided Token information |
Constructs a new AST Leaf Node with the provided values for a token that is not an identifier.
ttype | TokenType of the new AST Node |
type | Type of the new AST Node |
Constructs a new AST Unary Parent Node with the provided values.
ttype | TokenType of the new AST Node |
child | The AST Node's single child |
type | Type of the new AST Node |
symbol_name | The identifier for the provided Token information |