/* Asset Package Compiler */
+%code requires{
+ #include <stdint.h>
+}
%{
#include <stdio.h>
#include <string.h>
- #include <stdint.h>
#include <dirent.h>
#include <png.h>
#include <apc/ir.h>
%}
%define parse.error verbose
%define lr.type ielr
-%define api.value.type union
-//operators
+
+%union {
+ uint64_t ref;
+ int val;
+ char *str;
+ void *voidp;
+
+}
+
+ //operators
%token CLOPEN // /
%token CLCLOSE // \
%token SOPEN
%token FS
%token ELE
//nonterminal types
-%type <uint64_t> olink
-%type <uint64_t> ele_svlink
-%type <uint64_t> set_svlink
+%type <ref> olink
+%type <ref> ele_svlink
+%type <ref> set_svlink
//terminals
-%token <int> NUM
-%token <char*> STR
-%token <int> SS
-%token <char*> NAME
-%token <uint64_t> REF
-%token <int> SSD
-%token <void*> FPTR
-%token <int> WIDTH
-%token <int> HEIGHT
-%token <int> NUM_PTRS
+%token <val> NUM
+%token <str> STR
+%token <val> SS
+%token <str> NAME
+%token <ref> REF
+%token <val> SSD
+%token <voidp> FPTR
+%token <val> WIDTH
+%token <val> HEIGHT
+%token <val> NUM_PTRS
//precedence
%precedence LP
%precedence MP