Add se_istravesable
This commit is contained in:
parent
7ed5367f20
commit
6fae121463
@ -2,6 +2,10 @@
|
||||
|
||||
#include "syntax.h"
|
||||
|
||||
bool se_istraversable(struct SyntaxElement* syntaxtree) {
|
||||
return syntaxtree->type == TREE && syntaxtree->content != NULL;
|
||||
}
|
||||
|
||||
struct SyntaxElement* se_create(void) {
|
||||
struct SyntaxElement* syntaxelement = malloc(sizeof(struct SyntaxElement));
|
||||
syntaxelement->type = NONE;
|
||||
|
@ -1,5 +1,7 @@
|
||||
#ifndef SYNTAX_H
|
||||
#define SYNTAX_H
|
||||
#include <stdbool.h>
|
||||
|
||||
enum SyntaxElementType {
|
||||
TREE,
|
||||
TOKEN,
|
||||
@ -16,6 +18,7 @@ struct SyntaxElement {
|
||||
};
|
||||
|
||||
void se_clean(struct SyntaxElement* syntaxtree);
|
||||
bool se_istraversable(struct SyntaxElement* syntaxtree);
|
||||
struct SyntaxElement* se_create(void);
|
||||
struct SyntaxElement* se_init(void);
|
||||
struct SyntaxElement* se_bottom(struct SyntaxElement* syntaxelement);
|
||||
|
Loading…
Reference in New Issue
Block a user