2 \brief Intermediate Representation (IR) between Directory Structure and Engine Grammar
3 \details The IR serves as a storage structure that is populated during the
4 parsing of the input directory structure. After parsing is complete,
5 the IR will be condensed (removed of excess allocated space) and then
6 output as the Engine Grammar. In this file we describe the semantic actions
7 that are called at each step, and the memory buffers that they populate.
8 See parser.y for the description on how the input grammar is constructed,
9 and where/when semantic actions are called.
10 TODO: or just write it here.
11 \author Jordan Lavatai
13 ----------------------------------------------------------------------------*/
22 #define MAX_MODELS 256
24 #define MAX_CLASS_DEPTH 256
25 #define MAX_CLASSES 256
26 #define MAX_FRAMES 256
27 #define PTRS_IN_PAGE 1024
29 /* Called after the cdat open operator has been recognized in grammar. Allocates
30 the space for a cdat on the cdat_buf, pushes that pointer onto
35 /* Called after a cdat end operator has been recognized in grammar. Sets
36 top stack cdat ** to null and decrements stack pointer */
40 /* Called after an odat has been populated. Allocates memory for
44 insert_set_label(char*, uint64_t);
46 /* Populate the sets representation in CURR_CDAT with a ref_id and insert a link
47 into the link_buf that will resolve the ref_id to an actual odat after parse time. */
49 insert_set_olink(uint64_t);
51 /* Put the vlink in the link_buf to be processed after parsetime */
53 insert_set_vlink(uint64_t, char*);
55 /* Put svlink in the link_buf to be processed after parsetime */
57 insert_set_svlink(uint64_t);
59 /* Called for every set reduction except for sets with olinks. Populates the
60 set data structures in the CDAT and in the ODAT. Uses the name and ref_id
61 from insert_set_label. Also inserts a ref into the ref_buf with the CURR_ODAT
62 pointer so that we can also resolve the odat from its ref_id. */
66 /* Insertion of eles is practically equivalent to how sets are inserted because both
67 share the same data type (ODAT). Like sets, eles have links, labels
68 and odats. Eles have the added notion of a parent set, and so must be inserted
69 into said parent set, but this is the only place they truly differ from sets. */
72 insert_ele_label(char*, uint64_t);
74 /* Insert an ele olink into the CURR_ODAT */
76 insert_ele_olink(uint64_t);
78 /* Insert a ele vlink into CURR_ODAT*/
80 insert_ele_vlink(uint64_t, char*);
82 /* Inserts an ele short vlink into CURR_ODAT*/
84 insert_ele_svlink(uint64_t);
86 /* inserts ele into CURR_CLASS and CURR_ODAT */
93 /* Inserts the hitbox into the CURR_ODAT */
97 /* Inserts the root into the CURR_ODAT */
99 insert_root(int, int, int);
101 /* Inserts a quad into the CURR_ODAT */
103 insert_quad(int, int, int, uint64_t);
109 insert_framesheet(char, char*, uint64_t, int, int, int);
112 insert_frame_pointer(char, void*);