Updated to not have headers in source directories
This commit is contained in:
parent
0c435ed040
commit
91bb0a7533
33 changed files with 3668 additions and 4101 deletions
|
|
@ -1 +1 @@
|
||||||
../parser/includes/
|
../parser/include/parser
|
||||||
|
|
@ -5,7 +5,6 @@ language \
|
||||||
length \
|
length \
|
||||||
lex \
|
lex \
|
||||||
lexer \
|
lexer \
|
||||||
lib \
|
|
||||||
node \
|
node \
|
||||||
parser \
|
parser \
|
||||||
point \
|
point \
|
||||||
|
|
|
||||||
|
|
@ -21,15 +21,15 @@ NAME = lib$(ANAME).a
|
||||||
LIB_NAME ?=
|
LIB_NAME ?=
|
||||||
TARGET = $(BUILD_DIR)/$(NAME)
|
TARGET = $(BUILD_DIR)/$(NAME)
|
||||||
CC ?= cc
|
CC ?= cc
|
||||||
CFLAGS = -Wall -Wextra -Werror -MMD -I./includes -I../includes -I../output/include -I$(SRC_DIR)
|
CFLAGS = -Wall -Wextra -Werror -MMD -I./include -I../includes -I../output/include -I$(SRC_DIR)
|
||||||
CFLAGS += $(CFLAGS_ADDITIONAL)
|
CFLAGS += $(CFLAGS_ADDITIONAL)
|
||||||
#CFLAGS += -fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-return=runtime -fno-common -fsanitize-address-use-after-scope
|
#CFLAGS += -fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-return=runtime -fno-common -fsanitize-address-use-after-scope
|
||||||
|
|
||||||
SRC_FILES = lib
|
# SRC_FILES = lib
|
||||||
GEN_FILES =
|
# GEN_FILES =
|
||||||
|
|
||||||
# TODO: change from only lib.c to filelist
|
# TODO: change from only lib.c to filelist
|
||||||
#-include Filelist.$(ANAME).mk
|
-include Filelist.$(ANAME).mk
|
||||||
|
|
||||||
SRC = $(addsuffix .c,$(addprefix $(SRC_DIR)/,$(SRC_FILES)) $(addprefix $(GEN_DIR)/,$(GEN_FILES)))
|
SRC = $(addsuffix .c,$(addprefix $(SRC_DIR)/,$(SRC_FILES)) $(addprefix $(GEN_DIR)/,$(GEN_FILES)))
|
||||||
OBJ = $(addsuffix .o,$(addprefix $(BUILD_DIR)/$(ANAME)/,$(SRC_FILES))) $(addsuffix .o,$(addprefix $(BUILD_DIR)/$(ANAME)/,$(GEN_FILES)))
|
OBJ = $(addsuffix .o,$(addprefix $(BUILD_DIR)/$(ANAME)/,$(SRC_FILES))) $(addsuffix .o,$(addprefix $(BUILD_DIR)/$(ANAME)/,$(GEN_FILES)))
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,12 @@ typedef struct TSNode
|
||||||
const TSTree *tree;
|
const TSTree *tree;
|
||||||
} TSNode;
|
} TSNode;
|
||||||
|
|
||||||
|
typedef TSNode t_parse_node;
|
||||||
|
typedef TSSymbol t_symbol;
|
||||||
|
typedef TSParser t_first_parser;
|
||||||
|
typedef TSLanguage t_language;
|
||||||
|
typedef TSTree t_first_tree;
|
||||||
|
|
||||||
typedef struct TSTreeCursor
|
typedef struct TSTreeCursor
|
||||||
{
|
{
|
||||||
const void *tree;
|
const void *tree;
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef LANGUAGE_H
|
#ifndef LANGUAGE_H
|
||||||
#define LANGUAGE_H
|
#define LANGUAGE_H
|
||||||
|
|
||||||
#include "./parser.h"
|
#include "parser/parser.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
|
|
||||||
#define ts_builtin_sym_error_repeat (ts_builtin_sym_error - 1)
|
#define ts_builtin_sym_error_repeat (ts_builtin_sym_error - 1)
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef LENGTH_H
|
#ifndef LENGTH_H
|
||||||
#define LENGTH_H
|
#define LENGTH_H
|
||||||
|
|
||||||
#include "./api.h"
|
#include "parser/api.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
|
|
||||||
struct Length
|
struct Length
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
#ifndef LEXER_H
|
#ifndef LEXER_H
|
||||||
#define LEXER_H
|
#define LEXER_H
|
||||||
|
|
||||||
#include "./api.h"
|
#include "parser/api.h"
|
||||||
#include "./length.h"
|
#include "parser/length.h"
|
||||||
#include "./parser.h"
|
#include "parser/parser.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
|
|
||||||
struct Lexer
|
struct Lexer
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef POINT_H
|
#ifndef POINT_H
|
||||||
#define POINT_H
|
#define POINT_H
|
||||||
|
|
||||||
#include "./api.h"
|
#include "parser/api.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
|
|
||||||
#define POINT_ZERO ((TSPoint){0, 0})
|
#define POINT_ZERO ((TSPoint){0, 0})
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#ifndef REDUCE_ACTION_H
|
#ifndef REDUCE_ACTION_H
|
||||||
#define REDUCE_ACTION_H
|
#define REDUCE_ACTION_H
|
||||||
|
|
||||||
#include "./api.h"
|
#include "parser/api.h"
|
||||||
#include "./array.h"
|
#include "parser/array.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
|
|
||||||
struct ReduceAction
|
struct ReduceAction
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#ifndef PARSE_STACK_H
|
#ifndef PARSE_STACK_H
|
||||||
#define PARSE_STACK_H
|
#define PARSE_STACK_H
|
||||||
|
|
||||||
#include "./array.h"
|
#include "parser/array.h"
|
||||||
#include "./subtree.h"
|
#include "parser/subtree.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
|
|
||||||
typedef struct Stack Stack;
|
typedef struct Stack Stack;
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
#ifndef SUBTREE_H
|
#ifndef SUBTREE_H
|
||||||
#define SUBTREE_H
|
#define SUBTREE_H
|
||||||
|
|
||||||
#include "./api.h"
|
#include "parser/api.h"
|
||||||
#include "./array.h"
|
#include "parser/array.h"
|
||||||
#include "./length.h"
|
#include "parser/length.h"
|
||||||
#include "./parser.h"
|
#include "parser/parser.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef TREE_H
|
#ifndef TREE_H
|
||||||
#define TREE_H
|
#define TREE_H
|
||||||
|
|
||||||
#include "./subtree.h"
|
#include "parser/subtree.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
#include "../src/api.h"
|
|
||||||
#include "../src/array.h"
|
|
||||||
#include "../src/language.h"
|
|
||||||
#include "../src/length.h"
|
|
||||||
#include "../src/lexer.h"
|
|
||||||
#include "../src/parser.h"
|
|
||||||
#include "../src/stack.h"
|
|
||||||
#include "../src/subtree.h"
|
|
||||||
#include "../src/tree.h"
|
|
||||||
#include "me/mem/mem.h"
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
typedef TSNode t_parse_node;
|
|
||||||
typedef TSSymbol t_symbol;
|
|
||||||
typedef TSParser t_first_parser;
|
|
||||||
typedef TSTree t_first_tree;
|
|
||||||
typedef TSLanguage t_language;
|
|
||||||
|
|
||||||
TSFieldId ts_node_field_id_for_child(TSNode self, uint32_t child_index);
|
|
||||||
|
|
@ -16,9 +16,9 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "./src/api.h"
|
#include "parser/api.h"
|
||||||
#include "./src/lexer.h"
|
#include "parser/lexer.h"
|
||||||
#include "./src/parser.h"
|
#include "parser/parser.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
|
|
||||||
typedef TSSymbolMetadata t_symbol_metadata;
|
typedef TSSymbolMetadata t_symbol_metadata;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
#include "../static/headers/constants.h"
|
#include "../static/headers/constants.h"
|
||||||
#include "../static/headers/symbols.h"
|
#include "../static/headers/symbols.h"
|
||||||
#include "./parser.h"
|
#include "parser/parser.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
|
|
||||||
// bool lex_keywords_main(TSLexer *lexer, TSStateId state);
|
// bool lex_keywords_main(TSLexer *lexer, TSStateId state);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#include "./input.h"
|
#include "parser/input.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
|
|
||||||
t_u32 ts_decode_ascii(const t_u8 *string, t_u32 length, t_i32 *code_point)
|
t_u32 ts_decode_ascii(const t_u8 *string, t_u32 length, t_i32 *code_point)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#include "./language.h"
|
#include "parser/language.h"
|
||||||
#include "./api.h"
|
#include "parser/api.h"
|
||||||
|
#include "parser/parser.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
#include "parser.h"
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#include "./length.h"
|
#include "parser/length.h"
|
||||||
#include "./point.h"
|
#include "parser/point.h"
|
||||||
|
|
||||||
bool length_is_undefined(Length length)
|
bool length_is_undefined(Length length)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
7596
parser/src/lex.c
7596
parser/src/lex.c
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
||||||
#include "./lexer.h"
|
#include "parser/lexer.h"
|
||||||
#include "./length.h"
|
#include "parser/length.h"
|
||||||
#include "./input.h"
|
#include "parser/input.h"
|
||||||
#include "me/mem/mem.h"
|
#include "me/mem/mem.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
#define _POSIX_C_SOURCE 200112L
|
|
||||||
|
|
||||||
#include "./create_language.c"
|
|
||||||
#include "./input.c"
|
|
||||||
#include "./language.c"
|
|
||||||
#include "./length.c"
|
|
||||||
#include "./lex.c"
|
|
||||||
#include "./lexer.c"
|
|
||||||
#include "./node.c"
|
|
||||||
#include "./parser.c"
|
|
||||||
#include "./point.c"
|
|
||||||
#include "./reduce_action.c"
|
|
||||||
#include "./scanner.c"
|
|
||||||
#include "./stack.c"
|
|
||||||
#include "./subtree.c"
|
|
||||||
#include "./tree.c"
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
#include "./api.h"
|
#include "parser/api.h"
|
||||||
#include "./language.h"
|
#include "parser/language.h"
|
||||||
#include "./subtree.h"
|
#include "parser/subtree.h"
|
||||||
#include "./tree.h"
|
#include "parser/tree.h"
|
||||||
|
#include "parser/point.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
|
|
||||||
typedef struct NodeChildIterator
|
typedef struct NodeChildIterator
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
#define _POSIX_C_SOURCE 200112L
|
#define _POSIX_C_SOURCE 200112L
|
||||||
|
|
||||||
#include "./api.h"
|
#include "parser/api.h"
|
||||||
#include "./array.h"
|
#include "parser/array.h"
|
||||||
#include "./language.h"
|
#include "parser/language.h"
|
||||||
#include "./length.h"
|
#include "parser/length.h"
|
||||||
#include "./lexer.h"
|
#include "parser/lexer.h"
|
||||||
#include "./reduce_action.h"
|
#include "parser/reduce_action.h"
|
||||||
#include "./stack.h"
|
#include "parser/stack.h"
|
||||||
#include "./subtree.h"
|
#include "parser/subtree.h"
|
||||||
#include "./tree.h"
|
#include "parser/tree.h"
|
||||||
#include "me/mem/mem.h"
|
#include "me/mem/mem.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#include "./point.h"
|
#include "parser/point.h"
|
||||||
|
|
||||||
TSPoint point__new(t_u32 row, t_u32 column)
|
TSPoint point__new(t_u32 row, t_u32 column)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#include "./reduce_action.h"
|
#include "parser/reduce_action.h"
|
||||||
|
|
||||||
void ts_reduce_action_set_add(ReduceActionSet *self, ReduceAction new_action)
|
void ts_reduce_action_set_add(ReduceActionSet *self, ReduceAction new_action)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include "array.h"
|
#include "parser/array.h"
|
||||||
|
#include "parser/parser.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
#include "parser.h"
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
#include "./stack.h"
|
#include "parser/stack.h"
|
||||||
#include "./array.h"
|
#include "parser/array.h"
|
||||||
#include "./language.h"
|
#include "parser/language.h"
|
||||||
#include "./length.h"
|
#include "parser/length.h"
|
||||||
#include "./subtree.h"
|
#include "parser/subtree.h"
|
||||||
#include "me/mem/mem.h"
|
#include "me/mem/mem.h"
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
#include "./array.h"
|
#include "parser/array.h"
|
||||||
#include "./language.h"
|
#include "parser/language.h"
|
||||||
#include "./length.h"
|
#include "parser/length.h"
|
||||||
#include "./subtree.h"
|
#include "parser/subtree.h"
|
||||||
#include "me/mem/mem.h"
|
#include "me/mem/mem.h"
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,12 @@
|
||||||
|
|
||||||
|
|
||||||
#include "me/types.h"
|
#include "me/types.h"
|
||||||
#include "./tree.h"
|
#include "parser/tree.h"
|
||||||
#include "./array.h"
|
#include "parser/array.h"
|
||||||
#include "./length.h"
|
#include "parser/length.h"
|
||||||
#include "./subtree.h"
|
#include "parser/subtree.h"
|
||||||
#include "api.h"
|
#include "parser/api.h"
|
||||||
|
#include "parser/point.h"
|
||||||
|
|
||||||
TSTree *ts_tree_new(Subtree root, const TSLanguage *language, const TSRange *included_ranges, t_u32 included_range_count)
|
TSTree *ts_tree_new(Subtree root, const TSLanguage *language, const TSRange *included_ranges, t_u32 included_range_count)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
#include "parser/api.h"
|
#include "parser/api.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include "me/mem/mem.h"
|
||||||
|
|
||||||
t_error ast_from_node(t_parse_node node, t_str input, t_ast_node *out);
|
t_error ast_from_node(t_parse_node node, t_str input, t_ast_node *out);
|
||||||
void ast_print_node(t_ast_node self);
|
void ast_print_node(t_ast_node self);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue