aboutsummaryrefslogtreecommitdiffstats
path: root/program.h
diff options
context:
space:
mode:
authorAdam Branes <adam@adam>2021-05-02 17:46:29 +0300
committerGalin Simeonov <gts@volconst.com>2021-07-15 18:00:07 +0300
commit679cbe58c4e53f0163588a7731154f3afe2d25aa (patch)
treea2dbc2317a3f107899d60f5e68c8d6cf8d27e146 /program.h
parenta3e36c1918e63761dfc4d2221cca3636b98e93aa (diff)
downloadMEGATRON-679cbe58c4e53f0163588a7731154f3afe2d25aa.tar.gz
lexer formed
Diffstat (limited to 'program.h')
-rw-r--r--program.h40
1 files changed, 33 insertions, 7 deletions
diff --git a/program.h b/program.h
index dfb5098..8445fa3 100644
--- a/program.h
+++ b/program.h
@@ -1,35 +1,61 @@
#ifndef PROGRAM_H
#define PROGRAM_H
-#include "queue.h"
+#include <queue.h>
+#include <lexer.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+struct token;
struct Source
{
+ size_t src_size;
+ size_t where_in_src;
+ size_t current_column;
+ size_t current_row;
char *src_name;
char *src;
- size_t src_size;
};
struct Options
{
int print_tokens:1;
+ char *source;
};
+struct Error
+{
+ char *message;
+ size_t row;
+ size_t column;
+};
+
struct Translation_Data
{
struct Queue *errors;
struct Queue *tokens;
+ size_t hold_number_of_errors;
+};
+struct Program
+{
+ struct Source *source;
+
};
struct Source* extract_source(char *src_name);
+struct Options* parse_command_line(char **argv);
struct Translation_Data* get_translation_data();
-struct Source* get_source();
-struct Options* get_options();
+struct Error* get_error(char *message,size_t row,size_t column);
+void push_lexing_error(char *error_message,struct Source *src,struct Translation_Data *translation_data);
+void push_parsing_error(char *error_message,struct token *token ,struct Translation_Data *translation_data);
+char has_new_errors(struct Translation_Data *translation_data);
-void destroy_translation_data(struct Translation_Data *data);
-void destroy_source(struct Source *src);
-void destroy_options(struct Options *options);
+void delete_translation_data(struct Translation_Data *data);
+void delete_source(struct Source *src);
+void delete_options(struct Options *options);
+void delete_error(struct Error *error);
#endif