This repository has been archived on 2025-11-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ovm/asm/parser.h
Aryadev Chavali 5d800d4366 Moved inst module to lib
As it has no dependencies on vm specifically, and it's more necessary
for any vendors who wish to target the virtual machine, it makes more
sense for inst to be a lib module rather than a vm module.
2023-10-31 21:14:14 +00:00

37 lines
772 B
C

/* Copyright (C) 2023 Aryadev Chavali
* You may distribute and modify this code under the terms of the
* GPLv2 license. You should have received a copy of the GPLv2
* license with this file. If not, please write to:
* aryadev@aryadevchavali.com.
* Created: 2023-10-24
* Author: Aryadev Chavali
* Description: Parser for assembly language
*/
#ifndef PARSER_H
#define PARSER_H
#include "./lexer.h"
#include <lib/inst.h>
typedef enum
{
PERR_OK = 0,
PERR_INTEGER_OVERFLOW,
PERR_NOT_A_NUMBER,
PERR_EXPECTED_TYPE,
PERR_EXPECTED_SYMBOL,
PERR_EXPECTED_OPERAND,
PERR_UNKNOWN_OPERATOR,
} perr_t;
const char *perr_as_cstr(perr_t);
perr_t parse_next_inst(token_stream_t *, inst_t *);
perr_t parse_stream(token_stream_t *, inst_t **, size_t *);
#endif