aboutsummaryrefslogtreecommitdiff
path: root/parser.h
blob: 2b01850a59fc21021eeb2737acb244ab0794906d (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
{
  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