aboutsummaryrefslogtreecommitdiff
path: root/parser.h
blob: 70ed4ffb90ba782c3bd92ec365b868f7566f194f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef PARSER_H
#define PARSER_H

#include "./lib.h"

typedef struct AST
{
  size_t col, row;
  enum
  {
    NEXT = 0,
    PREV,
    INC,
    DEC,
    OUT,
    READ,
    LIN,
    LOUT
  } type;
  int loop_ref;
} node_t;

struct PResult
{
  node_t *nodes;
  size_t size;
};

char *ast_to_str(node_t *ast, size_t size);
struct PResult parse_buffer(buffer_t *buffer);

#endif