mirror of
https://github.com/iritmaximus/ttk91-compiler.git
synced 2026-10-12 19:13:40 +03:00
added ast creation to parsing
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
typedef enum {
|
||||
INSTRUCTION,
|
||||
INSTRUCTION_ONE_ARG,
|
||||
LABEL_DEF,
|
||||
COMMENT
|
||||
} expr_t;
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@
|
||||
# define YY_YY_INCLUDE_TOKEN_H_INCLUDED
|
||||
/* Debug traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG 0
|
||||
# define YYDEBUG 1
|
||||
#endif
|
||||
#if YYDEBUG
|
||||
extern int yydebug;
|
||||
@@ -81,7 +81,7 @@ extern int yydebug;
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
union YYSTYPE
|
||||
{
|
||||
#line 39 "src/parser.bison"
|
||||
#line 40 "src/parser.bison"
|
||||
|
||||
struct expr *expr;
|
||||
struct oper *oper;
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
#ifndef REGISTER_H
|
||||
#define REGISTER_H
|
||||
|
||||
typedef enum {
|
||||
TTK_REGISTER,
|
||||
STACK_TTK_REGISTER
|
||||
} ttk_register_t;
|
||||
|
||||
struct ttk_register {
|
||||
ttk_register_t kind;
|
||||
int id;
|
||||
int value;
|
||||
};
|
||||
|
||||
struct ttk_register * ttk_register_create(char* id, int value);
|
||||
int parse_register_num(char *name);
|
||||
struct ttk_register * ttk_register_create(ttk_register_t kind, char* id, int value);
|
||||
int parse_register_num(char *name, ttk_register_t kind);
|
||||
|
||||
#endif
|
||||
|
||||
+2
-1
@@ -12,7 +12,8 @@ typedef enum {
|
||||
|
||||
typedef enum {
|
||||
NONE,
|
||||
INDEXED
|
||||
INDEXED,
|
||||
INDEXED_ONLY_IREG
|
||||
} index_t;
|
||||
|
||||
typedef enum {
|
||||
|
||||
Reference in New Issue
Block a user