From 967be9e750221ab2ab783f95df79bb26d290a45e Mon Sep 17 00:00:00 2001 From: Martial Simon Date: Mon, 15 Sep 2025 01:07:58 +0200 Subject: add: added projects --- 21sh/autotools/src/42sh.c | 7 +++++++ 21sh/autotools/src/Makefile.am | 7 +++++++ 21sh/autotools/src/ast/Makefile.am | 6 ++++++ 21sh/autotools/src/ast/ast.c | 11 +++++++++++ 21sh/autotools/src/ast/ast.h | 6 ++++++ 21sh/autotools/src/lexer/Makefile.am | 6 ++++++ 21sh/autotools/src/lexer/lexer.c | 8 ++++++++ 21sh/autotools/src/lexer/lexer.h | 6 ++++++ 21sh/autotools/src/parser/Makefile.am | 6 ++++++ 21sh/autotools/src/parser/parser.c | 11 +++++++++++ 21sh/autotools/src/parser/parser.h | 6 ++++++ 11 files changed, 80 insertions(+) create mode 100644 21sh/autotools/src/42sh.c create mode 100644 21sh/autotools/src/Makefile.am create mode 100644 21sh/autotools/src/ast/Makefile.am create mode 100644 21sh/autotools/src/ast/ast.c create mode 100644 21sh/autotools/src/ast/ast.h create mode 100644 21sh/autotools/src/lexer/Makefile.am create mode 100644 21sh/autotools/src/lexer/lexer.c create mode 100644 21sh/autotools/src/lexer/lexer.h create mode 100644 21sh/autotools/src/parser/Makefile.am create mode 100644 21sh/autotools/src/parser/parser.c create mode 100644 21sh/autotools/src/parser/parser.h (limited to '21sh/autotools/src') diff --git a/21sh/autotools/src/42sh.c b/21sh/autotools/src/42sh.c new file mode 100644 index 0000000..cb3f00b --- /dev/null +++ b/21sh/autotools/src/42sh.c @@ -0,0 +1,7 @@ +#include "ast/ast.h" + +int main(void) +{ + print_ast(); + return 0; +} diff --git a/21sh/autotools/src/Makefile.am b/21sh/autotools/src/Makefile.am new file mode 100644 index 0000000..6a2c6ae --- /dev/null +++ b/21sh/autotools/src/Makefile.am @@ -0,0 +1,7 @@ +SUBDIRS = ast lexer parser + +bin_PROGRAMS = 42sh +42sh_SOURCES = 42sh.c +42sh_CPPFLAGS = -I%D% +42sh_CFLAGS = -std=c99 -Werror -Wall -Wextra -Wvla -pedantic +42sh_LDADD = ast/libast.a lexer/liblexer.a parser/libparser.a diff --git a/21sh/autotools/src/ast/Makefile.am b/21sh/autotools/src/ast/Makefile.am new file mode 100644 index 0000000..d455958 --- /dev/null +++ b/21sh/autotools/src/ast/Makefile.am @@ -0,0 +1,6 @@ +lib_LIBRARIES = libast.a + +libast_a_SOURCES = ast.c ast.h +libast_a_CPPFLAGS = -I$(top_srcdir)/src +libast_a_CFLAGS = -std=c99 -Werror -Wall -Wextra -Wvla -pedantic +noinst_LIBRARIES = libast.a diff --git a/21sh/autotools/src/ast/ast.c b/21sh/autotools/src/ast/ast.c new file mode 100644 index 0000000..084dbf9 --- /dev/null +++ b/21sh/autotools/src/ast/ast.c @@ -0,0 +1,11 @@ +#include "ast.h" + +#include + +#include "parser/parser.h" + +void print_ast() +{ + printf("ast !!!\n"); + print_parser(); +} diff --git a/21sh/autotools/src/ast/ast.h b/21sh/autotools/src/ast/ast.h new file mode 100644 index 0000000..83d52b3 --- /dev/null +++ b/21sh/autotools/src/ast/ast.h @@ -0,0 +1,6 @@ +#ifndef AST_H +#define AST_H + +void print_ast(); + +#endif /* ! AST_H */ diff --git a/21sh/autotools/src/lexer/Makefile.am b/21sh/autotools/src/lexer/Makefile.am new file mode 100644 index 0000000..f5f78b2 --- /dev/null +++ b/21sh/autotools/src/lexer/Makefile.am @@ -0,0 +1,6 @@ +lib_LIBRARIES = liblexer.a + +liblexer_a_SOURCES = lexer.c lexer.h +liblexer_a_CPPFLAGS = -I$(top_srcdir)/src +liblexer_a_CFLAGS = -std=c99 -Werror -Wall -Wextra -Wvla -pedantic +noinst_LIBRARIES = liblexer.a diff --git a/21sh/autotools/src/lexer/lexer.c b/21sh/autotools/src/lexer/lexer.c new file mode 100644 index 0000000..2e9d2f9 --- /dev/null +++ b/21sh/autotools/src/lexer/lexer.c @@ -0,0 +1,8 @@ +#include "lexer.h" + +#include + +void print_lexer() +{ + puts("Vive les lexer"); +} diff --git a/21sh/autotools/src/lexer/lexer.h b/21sh/autotools/src/lexer/lexer.h new file mode 100644 index 0000000..0cc2c2e --- /dev/null +++ b/21sh/autotools/src/lexer/lexer.h @@ -0,0 +1,6 @@ +#ifndef LEXER_H +#define LEXER_H + +void print_lexer(); + +#endif /* ! LEXER_H */ diff --git a/21sh/autotools/src/parser/Makefile.am b/21sh/autotools/src/parser/Makefile.am new file mode 100644 index 0000000..c8fe590 --- /dev/null +++ b/21sh/autotools/src/parser/Makefile.am @@ -0,0 +1,6 @@ +lib_LIBRARIES = libparser.a + +libparser_a_SOURCES = parser.c parser.h $(top_srcdir)/src/lexer/lexer.c $(top_srcdir)/src/lexer/lexer.h +libparser_a_CPPFLAGS = -I$(top_srcdir)/src +libparser_a_CFLAGS = -std=c99 -Werror -Wall -Wextra -Wvla -pedantic +noinst_LIBRARIES = libparser.a diff --git a/21sh/autotools/src/parser/parser.c b/21sh/autotools/src/parser/parser.c new file mode 100644 index 0000000..28f5824 --- /dev/null +++ b/21sh/autotools/src/parser/parser.c @@ -0,0 +1,11 @@ +#include "parser.h" + +#include + +#include "lexer/lexer.h" + +void print_parser() +{ + print_lexer(); + printf("parser !!!\n"); +} diff --git a/21sh/autotools/src/parser/parser.h b/21sh/autotools/src/parser/parser.h new file mode 100644 index 0000000..38d2ae3 --- /dev/null +++ b/21sh/autotools/src/parser/parser.h @@ -0,0 +1,6 @@ +#ifndef PARSER_H +#define PARSER_H + +void print_parser(); + +#endif /* ! PARSER_H */ -- cgit v1.2.3