public
Description: a personal programming language written for school
Clone URL: git://github.com/brosner/dpl.git
Search Repo:
First part of the style conversion. Properly place one space between a 
comma and the next argument in function calls and definitions.
brosner (author)
Sun May 11 10:08:48 -0700 2008
commit  e457fe5db031c3100da3b1e40837eee87da3b069
tree    c4226e2a34db05f65a3fe5306673f0b43401d665
parent  051fcf0df6adc610c35f17ea464466871ce3a920
...
5
6
7
8
 
9
10
11
...
5
6
7
 
8
9
10
11
0
@@ -5,7 +5,7 @@
0
 YACC  = bison
0
 
0
 # define paths
0
-ROOT = /home/brian/dpl2
0
+ROOT = /Users/brian/Development/dpl
0
 BIN    = $(ROOT)/bin
0
 SRC    = $(ROOT)/src
0
 EXT    = $(SRC)/ext
...
19
20
21
22
 
23
24
25
26
27
28
29
...
27
28
29
30
 
31
32
33
34
 
35
36
37
 
38
39
 
40
41
42
43
44
 
45
46
47
48
49
50
51
52
53
54
55
56
57
58
...
58
59
60
61
62
 
 
63
64
65
66
67
 
68
69
70
71
72
 
73
74
 
75
76
77
78
79
80
81
 
 
82
83
84
85
86
 
87
88
89
90
 
91
92
 
93
94
95
96
 
 
97
98
99
100
101
 
102
103
104
105
106
107
 
108
109
110
111
112
 
 
113
114
115
...
119
120
121
122
123
 
 
124
125
126
127
128
...
131
132
133
134
 
135
136
137
138
139
140
141
142
 
 
143
144
145
146
147
 
 
148
149
150
...
153
154
155
156
 
157
158
159
160
161
162
163
164
165
166
...
161
162
163
164
 
165
166
167
168
169
170
171
 
 
172
173
174
175
176
 
177
178
179
180
 
181
182
183
184
185
 
 
186
187
188
189
190
191
 
192
193
194
195
196
197
 
198
199
200
 
201
202
203
204
...
205
206
207
208
209
 
 
210
211
212
213
 
214
...
19
20
21
 
22
23
24
25
26
27
28
29
...
27
28
29
 
30
31
32
33
 
34
35
36
 
37
38
 
39
40
41
42
43
 
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
...
58
59
60
 
 
61
62
63
64
65
66
 
67
68
69
70
71
 
72
73
 
74
75
76
77
78
79
 
 
80
81
82
83
84
85
 
86
87
88
89
 
90
91
 
92
93
94
 
 
95
96
97
98
99
100
 
101
102
103
104
105
106
 
107
108
109
110
 
 
111
112
113
114
115
...
119
120
121
 
 
122
123
124
125
126
127
128
...
131
132
133
 
134
135
136
137
138
139
140
 
 
141
142
143
144
145
 
 
146
147
148
149
150
...
153
154
155
 
156
157
158
159
160
161
162
163
164
165
166
...
161
162
163
 
164
165
166
167
168
169
 
 
170
171
172
173
174
175
 
176
177
178
179
 
180
181
182
183
 
 
184
185
186
187
188
189
190
 
191
192
193
194
195
196
 
197
198
199
 
200
201
202
203
204
...
205
206
207
 
 
208
209
210
211
212
 
213
214
0
@@ -19,7 +19,7 @@
0
 #include "arrays.h"
0
 #include "variables.h"
0
 
