37 lines
652 B
C
37 lines
652 B
C
#ifndef PARSER_H
|
|
#define PARSER_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <setjmp.h>
|
|
#include "dictionary.h"
|
|
#include "opcodes.h"
|
|
#include "token.h"
|
|
#include "array.h"
|
|
#include "keywords.h"
|
|
|
|
typedef Array Instructions;
|
|
|
|
typedef struct parameter {
|
|
bool Pointer;
|
|
TokenType Type;
|
|
union {
|
|
char* Name;
|
|
Registers Register;
|
|
uint32_t Number;
|
|
} Value;
|
|
} Parameter;
|
|
|
|
typedef struct instruction {
|
|
bool IsOpcode;
|
|
union {
|
|
Mnemonics Opcode;
|
|
Keywords Directive;
|
|
} Inst;
|
|
int ParameterCount;
|
|
Parameter Parameters[2];
|
|
} Instruction;
|
|
|
|
Instructions* ParseTokens(Array* tokens);
|
|
|
|
#endif |