aboutsummaryrefslogtreecommitdiff
path: root/parser.h
blob: e78f11606c6b1a0e9be15f7a2585c9f3271d24bf (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
33
34
35
#ifndef PARSER_H
#define PARSER_H

#include "./lib.h"

typedef enum
{
  NEXT = 0,
  PREV,
  INC,
  DEC,
  OUT,
  READ,
  LIN,
  LOUT
} node_type_t;

typedef struct
{
  size_t col, row;
  node_type_t type;
  int loop_ref;
} node_t;

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

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

#endif