0
-void arrayInit(dplVal *type,dplVal *name) {
0
+void arrayInit(dplVal *type, dplVal *name) {
0
   dplVal array;
0
 
0
   /* set array specific data and pass thru type */
0
0
0
0
0
@@ -27,21 +27,21 @@
0
   array.isArray = TRUE;
0
 
0
 #ifdef DEBUG
0
- printf("init array (type = %d,name = %s)\n",type->type,name->value.str.val);
0
+ printf("init array (type = %d,name = %s)\n", type->type, name->value.str.val);
0
 #endif
0
 
0
   /* init the variable */
0
- variableInit(&array,name);
0
+ variableInit(&array, name);
0
 }
0
 
0
-void arrayCreate(dplVal *type,dplVal *name,dplVal *value) {
0
+void arrayCreate(dplVal *type, dplVal *name, dplVal *value) {
0
 #ifdef DEBUG
0
- printf("creating array (type = %d,name = %s)\n",type->type,name->value.str.val);
0
+ printf("creating array (type = %d,name = %s)\n", type->type, name->value.str.val);
0
 #endif
0
 
0
   /* validate the value being assigned MUST BE AN ARRAY */
0
   if(value->isArray != TRUE ) {
0
- dplError(DPL_WARNINGL,"value being assigned to array must be an array");
0
+ dplError(DPL_WARNINGL, "value being assigned to array must be an array");
0
     return;
0
   }
0
   else {
0
0
0
0
0
0
0
0
0
0
0
0
@@ -58,58 +58,58 @@
0
     /* assign in the values passed by the array */
0
     for(i.value.ival = 0; i.value.ival < elementCount; i.value.ival++) {
0
       /* fetch the element value from ht */
0
- if(dplHashIndexFind(value->value.array.elements,i.value.ival,(void **) &ivalue) == FAILURE) {
0
- dplError(DPL_CORE,"error extracting element %d from ht",i.value.ival);
0
+ if(dplHashIndexFind(value->value.array.elements, i.value.ival, (void **) &ivalue) == FAILURE) {
0
+ dplError(DPL_CORE,"error extracting element %d from ht", i.value.ival);
0
         break;
0
       }
0
 
0
       /* assign to right index */
0
- arrayAssign(name,&i,ivalue);
0
+ arrayAssign(name, &i, ivalue);
0
     }
0
   }
0
 }
0
 
0
-void arrayAssign(dplVal *name,dplVal *element,dplVal *value) {
0
+void arrayAssign(dplVal *name, dplVal *element, dplVal *value) {
0
 #ifdef DEBUG
0
- printf("assigning array (name = %s,element = %d)\n",name->value.str.val,element->value.ival);
0
+ printf("assigning array (name = %s,element = %d)\n", name->value.str.val, element->value.ival);
0
 #endif
0
 
0
   dplVal array;
0
 
0
   /* fetch the array */
0
- if(variableFetch(&array,name) == FAILURE) {
0
- dplError(DPL_WARNINGL,"array was not initialized.");
0
+ if(variableFetch(&array, name) == FAILURE) {
0
+ dplError(DPL_WARNINGL, "array was not initialized.");
0
     return;
0
   }
0
 
0
 #ifdef DEBUG
0
- printf("array check (init = %d,ce = %d)\n",array.value.array.elements->isInit,array.value.array.currentElement);
0
+ printf("array check (init = %d, ce = %d)\n", array.value.array.elements->isInit, array.value.array.currentElement);
0
 #endif
0
 
0
   /* check if element exists */
0
- if(arrayElementExists(&array,element) == TRUE) {
0
+ if(arrayElementExists(&array, element) == TRUE) {
0
 #ifdef DEBUG
0
- printf("element %d in array %s exists...updating\n",element->value.ival,name->value.str.val);
0
+ printf("element %d in array %s exists...updating\n", element->value.ival, name->value.str.val);
0
 #endif
0
     /* perform a hash update */
0
- if(dplHashUpdateIndexElement(array.value.array.elements,element->value.ival,value,sizeof(dplVal)) == FAILURE) {
0
- dplError(DPL_CORE,"failed updating index %d in %s",element->value.ival,name->value.str.val);
0
+ if(dplHashUpdateIndexElement(array.value.array.elements, element->value.ival, value, sizeof(dplVal)) == FAILURE) {
0
+ dplError(DPL_CORE, "failed updating index %d in %s", element->value.ival, name->value.str.val);
0
       return;
0
     }
0
     else {
0
 #ifdef DEBUG
0
- printf("updated array element %d successfully\n",element->value.ival);
0
+ printf("updated array element %d successfully\n", element->value.ival);
0
 #endif
0
     }
0
   }
0
   else {
0
 #ifdef DEBUG
0
- printf("element %d in array %s does not exist...adding\n",element->value.ival,name->value.str.val);
0
+ printf("element %d in array %s does not exist...adding\n", element->value.ival, name->value.str.val);
0
 #endif
0
     
0
     /* perform a hash add */
0
- if(dplHashAddIndexElement(array.value.array.elements,element->value.ival,value,sizeof(dplVal)) == FAILURE) {
0
- dplError(DPL_CORE,"failed adding index %d in %s",element->value.ival,name->value.str.val);
0
+ if(dplHashAddIndexElement(array.value.array.elements, element->value.ival, value, sizeof(dplVal)) == FAILURE) {
0
+ dplError(DPL_CORE,"failed adding index %d in %s", element->value.ival, name->value.str.val);
0
       return;
0
     }
0
     else {
0
@@ -119,8 +119,8 @@
0
     }
0
 
0
     /* commit the changes of the array back */
0
- if(dplHashUpdateElement(&_global(vst),name->value.str.val,name->value.str.len + 1,&array,sizeof(dplVal)) == FAILURE) {
0
- dplError(DPL_CORE,"failed udpating the array %s",name->value.str.val);
0
+ if(dplHashUpdateElement(&_global(vst), name->value.str.val, name->value.str.len + 1, &array, sizeof(dplVal)) == FAILURE) {
0
+ dplError(DPL_CORE, "failed udpating the array %s", name->value.str.val);
0
     }
0
     else {
0
 #ifdef DEBUG
0
0
0
@@ -131,20 +131,20 @@
0
 
0
 }
0
 
0
-void passArrayValue(dplVal *result,dplVal *value,int init) {
0
+void passArrayValue(dplVal *result, dplVal *value, int init) {
0
   static int elementCount = 0;
0
 
0
   if(init == 1) {
0
     result->isArray = TRUE;
0
     result->value.array.elements = (HashTable *) malloc(sizeof(HashTable));
0
 
0
- if(dplHashInit(result->value.array.elements,20,NULL) == FAILURE) {
0
- dplError(DPL_CORE,"array pass hash tbl failed init");
0
+ if(dplHashInit(result->value.array.elements, 20, NULL) == FAILURE) {
0
+ dplError(DPL_CORE, "array pass hash tbl failed init");
0
     }
0
   }
0
 
0
- if(dplHashAddIndexElement(result->value.array.elements,elementCount,value,sizeof(dplVal)) == FAILURE) {
0
- dplError(DPL_CORE,"failed adding elements");
0
+ if(dplHashAddIndexElement(result->value.array.elements, elementCount, value, sizeof(dplVal)) == FAILURE) {
0
+ dplError(DPL_CORE, "failed adding elements");
0
   }
0
 
0
   elementCount++;
0
@@ -153,7 +153,7 @@
0
 int arrayElementExists(dplVal *array,dplVal *element) {
0
   dplVal *tmp;
0
 
0
- if(dplHashIndexFind(array->value.array.elements,element->value.ival,(void **) &tmp) == FAILURE) {
0
+ if(dplHashIndexFind(array->value.array.elements, element->value.ival, (void **) &tmp) == FAILURE) {
0
     return FALSE;
0
   }
0
   else {
0
0
0
0
0
0
0
0
@@ -161,43 +161,43 @@
0
   }
0
 }
0
 
0
-void arrayElementFetch(dplVal *result,dplVal *_array,dplVal *element) {
0
+void arrayElementFetch(dplVal *result, dplVal *_array, dplVal *element) {
0
   dplVal array, *elementData;
0
 
0
 
0
   /* check to see if we need to fetch the array */
0
   if(_array->isArray != TRUE) {
0
- if(variableFetch(&array,_array) == FAILURE) {
0
- dplError(DPL_CORE,"failed fetching array %s in arrayElementFetch",_array->value.str.val);
0
+ if(variableFetch(&array, _array) == FAILURE) {
0
+ dplError(DPL_CORE, "failed fetching array %s in arrayElementFetch", _array->value.str.val);
0
       return;
0
     }
0
   }
0
   else {
0
- arrayValueCopy(&array,_array);
0
+ arrayValueCopy(&array, _array);
0
   }
0
 
0
 #ifdef DEBUG
0
- printf("arrayElementFetch array check (init = %d,ce = %d,elements = %d)\n",array.value.array.elements->isInit,array.value.array.currentElement,array.value.array.elements->numElements);
0
+ printf("arrayElementFetch array check (init = %d, ce = %d, elements = %d)\n", array.value.array.elements->isInit, array.value.array.currentElement, array.value.array.elements->numElements);
0
 #endif
0
 
0
   /* fetch the element data */
0
- if(dplHashIndexFind(array.value.array.elements,element->value.ival,(void **) &elementData) == FAILURE) {
0
- dplError(DPL_WARNINGL,"cannot fetch element %d of array %s",element->value.ival,_array->value.str.val);
0
+ if(dplHashIndexFind(array.value.array.elements, element->value.ival, (void **) &elementData) == FAILURE) {
0
+ dplError(DPL_WARNINGL, "cannot fetch element %d of array %s", element->value.ival, _array->value.str.val);
0
     result->isNull = TRUE;
0
     return;
0
   }
0
   else {
0
 #ifdef DEBUG
0
- printf("fetched element %d from array %s successfully\n",element->value.ival,_array->value.str.val);
0
+ printf("fetched element %d from array %s successfully\n", element->value.ival, _array->value.str.val);
0
 #endif
0
   }
0
   
0
   /* result */
0
   if(elementData->isArray == TRUE) {
0
- arrayValueCopy(result,elementData);
0
+ arrayValueCopy(result, elementData);
0
   }
0
   else {
0
- valueCopy(result,elementData);
0
+ valueCopy(result, elementData);
0
   }
0
 }
0
 
0
0
@@ -205,11 +205,11 @@
0
   dplVal array;
0
 
0
   /* fetch array */
0
- if(variableFetch(&array,arrayName) == FAILURE) {
0
- dplError(DPL_CORE,"failed fetching array");
0
+ if(variableFetch(&array, arrayName) == FAILURE) {
0
+ dplError(DPL_CORE, "failed fetching array");
0
   }
0
 
0
   /* preform dump - make sure a stderr redirect is ineffect to make easier reading */
0
- dplHashIndexDump(array.value.array.elements,FALSE);
0
+ dplHashIndexDump(array.value.array.elements, FALSE);
0
 }
...
15
16
17
18
19
20
 
 
 
21
22
 
23
24
25
 
 
26
27
28
...
15
16
17
 
 
 
18
19
20
21
 
22
23
 
 
24
25
26
27
28
0
@@ -15,14 +15,14 @@
0
 #ifndef _DPL_ARRAYS_H
0
 #define _DPL_ARRAYS_H
0
 
0
-extern void arrayInit(dplVal *type,dplVal *name);
0
-extern void arrayCreate(dplVal *type,dplVal *name,dplVal *value);
0
-extern void arrayAssign(dplVal *name,dplVal *element,dplVal *value);
0
+extern void arrayInit(dplVal *type, dplVal *name);
0
+extern void arrayCreate(dplVal *type, dplVal *name, dplVal *value);
0
+extern void arrayAssign(dplVal *name, dplVal *element, dplVal *value);
0
 
0
-extern void passArrayValue(dplVal *result,dplVal *value,int init);
0
+extern void passArrayValue(dplVal *result, dplVal *value, int init);
0
 
0
-extern int arrayElementExists(dplVal *array,dplVal *element);
0
-extern void arrayElementFetch(dplVal *result,dplVal *_array,dplVal *element);
0
+extern int arrayElementExists(dplVal *array, dplVal *element);
0
+extern void arrayElementFetch(dplVal *result, dplVal *_array, dplVal *element);
0
 
0
 extern void arrayElementDump(dplVal *arrayName);
0
 
...
21
22
23
24
 
25
26
27
...
42
43
44
45
 
46
47
48
...
21
22
23
 
24
25
26
27
...
42
43
44
 
45
46
47
48
0
@@ -21,7 +21,7 @@
0
 
0
 void csIfStart(dplVal *expr) {
0
   /* push current state on to css stack */
0
- stackPush(&_global(css),&_global(execute),sizeof(int));
0
+ stackPush(&_global(css), &_global(execute), sizeof(int));
0
 
0
   /* should this if execute? */
0
   if(_global(execute)) {
0
@@ -42,7 +42,7 @@
0
   int *execFlag;
0
 
0
   /* restore last state and jump back */
0
- stackPop(&_global(css),(void **) &execFlag);
0
+ stackPop(&_global(css), (void **) &execFlag);
0
   _global(execute) = *execFlag;
0
 }
0
 
...
42
43
44
45
 
46
47
48
...
42
43
44
 
45
46
47
48
0
@@ -42,7 +42,7 @@
0
 extern int dplSourceLineNo;
0
 
0
 extern void dplLoadModule(dplVal *);
0
-extern void dplError(int,const char *,...);
0
+extern void dplError(int, const char *, ...);
0
 
0
 typedef union _dplValue {
0
   
...
18
19
20
21
 
22
23
 
24
25
26
...
49
50
51
52
 
53
54
55
...
60
61
62
63
64
 
 
65
66
67
...
18
19
20
 
21
22
 
23
24
25
26
...
49
50
51
 
52
53
54
55
...
60
61
62
 
 
63
64
65
66
67
0
@@ -18,9 +18,9 @@
0
 char *empty_string = "";
0
 char *undefined_string = "\0";
0
 
0
-void valueCopy(dplVal *to,dplVal *from) {
0
+void valueCopy(dplVal *to, dplVal *from) {
0
   if(from->isArray == TRUE) {
0
- arrayValueCopy(to,from);
0
+ arrayValueCopy(to, from);
0
   }
0
   else {
0
     to->type = from->type;
0
@@ -49,7 +49,7 @@
0
   }
0
 }
0
 
0
-void arrayValueCopy(dplVal *to,dplVal *from) {
0
+void arrayValueCopy(dplVal *to, dplVal *from) {
0
 #ifdef DEBUG
0
   if(from == NULL) {
0
     printf("from is null\n");
0
@@ -60,8 +60,8 @@
0
   to->type = from->type;
0
   to->isArray = TRUE;
0
 
0
- if(dplHashCopy(&(to->value.array.elements),from->value.array.elements,DPLVAL_COPY,&tmp,sizeof(dplVal)) == FAILURE) {
0
- dplError(DPL_CORE,"hash copied failed");
0
+ if(dplHashCopy(&(to->value.array.elements), from->value.array.elements, DPLVAL_COPY, &tmp, sizeof(dplVal)) == FAILURE) {
0
+ dplError(DPL_CORE, "hash copied failed");
0
   }
0
 }
0
 
...
31
32
33
34
35
 
 
36
37
 
38
39
40
...
31
32
33
 
 
34
35
36
 
37
38
39
40
0
@@ -31,10 +31,10 @@
0
 #define DPLVAL_DESTROY  (void (*)(void *)) dplValDestroy
0
 #define DPLVAL_COPY    (void (*)(void *)) dplValCopy
0
 
0
-extern void valueCopy(dplVal *to,dplVal *from);
0
-extern void arrayValueCopy(dplVal *to,dplVal *from);
0
+extern void valueCopy(dplVal *to, dplVal *from);
0
+extern void arrayValueCopy(dplVal *to, dplVal *from);
0
 extern void valuePrint(dplVal *value);
0
-extern void arrayValuePrint(dplVal *array,dplVal *element);
0
+extern void arrayValuePrint(dplVal *array, dplVal *element);
0
 extern void typePrint(dplVal *value);
0
 
0
 extern void dplValDestroy(dplVal *);
...
1
 
2
3
4
 
5
 
 
 
6
7
8
9
10
...
15
16
17
18
19
 
 
20
21
22
23
24
 
 
 
 
 
 
 
 
 
25
 
 
 
26
27
28
...
55
56
57
 
58
59
60
...
83
84
85
86
 
87
88
89
...
 
1
2
 
 
3
4
5
6
7
8
9
10
11
12
...
17
18
19
 
 
20
21
22
 
 
 
 
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
...
65
66
67
68
69
70
71
...
94
95
96
 
97
98
99
100
0
@@ -1,8 +1,10 @@
0
-/* A Bison parser, made by GNU Bison 1.875b. */
0
+/* A Bison parser, made by GNU Bison 2.3. */
0
 
0
-/* Skeleton parser for Yacc-like parsing with Bison,
0
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
0
+/* Skeleton interface for Bison's Yacc-like parsers in C
0
 
0
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
0
+ Free Software Foundation, Inc.
0
+
0
    This program is free software; you can redistribute it and/or modify
0
    it under the terms of the GNU General Public License as published by
0
    the Free Software Foundation; either version 2, or (at your option)
0
0
0
@@ -15,14 +17,22 @@
0
 
0
    You should have received a copy of the GNU General Public License
0
    along with this program; if not, write to the Free Software
0
- Foundation, Inc., 59 Temple Place - Suite 330,
0
- Boston, MA 02111-1307, USA. */
0
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
0
+ Boston, MA 02110-1301, USA. */
0
 
0
-/* As a special exception, when this file is copied by Bison into a
0
- Bison output file, you may use that output file without restriction.
0
- This special exception was added by the Free Software Foundation
0
- in version 1.24 of Bison. */
0
+/* As a special exception, you may create a larger work that contains
0
+ part or all of the Bison parser skeleton and distribute that work
0
+ under terms of your choice, so long as that work isn't itself a
0
+ parser generator using the skeleton or a modified version thereof
0
+ as a parser skeleton. Alternatively, if you modify or redistribute
0
+ the parser skeleton itself, you may (at your option) remove this
0
+ special exception, which will cause the skeleton and the resulting
0
+ Bison output files to be licensed under the GNU General Public
0
+ License without this special exception.
0
 
0
+ This special exception was added by the Free Software Foundation in
0
+ version 2.2 of Bison. */
0
+
0
 /* Tokens. */
0
 #ifndef YYTOKENTYPE
0
 # define YYTOKENTYPE
0
@@ -55,6 +65,7 @@
0
      CLOSE = 281
0
    };
0
 #endif
0
+/* Tokens. */
0
 #define PRINT 258
0
 #define POW 259
0
 #define IS_NOT_EQUAL 260
0
@@ -83,7 +94,7 @@
0
 
0
 
0
 
0
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
0
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
0
 typedef int YYSTYPE;
0
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
0
 # define YYSTYPE_IS_DECLARED 1
...
35
36
37
38
 
39
40
41
42
43
...
115
116
117
118
119
 
 
120
121
122
123
124
 
 
125
126
127
128
129
 
 
130
131
132
133
134
135
136
...
139
140
141
142
 
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
166
167
168
169
170
 
 
 
171
172
173
174
175
 
 
176
177
178
179
 
180
181
182
...
185
186
187
188
189
 
 
190
191
192
...
195
196
197
198
199
 
 
200
201
202
...
35
36
37
 
38
39
40
41
42
43
...
115
116
117
 
 
118
119
120
121
122
 
 
123
124
125
126
127
 
 
128
129
130
131
132
133
134
135
136
...
139
140
141
 
142
143
144
145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
 
 
 
168
169
170
171
172
173
 
 
174
175
176
177
178
 
179
180
181
182
...
185
186
187
 
 
188
189
190
191
192
...
195
196
197
 
 
198
199
200
201
202
0
@@ -35,7 +35,7 @@
0
 %{
0
 
0
   void yyerror(const char *str) {
0
- dplError(DPL_SYNTAX,"%s",yytext);
0
+ dplError(DPL_SYNTAX, "%s", yytext);
0
   }
0
   
0
   int yywrap() {
0
0
0
@@ -115,18 +115,18 @@
0
 ;
0
 
0
 type_declaration:
0
- TYPE LABEL { if(_global(execute)) variableInit(&$1,&$2); }
0
- | TYPE LABEL '[' ']' { if(_global(execute)) arrayInit(&$1,&$2); }
0
+ TYPE LABEL { if(_global(execute)) variableInit(&$1, &$2); }
0
+ | TYPE LABEL '[' ']' { if(_global(execute)) arrayInit(&$1, &$2); }
0
 ;
0
 
0
 type_value_declaration:
0
- TYPE LABEL '=' expr { if(_global(execute)) variableCreate(&$1,&$2,&$4); }
0
- | TYPE LABEL '[' ']' '=' expr { if(_global(execute)) arrayCreate(&$1,&$2,&$6); }
0
+ TYPE LABEL '=' expr { if(_global(execute)) variableCreate(&$1, &$2, &$4); }
0
+ | TYPE LABEL '[' ']' '=' expr { if(_global(execute)) arrayCreate(&$1, &$2, &$6); }
0
 ;
0
 
0
 value_declaration:
0
- LABEL '=' expr { if(_global(execute)) variableAssign(&$1,&$3); }
0
- | LABEL '[' expr ']' '=' expr { if(_global(execute)) arrayAssign(&$1,&$3,&$6); }
0
+ LABEL '=' expr { if(_global(execute)) variableAssign(&$1, &$3); }
0
+ | LABEL '[' expr ']' '=' expr { if(_global(execute)) arrayAssign(&$1, &$3, &$6); }
0
 ;
0
 
0
 construct:
0
0
0
0
0
@@ -139,44 +139,44 @@
0
 
0
 use_module:
0
     USE_INTERNAL MODULE    { dplLoadModule(&$2); }
0
- | USE_EXTERNAL MODULE { /*printf("using external module: %s\n",$2.value.str.val);*/ }
0
+ | USE_EXTERNAL MODULE { /*printf("using external module: %s\n", $2.value.str.val);*/ }
0
 ;
0
 
0
 expr:
0
- INT { if(_global(execute)) valueCopy(&$$,&$1); }
0
- | DOUBLE { if(_global(execute)) valueCopy(&$$,&$1); }
0
- | BOOLEAN { if(_global(execute)) valueCopy(&$$,&$1); }
0
- | '"' STRING '"' { if(_global(execute)) valueCopy(&$$,&$2); }
0
- | variable { if(_global(execute)) valueCopy(&$$,&$1); }
0
- | file_exprs { if(_global(execute)) valueCopy(&$$,&$1); }
0
- | function_call { if(_global(execute)) valueCopy(&$$,&$1); }
0
- | expr '+' expr { if(_global(execute)) opAdd(&$$,&$1,&$3); }
0
- | expr '-' expr { if(_global(execute)) opSub(&$$,&$1,&$3); }
0
- | expr '*' expr { if(_global(execute)) opMul(&$$,&$1,&$3); }
0
- | expr '/' expr { if(_global(execute)) opDiv(&$$,&$1,&$3); }
0
- | expr POW expr { if(_global(execute)) opPow(&$$,&$1,&$3); }
0
- | expr '.' expr { if(_global(execute)) opConcat(&$$,&$1,&$3); }
0
- | '(' expr ')' { if(_global(execute)) valueCopy(&$$,&$2); }
0
- | expr IS_EQUAL expr { if(_global(execute)) isEqualFunc(&$$,&$1,&$3); }
0
- | expr IS_NOT_EQUAL expr { if(_global(execute)) isNotEqualFunc(&$$,&$1,&$3); }
0
- | expr '>' expr { if(_global(execute)) isGreaterThanFunc(&$$,&$1,&$3); }
0
- | expr '<' expr { if(_global(execute)) isLessThanFunc(&$$,&$1,&$3); }
0
- | '[' array_values ']' { if(_global(execute)) arrayValueCopy(&$$,&$2); }
0
+ INT { if(_global(execute)) valueCopy(&$$, &$1); }
0
+ | DOUBLE { if(_global(execute)) valueCopy(&$$, &$1); }
0
+ | BOOLEAN { if(_global(execute)) valueCopy(&$$, &$1); }
0
+ | '"' STRING '"' { if(_global(execute)) valueCopy(&$$, &$2); }
0
+ | variable { if(_global(execute)) valueCopy(&$$, &$1); }
0
+ | file_exprs { if(_global(execute)) valueCopy(&$$, &$1); }
0
+ | function_call { if(_global(execute)) valueCopy(&$$, &$1); }
0
+ | expr '+' expr { if(_global(execute)) opAdd(&$$, &$1, &$3); }
0
+ | expr '-' expr { if(_global(execute)) opSub(&$$, &$1, &$3); }
0
+ | expr '*' expr { if(_global(execute)) opMul(&$$, &$1, &$3); }
0
+ | expr '/' expr { if(_global(execute)) opDiv(&$$, &$1, &$3); }
0
+ | expr POW expr { if(_global(execute)) opPow(&$$, &$1, &$3); }
0
+ | expr '.' expr { if(_global(execute)) opConcat(&$$, &$1, &$3); }
0
+ | '(' expr ')' { if(_global(execute)) valueCopy(&$$, &$2); }
0
+ | expr IS_EQUAL expr { if(_global(execute)) isEqualFunc(&$$, &$1, &$3); }
0
+ | expr IS_NOT_EQUAL expr { if(_global(execute)) isNotEqualFunc(&$$, &$1, &$3); }
0
+ | expr '>' expr { if(_global(execute)) isGreaterThanFunc(&$$, &$1, &$3); }
0
+ | expr '<' expr { if(_global(execute)) isLessThanFunc(&$$, &$1, &$3); }
0
+ | '[' array_values ']' { if(_global(execute)) arrayValueCopy(&$$, &$2); }
0
 ;
0
 
0
 variable:
0
- LABEL { if(_global(execute)) variableFetch(&$$,&$1); }
0
- | LABEL '[' INT ']' { if(_global(execute)) arrayElementFetch(&$$,&$1,&$3); }
0
- | FILE_CONTENTS { if(_global(execute)) variableFetch(&$$,&$1); }
0
+ LABEL { if(_global(execute)) variableFetch(&$$, &$1); }
0
+ | LABEL '[' INT ']' { if(_global(execute)) arrayElementFetch(&$$, &$1, &$3); }
0
+ | FILE_CONTENTS { if(_global(execute)) variableFetch(&$$, &$1); }
0
 ;
0
 
0
 file_exprs:
0
- '@' _FILE_PATH { if(_global(execute)) valueCopy(&$$,&$2); fileOpen(&$$,&$2); }
0
- | '@' variable { if(_global(execute)) $$.value.file.print_context = TRUE; valueCopy(&$$,&$2); fileRead(&$$); }
0
+ '@' _FILE_PATH { if(_global(execute)) valueCopy(&$$, &$2); fileOpen(&$$, &$2); }
0
+ | '@' variable { if(_global(execute)) $$.value.file.print_context = TRUE; valueCopy(&$$, &$2); fileRead(&$$); }
0
 ;
0
 
0
 function_call:
0
- LABEL '(' function_call_args ')' { if(_global(execute)) callInternalFunction(&$$,&$1,&$3); }
0
+ LABEL '(' function_call_args ')' { if(_global(execute)) callInternalFunction(&$$, &$1, &$3); }
0
 ;
0
 
0
 function_call_args:
0
@@ -185,8 +185,8 @@
0
 ;
0
 
0
 non_empty_function_call_args:
0
- expr { passArgument(&$$,&$1,1); }
0
- | function_call_args ',' expr { passArgument(&$$,&$3,0); }
0
+ expr { passArgument(&$$, &$1, 1); }
0
+ | function_call_args ',' expr { passArgument(&$$, &$3, 0); }
0
 ;
0
 
0
 array_values:
0
@@ -195,8 +195,8 @@
0
 ;
0
 
0
 non_empty_array_values:
0
- expr { passArrayValue(&$$,&$1,1); }
0
- | array_values ',' expr { passArrayValue(&$$,&$3,0); }
0
+ expr { passArrayValue(&$$, &$1, 1); }
0
+ | array_values ',' expr { passArrayValue(&$$, &$3, 0); }
0
 ;
0
 
0
 %%
...
121
122
123
124
 
125
126
127
128
129
130
 
131
132
133
134
135
136
137
 
138
139
140
...
206
207
208
209
 
210
211
...
121
122
123
 
124
125
126
127
128
129
 
130
131
132
133
134
135
136
 
137
138
139
140
...
206
207
208
 
209
210
211
0
@@ -121,20 +121,20 @@
0
 
0
 {ival} {
0
   yylval.type = IS_INT;
0
- yylval.value.ival = strtol(yytext,NULL,0);
0
+ yylval.value.ival = strtol(yytext, NULL, 0);
0
   return INT;
0
 }
0
 
0
 {dval} {
0
   yylval.type = IS_DOUBLE;
0
- yylval.value.dval = strtod(yytext,NULL);
0
+ yylval.value.dval = strtod(yytext, NULL);
0
   return DOUBLE;
0
 }
0
 
0
 "use"{ts}("<"|"\""){ts} {
0
   BEGIN(USING);
0
   
0
- if(strpbrk(yytext,"<") != NULL) return USE_INTERNAL;
0
+ if(strpbrk(yytext, "<") != NULL) return USE_INTERNAL;
0
   else return USE_EXTERNAL;
0
 }
0
 
0
@@ -206,7 +206,7 @@
0
 
0
 (\n)|(\r\n)  { dplSourceLineNo++; }
0
 [ \t]+    ;
0
-. { dplError(DPL_SYNTAX,"unknown character '%c'",yytext[0]); }
0
+. { dplError(DPL_SYNTAX, "unknown character '%c'", yytext[0]); }
0
 
0
 %%
...
19
20
21
22
 
23
24
 
25
26
27
 
28
29
30
...
35
36
37
38
 
39
40
41
42
...
44
45
46
47
 
48
49
50
51
52
 
53
...
19
20
21
 
22
23
 
24
25
26
 
27
28
29
30
...
35
36
37
 
38
39
40
41
42
...
44
45
46
 
47
48
49
50
51
 
52
53
0
@@ -19,12 +19,12 @@
0
 #include "dpl.h"
0
 #include "file.h"
0
 
0
-void fileOpen(dplVal *result,dplVal *path) {
0
+void fileOpen(dplV