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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
|
include/node.hpp,96
#define AST_BASE_HPPAST_BASE_HPP2,21
class Node {Node7,64
virtual ~Node() {}~Node9,85
include/statement.hpp,786
#define AST_STATEMENT_HPPAST_STATEMENT_HPP2,26
class Statement : public Node {Statement7,74
Statement* next_statement;next_statement9,117
class CompoundStatement : public Statement {CompoundStatement26,524
Declaration* m_decl;m_decl28,580
Statement* m_statement;m_statement29,605
class SelectionStatement : public Statement {SelectionStatement45,1029
Statement* m_if;m_if47,1086
Statement* m_else;m_else48,1107
class ExpressionStatement : public Statement {ExpressionStatement62,1470
Expression* m_expr;m_expr64,1528
class JumpStatement : public Statement {JumpStatement78,1867
Expression* m_expr;m_expr80,1919
class IterationStatement : public Statement {IterationStatement94,2252
Statement* m_statement;m_statement96,2309
include/function.hpp,363
#define AST_FUNCTION_HPPAST_FUNCTION_HPP2,25
struct VarLocation {VarLocation7,72
Type* type;type8,93
int32_t stack_position;stack_position9,109
class Function : public Node {Function13,142
Type* type;type15,184
std::string id;id16,200
Declaration* parameter_list;parameter_list17,220
Statement* statement;statement18,253
include/expression.hpp,286
#define AST_EXPRESSION_HPPAST_EXPRESSION_HPP2,27
class Expression : public Node {Expression6,75
class Identifier : public Expression {Identifier16,267
std::string m_id;m_id18,315
class Constant : public Expression {Constant26,425
int32_t m_constant;m_constant28,471
include/translation_unit.hpp,163
#define EXTERNAL_HPPEXTERNAL_HPP2,21
class TranslationUnit : public Node {TranslationUnit7,64
std::vector<Node* > translation_unit;translation_unit9,113
include/type.hpp,447
#define TYPE_HPPTYPE_HPP2,17
class Type : public Node {Type7,56
class Specifier : public Type {Specifier17,244
class Pointer : public Type {Pointer23,334
Type* pointer_type;pointer_type25,375
class Array : public Type {Array34,493
int32_t size;size36,532
Type* array_type;array_type37,550
class Void : public Specifier {Void46,681
class Int : public Specifier {Int54,784
class Char : public Specifier {Char62,885
include/ast.hpp,108
#define AST_HPPAST_HPP2,16
typedef std::map<std::string, VarLocation> VariableStack;VariableStack12,145
include/declaration.hpp,297
#define AST_DECLARATION_HPPAST_DECLARATION_HPP2,28
class Declaration : public Node {Declaration8,127
Type* type;type10,170
std::string id;id11,186
Expression* init;init12,206
Declaration* next_decl;next_decl13,228
Declaration* list_next_decl;list_next_decl14,256
src/c_parser.tab.cpp,9030
#define YYBISON YYBISON44,2037
#define YYBISON_VERSION YYBISON_VERSION47,2078
#define YYSKELETON_NAME YYSKELETON_NAME50,2133
#define YYPURE YYPURE53,2188
#define YYPUSH YYPUSH56,2227
#define YYPULL YYPULL59,2266
# define YY_NULLPTR YY_NULLPTR70,2471
# define YY_NULLPTR YY_NULLPTR72,2509
# undef YYERROR_VERBOSEYYERROR_VERBOSE78,2614
# define YYERROR_VERBOSE YYERROR_VERBOSE79,2638
# define YYERROR_VERBOSE YYERROR_VERBOSE81,2671
# define YY_YY_C_COMPILER_SRC_C_PARSER_TAB_HPP_INCLUDEDYY_YY_C_COMPILER_SRC_C_PARSER_TAB_HPP_INCLUDED87,2863
# define YYDEBUG YYDEBUG90,2956
# define YYTOKENTYPEYYTOKENTYPE114,3494
enum yytokentypeyytokentype115,3515
T_IDENTIFIER = 258,T_IDENTIFIER117,3538
T_SC = 259,T_SC118,3562
T_CMA = 260,T_CMA119,3578
T_LRB = 261,T_LRB120,3595
T_LCB = 262,T_LCB121,3612
T_RCB = 263,T_RCB122,3629
T_LSB = 264,T_LSB123,3646
T_RSB = 265,T_RSB124,3663
T_QU = 266,T_QU125,3680
T_COL = 267,T_COL126,3696
T_LOG_OR = 268,T_LOG_OR127,3713
T_LOG_AND = 269,T_LOG_AND128,3733
T_OR = 270,T_OR129,3754
T_XOR = 271,T_XOR130,3770
T_AND = 272,T_AND131,3787
T_EQUALITY_OP = 273,T_EQUALITY_OP132,3804
T_REL_OP = 274,T_REL_OP133,3829
T_SHIFT_OP = 275,T_SHIFT_OP134,3849
T_MULT = 276,T_MULT135,3871
T_DIV = 277,T_DIV136,3889
T_REM = 278,T_REM137,3906
T_TILDE = 279,T_TILDE138,3923
T_NOT = 280,T_NOT139,3942
T_DOT = 281,T_DOT140,3959
T_ARROW = 282,T_ARROW141,3976
T_INCDEC = 283,T_INCDEC142,3995
T_ADDSUB_OP = 284,T_ADDSUB_OP143,4015
T_ASSIGN_OPER = 285,T_ASSIGN_OPER144,4038
T_EQ = 286,T_EQ145,4063
T_SIZEOF = 287,T_SIZEOF146,4079
T_INT_CONST = 288,T_INT_CONST147,4099
T_IF = 289,T_IF148,4122
T_WHILE = 290,T_WHILE149,4138
T_DO = 291,T_DO150,4157
T_FOR = 292,T_FOR151,4173
T_RETURN = 293,T_RETURN152,4190
T_VOID = 294,T_VOID153,4210
T_CHAR = 295,T_CHAR154,4228
T_SCHAR = 296,T_SCHAR155,4246
T_UCHAR = 297,T_UCHAR156,4265
T_SSINT = 298,T_SSINT157,4284
T_USINT = 299,T_USINT158,4303
T_LINT = 300,T_LINT159,4322
T_ULINT = 301,T_ULINT160,4340
T_UINT = 302,T_UINT161,4359
T_SINT = 303,T_SINT162,4377
T_RRB = 304,T_RRB163,4395
T_ELSE = 305T_ELSE164,4412
union YYSTYPEYYSTYPE171,4517
Node* node;node175,4589
TranslationUnit* trans_unit;trans_unit176,4605
Function* function;function177,4638
Statement* statement;statement178,4662
Declaration* declaration;declaration179,4688
Expression* expression;expression180,4718
Type* type;type181,4746
double number;number182,4762
std::string* string;string183,4781
typedef union YYSTYPE YYSTYPE;YYSTYPE188,4873
# define YYSTYPE_IS_TRIVIAL YYSTYPE_IS_TRIVIAL189,4904
# define YYSTYPE_IS_DECLARED YYSTYPE_IS_DECLARED190,4934
# undef shortshort205,5209
typedef YYTYPE_UINT8 yytype_uint8;yytype_uint8209,5251
typedef unsigned char yytype_uint8;yytype_uint8211,5292
typedef YYTYPE_INT8 yytype_int8;yytype_int8215,5355
typedef signed char yytype_int8;yytype_int8217,5394
typedef YYTYPE_UINT16 yytype_uint16;yytype_uint16221,5456
typedef unsigned short int yytype_uint16;yytype_uint16223,5499
typedef YYTYPE_INT16 yytype_int16;yytype_int16227,5569
typedef short int yytype_int16;yytype_int16229,5610
# define YYSIZE_T YYSIZE_T234,5689
# define YYSIZE_T YYSIZE_T236,5744
# define YYSIZE_T YYSIZE_T239,5853
# define YYSIZE_T YYSIZE_T241,5886
#define YYSIZE_MAXIMUM YYSIZE_MAXIMUM245,5934
# define YY_(YY_251,6104
# define YY_(YY_255,6190
# define YY_ATTRIBUTE(YY_ATTRIBUTE263,6447
# define YY_ATTRIBUTE(YY_ATTRIBUTE265,6503
# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE_PURE270,6586
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE_UNUSED274,6677
# define _Noreturn _Noreturn280,6874
# define _Noreturn _Noreturn282,6923
# define YYUSE(YYUSE288,7083
# define YYUSE(YYUSE290,7120
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN295,7295
# define YY_IGNORE_MAYBE_UNINITIALIZED_END YY_IGNORE_MAYBE_UNINITIALIZED_END299,7505
# define YY_INITIAL_VALUE(YY_INITIAL_VALUE302,7591
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGINYY_IGNORE_MAYBE_UNINITIALIZED_BEGIN305,7681
# define YY_IGNORE_MAYBE_UNINITIALIZED_ENDYY_IGNORE_MAYBE_UNINITIALIZED_END306,7726
# define YY_INITIAL_VALUE(YY_INITIAL_VALUE309,7801
# define YYSTACK_ALLOC YYSTACK_ALLOC320,8049
# define YYSTACK_ALLOC YYSTACK_ALLOC324,8212
# define alloca alloca327,8332
# define YYSTACK_ALLOC YYSTACK_ALLOC329,8368
# define EXIT_SUCCESS EXIT_SUCCESS334,8598
# define YYSTACK_FREE(YYSTACK_FREE343,8748
# define YYSTACK_ALLOC_MAXIMUM YYSTACK_ALLOC_MAXIMUM349,9138
# define YYSTACK_ALLOC YYSTACK_ALLOC352,9220
# define YYSTACK_FREE YYSTACK_FREE353,9253
# define YYSTACK_ALLOC_MAXIMUM YYSTACK_ALLOC_MAXIMUM355,9315
# define EXIT_SUCCESS EXIT_SUCCESS362,9612
# define YYMALLOC YYMALLOC366,9677
# define YYFREE YYFREE372,9850
union yyallocyyalloc386,10246
yytype_int16 yyss_alloc;yyss_alloc388,10262
YYSTYPE yyvs_alloc;yyvs_alloc389,10289
# define YYSTACK_GAP_MAXIMUM YYSTACK_GAP_MAXIMUM393,10390
# define YYSTACK_BYTES(YYSTACK_BYTES397,10538
# define YYCOPY_NEEDED YYCOPY_NEEDED401,10653
# define YYSTACK_RELOCATE(YYSTACK_RELOCATE408,10962
# define YYCOPY(YYCOPY426,11841
# define YYCOPY(YYCOPY429,11947
#define YYFINAL YYFINAL442,12416
#define YYLAST YYLAST444,12476
#define YYNTOKENS YYNTOKENS447,12539
#define YYNNTS YYNNTS449,12602
#define YYNRULES YYNRULES451,12657
#define YYNSTATES YYNSTATES453,12717
#define YYUNDEFTOK YYUNDEFTOK457,12857
#define YYMAXUTOK YYMAXUTOK458,12879
#define YYTRANSLATE(YYTRANSLATE460,12904
static const yytype_uint8 yytranslate[] =yytranslate465,13180
static const yytype_uint16 yyrline[] =yyrline502,15546
static const char *const yytname[] =yytname522,16610
static const yytype_uint16 yytoknum[] =yytoknum552,18299
#define YYPACT_NINF YYPACT_NINF563,18727
#define yypact_value_is_default(yypact_value_is_default565,18753
#define YYTABLE_NINF YYTABLE_NINF568,18825
#define yytable_value_is_error(yytable_value_is_error570,18850
static const yytype_int16 yypact[] =yypact575,18992
static const yytype_uint8 yydefact[] =yydefact602,20659
static const yytype_int16 yypgoto[] =yypgoto627,22171
static const yytype_int16 yydefgoto[] =yydefgoto637,22582
static const yytype_uint8 yytable[] =yytable649,23168
static const yytype_int16 yycheck[] =yycheck698,26482
static const yytype_uint8 yystos[] =yystos749,29897
static const yytype_uint8 yyr1[] =yyr1774,31447
static const yytype_uint8 yyr2[] =yyr2791,32404
#define yyerrok yyerrok808,33286
#define yyclearin yyclearin809,33328
#define YYEMPTY YYEMPTY810,33371
#define YYEOF YYEOF811,33400
#define YYACCEPT YYACCEPT813,33427
#define YYABORT YYABORT814,33468
#define YYERROR YYERROR815,33508
#define YYRECOVERING(YYRECOVERING818,33550
#define YYBACKUP(YYBACKUP820,33591
#define YYTERROR YYTERROR838,34606
#define YYERRCODE YYERRCODE839,34632
# define YYFPRINTF YYFPRINTF848,34789
# define YYDPRINTF(YYDPRINTF851,34826
# define YY_LOCATION_PRINT(YY_LOCATION_PRINT859,35122
# define YY_SYMBOL_PRINT(YY_SYMBOL_PRINT863,35180
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)yy_symbol_value_print880,35981
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)yy_symbol_print899,36380
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)yy_stack_print914,36944
# define YY_STACK_PRINT(YY_STACK_PRINT925,37194
yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)yy_reduce_print937,37641
# define YY_REDUCE_PRINT(YY_REDUCE_PRINT956,38249
int yydebug;yydebug964,38539
# define YYDPRINTF(YYDPRINTF966,38573
# define YY_SYMBOL_PRINT(YY_SYMBOL_PRINT967,38598
# define YY_STACK_PRINT(YY_STACK_PRINT968,38653
# define YY_REDUCE_PRINT(YY_REDUCE_PRINT969,38690
# define YYINITDEPTH YYINITDEPTH975,38824
# define YYMAXDEPTH YYMAXDEPTH986,39180
# define yystrlen yystrlen994,39299
yystrlen (const char *yystr)yystrlen998,39385
# define yystpcpy yystpcpy1010,39611
yystpcpy (char *yydest, const char *yysrc)yystpcpy1015,39749
yytnamerr (char *yyres, const char *yystr)yytnamerr1037,40397
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,yysyntax_error1085,41559
# define YYCASE_(YYCASE_1161,44945
# undef YYCASE_YYCASE_1171,45496
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)yydestruct1217,46620
int yychar;yychar1233,46928
YYSTYPE yylval;yylval1236,46992
int yynerrs;yynerrs1238,47047
yyparse (void)yyparse1246,47109
#define YYPOPSTACK(YYPOPSTACK1286,48119
TranslationUnit* g_root; // Definition of variable (to match declaration earlier)g_root2398,82507
TranslationUnit* parseAST() {parseAST2400,82590
src/function.cpp,249
Function::Function(const std::string& _id, Declaration* _parameter_list, Statement* _statement)Function6,45
void Function::print() constprint10,215
void Function::printxml() constprintxml21,403
void Function::printasm() constprintasm46,1054
src/c_lexer.yy.cpp,9407
#define YY_INT_ALIGNED YY_INT_ALIGNED5,82
#define FLEX_SCANNERFLEX_SCANNER9,160
#define YY_FLEX_MAJOR_VERSION YY_FLEX_MAJOR_VERSION10,181
#define YY_FLEX_MINOR_VERSION YY_FLEX_MINOR_VERSION11,213
#define YY_FLEX_SUBMINOR_VERSION YY_FLEX_SUBMINOR_VERSION12,245
#define FLEX_BETAFLEX_BETA14,313
#define FLEXINT_HFLEXINT_H30,611
#define __STDC_LIMIT_MACROS __STDC_LIMIT_MACROS40,922
typedef int8_t flex_int8_t;flex_int8_t44,982
typedef uint8_t flex_uint8_t;flex_uint8_t45,1010
typedef int16_t flex_int16_t;flex_int16_t46,1040
typedef uint16_t flex_uint16_t;flex_uint16_t47,1070
typedef int32_t flex_int32_t;flex_int32_t48,1102
typedef uint32_t flex_uint32_t;flex_uint32_t49,1132
typedef signed char flex_int8_t;flex_int8_t51,1170
typedef short int flex_int16_t;flex_int16_t52,1203
typedef int flex_int32_t;flex_int32_t53,1235
typedef unsigned char flex_uint8_t; flex_uint8_t54,1261
typedef unsigned short int flex_uint16_t;flex_uint16_t55,1298
typedef unsigned int flex_uint32_t;flex_uint32_t56,1340
#define INT8_MIN INT8_MIN60,1426
#define INT16_MIN INT16_MIN63,1489
#define INT32_MIN INT32_MIN66,1556
#define INT8_MAX INT8_MAX69,1627
#define INT16_MAX INT16_MAX72,1689
#define INT32_MAX INT32_MAX75,1753
#define UINT8_MAX UINT8_MAX78,1822
#define UINT16_MAX UINT16_MAX81,1886
#define UINT32_MAX UINT32_MAX84,1952
#define YY_USE_CONSTYY_USE_CONST94,2122
#define YY_USE_CONSTYY_USE_CONST101,2243
#define yyconst yyconst107,2345
#define yyconstyyconst109,2373
#define YY_NULL YY_NULL113,2430
#define YY_SC_TO_UI(YY_SC_TO_UI120,2677
#define BEGIN BEGIN126,2908
#define YY_START YY_START132,3107
#define YYSTATE YYSTATE133,3147
#define YY_STATE_EOF(YY_STATE_EOF136,3230
#define YY_NEW_FILE YY_NEW_FILE139,3350
#define YY_END_OF_BUFFER_CHAR YY_END_OF_BUFFER_CHAR141,3389
#define YY_BUF_SIZE YY_BUF_SIZE150,3655
#define YY_BUF_SIZE YY_BUF_SIZE152,3687
#define YY_STATE_BUF_SIZE YY_STATE_BUF_SIZE158,3837
#define YY_TYPEDEF_YY_BUFFER_STATEYY_TYPEDEF_YY_BUFFER_STATE161,3945
typedef struct yy_buffer_state *YY_BUFFER_STATE;YY_BUFFER_STATE162,3980
#define YY_TYPEDEF_YY_SIZE_TYY_TYPEDEF_YY_SIZE_T166,4066
typedef size_t yy_size_t;yy_size_t167,4095
#define EOB_ACT_CONTINUE_SCAN EOB_ACT_CONTINUE_SCAN174,4183
#define EOB_ACT_END_OF_FILE EOB_ACT_END_OF_FILE175,4215
#define EOB_ACT_LAST_MATCH EOB_ACT_LAST_MATCH176,4245
#define YY_LESS_LINENO(YY_LESS_LINENO178,4275
#define YY_LINENO_REWIND_TO(YY_LINENO_REWIND_TO179,4305
#define yyless(yyless182,4427
#define unput(unput195,4782
#define YY_STRUCT_YY_BUFFER_STATEYY_STRUCT_YY_BUFFER_STATE198,4862
struct yy_buffer_stateyy_buffer_state199,4896
FILE *yy_input_file;yy_input_file201,4922
char *yy_ch_buf; /* input buffer */yy_ch_buf203,4945
char *yy_buf_pos; /* current position in input buffer */yy_buf_pos204,4983
yy_size_t yy_buf_size;yy_buf_size209,5126
int yy_n_chars;yy_n_chars214,5236
int yy_is_our_buffer;yy_is_our_buffer220,5398
int yy_is_interactive;yy_is_interactive227,5636
int yy_at_bol;yy_at_bol233,5803
int yy_bs_lineno; /**< The line count. */yy_bs_lineno235,5820
int yy_bs_column; /**< The column count. */yy_bs_column236,5866
int yy_fill_buffer;yy_fill_buffer241,6001
int yy_buffer_status;yy_buffer_status243,6023
#define YY_BUFFER_NEW YY_BUFFER_NEW245,6047
#define YY_BUFFER_NORMAL YY_BUFFER_NORMAL246,6071
#define YY_BUFFER_EOF_PENDING YY_BUFFER_EOF_PENDING257,6569
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */yy_buffer_stack_top263,6677
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */yy_buffer_stack_max264,6747
static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */yy_buffer_stack265,6813
#define YY_CURRENT_BUFFER YY_CURRENT_BUFFER273,7081
#define YY_CURRENT_BUFFER_LVALUE YY_CURRENT_BUFFER_LVALUE280,7377
static char yy_hold_char;yy_hold_char283,7519
static int yy_n_chars; /* number of characters read into yy_ch_buf */yy_n_chars284,7545
yy_size_t yyleng;yyleng285,7616
static char *yy_c_buf_p = (char *) 0;yy_c_buf_p288,7680
static int yy_init = 0; /* whether we need to initialize */yy_init289,7718
static int yy_start = 0; /* start state number */yy_start290,7779
static int yy_did_buffer_switch_on_eof;yy_did_buffer_switch_on_eof295,7958
#define YY_FLUSH_BUFFER YY_FLUSH_BUFFER309,8478
#define yy_new_buffer yy_new_buffer319,8820
#define yy_set_interactive(yy_set_interactive321,8860
#define yy_set_bol(yy_set_bol331,9136
#define YY_AT_BOL(YY_AT_BOL341,9379
#define yywrap(yywrap345,9462
#define YY_SKIP_YYWRAPYY_SKIP_YYWRAP346,9496
typedef unsigned char YY_CHAR;YY_CHAR348,9520
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;yyin350,9552
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;yyout350,9552
typedef int yy_state_type;yy_state_type352,9599
int yylineno = 1;yylineno356,9649
#undef yytext_ptryytext_ptr360,9707
#define yytext_ptr yytext_ptr362,9732
#define YY_DO_BEFORE_ACTION YY_DO_BEFORE_ACTION375,10161
#define YY_NUM_RULES YY_NUM_RULES382,10324
#define YY_END_OF_BUFFER YY_END_OF_BUFFER383,10348
struct yy_trans_infoyy_trans_info386,10457
flex_int32_t yy_verify;yy_verify388,10481
flex_int32_t yy_nxt;yy_nxt389,10506
static yyconst flex_int16_t yy_accept[166] =yy_accept391,10532
static yyconst YY_CHAR yy_ec[256] =yy_ec413,11672
static yyconst YY_CHAR yy_meta[55] =yy_meta445,13389
static yyconst flex_uint16_t yy_base[168] =yy_base455,13799
static yyconst flex_int16_t yy_def[168] =yy_def477,14950
static yyconst flex_uint16_t yy_nxt[284] =yy_nxt499,16099
static yyconst flex_int16_t yy_chk[284] =yy_chk534,18006
static yy_state_type yy_last_accepting_state;yy_last_accepting_state569,19912
static char *yy_last_accepting_cpos;yy_last_accepting_cpos570,19958
int yy_flex_debug = 0;yy_flex_debug573,20022
#define REJECT REJECT578,20148
#define yymore(yymore579,20192
#define YY_MORE_ADJ YY_MORE_ADJ580,20238
#define YY_RESTORE_YY_MORE_OFFSETYY_RESTORE_YY_MORE_OFFSET581,20260
char *yytext;yytext582,20294
#define INITIAL INITIAL590,20457
#define YY_EXTRA_TYPE YY_EXTRA_TYPE601,20759
#define YY_READ_BUF_SIZE YY_READ_BUF_SIZE675,22080
#define YY_READ_BUF_SIZE YY_READ_BUF_SIZE677,22117
#define ECHO ECHO686,22357
#define YY_INPUT(YY_INPUT693,22567
#define yyterminate(yyterminate730,23481
#define YY_START_STACK_INCR YY_START_STACK_INCR735,23616
#define YY_FATAL_ERROR(YY_FATAL_ERROR740,23706
#define YY_DECL_IS_OURS YY_DECL_IS_OURS749,23939
#define YY_DECL YY_DECL753,23992
#define YY_USER_ACTIONYY_USER_ACTION760,24168
#define YY_BREAK YY_BREAK765,24261
#define YY_RULE_SETUP YY_RULE_SETUP768,24303
static int yy_get_next_buffer (void)yy_get_next_buffer1268,35271
static yy_state_type yy_get_previous_state (void)yy_get_previous_state1402,38843
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )yy_try_NUL_trans1434,39718
static void yyunput (int c, char * yy_bp )yyunput1459,40385
static int yyinput (void)yyinput1500,41414
void yyrestart (FILE * input_file )yyrestart1577,43181
void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )yy_switch_to_buffer1594,43542
static void yy_load_buffer_state (void)yy_load_buffer_state1625,44385
YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )yy_create_buffer1639,44858
void yy_delete_buffer (YY_BUFFER_STATE b )yy_delete_buffer1667,45560
static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )yy_init_buffer1686,46009
void yy_flush_buffer (YY_BUFFER_STATE b )yy_flush_buffer1714,46742
void yypush_buffer_state (YY_BUFFER_STATE new_buffer )yypush_buffer_state1743,47428
void yypop_buffer_state (void)yypop_buffer_state1773,48193
static void yyensure_buffer_stack (void)yyensure_buffer_stack1792,48588
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )yy_scan_buffer1841,50272
YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )yy_scan_string1878,51345
YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )yy_scan_bytes1891,51762
#define YY_EXIT_FAILURE YY_EXIT_FAILURE1922,52497
static void yy_fatal_error (yyconst char* msg )yy_fatal_error1925,52531
#undef yylessyyless1933,52708
#define yyless(yyless1934,52722
int yyget_lineno (void)yyget_lineno1953,53181
FILE *yyget_in (void)yyget_in1962,53275
FILE *yyget_out (void)yyget_out1970,53359
yy_size_t yyget_leng (void)yyget_leng1978,53459
char *yyget_text (void)yyget_text1987,53552
void yyset_lineno (int _line_number )yyset_lineno1996,53681
void yyset_in (FILE * _in_str )yyset_in2008,53909
void yyset_out (FILE * _out_str )yyset_out2013,53972
int yyget_debug (void)yyget_debug2018,54039
void yyset_debug (int _bdebug )yyset_debug2023,54098
static int yy_init_globals (void)yy_init_globals2028,54170
int yylex_destroy (void)yylex_destroy2057,54852
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )yy_flex_strncpy2083,55406
static int yy_flex_strlen (yyconst char * s )yy_flex_strlen2093,55561
void *yyalloc (yy_size_t size )yyalloc2103,55669
void *yyrealloc (void * ptr, yy_size_t size )yyrealloc2108,55742
void yyfree (void * ptr )yyfree2121,56201
#define YYTABLES_NAME YYTABLES_NAME2126,56297
void yyerror(char const *s) {yyerror2132,56373
src/expression.cpp,312
void Expression::print() constprint6,47
void Expression::printxml() constprintxml9,82
Identifier::Identifier(const std::string& id)Identifier15,147
void Identifier::printasm() constprintasm19,212
Constant::Constant(const int32_t& constant)Constant25,275
void Constant::printasm() constprintasm29,350
src/statement.cpp,2074
Statement::Statement(Statement* statement)Statement6,59
void Statement::addStatement(Statement* _next)addStatement10,138
CompoundStatement::CompoundStatement(Declaration* decl, Statement* statement)CompoundStatement18,253
CompoundStatement::CompoundStatement(Statement* statement)CompoundStatement22,391
void CompoundStatement::print() constprint26,483
void CompoundStatement::printxml() constprintxml35,629
void CompoundStatement::printasm() constprintasm51,945
void CompoundStatement::count_variables(int32_t& var_count) constcount_variables62,1154
void CompoundStatement::make_variables(VariableStack var_stack, int32_t& var_count) constmake_variables87,1715
SelectionStatement::SelectionStatement(Statement* _if, Statement* _else)SelectionStatement95,1851
void SelectionStatement::print() constprint98,1972
void SelectionStatement::printxml() constprintxml104,2056
void SelectionStatement::printasm() constprintasm114,2256
void SelectionStatement::count_variables(int32_t& var_count) constcount_variables117,2302
ExpressionStatement::ExpressionStatement(Expression* expr)ExpressionStatement132,2614
void ExpressionStatement::print() constprint136,2709
void ExpressionStatement::printxml() constprintxml139,2753
void ExpressionStatement::printasm() constprintasm142,2800
void ExpressionStatement::count_variables(int32_t& var_count) constcount_variables145,2847
JumpStatement::JumpStatement(Expression* expr)JumpStatement154,3030
void JumpStatement::print() constprint158,3100
void JumpStatement::printxml() constprintxml161,3138
void JumpStatement::printasm() constprintasm167,3243
void JumpStatement::count_variables(int32_t& var_count) constcount_variables172,3309
IterationStatement::IterationStatement(Statement* statement)IterationStatement181,3491
void IterationStatement::print() constprint185,3585
void IterationStatement::printxml() constprintxml188,3628
void IterationStatement::printasm() constprintasm196,3795
void IterationStatement::count_variables(int32_t& var_count) constcount_variables199,3841
src/c_parser.tab.hpp,2446
# define YY_YY_C_COMPILER_SRC_C_PARSER_TAB_HPP_INCLUDEDYY_YY_C_COMPILER_SRC_C_PARSER_TAB_HPP_INCLUDED34,1569
# define YYDEBUG YYDEBUG37,1662
# define YYTOKENTYPEYYTOKENTYPE61,2201
enum yytokentypeyytokentype62,2222
T_IDENTIFIER = 258,T_IDENTIFIER64,2245
T_SC = 259,T_SC65,2269
T_CMA = 260,T_CMA66,2285
T_LRB = 261,T_LRB67,2302
T_LCB = 262,T_LCB68,2319
T_RCB = 263,T_RCB69,2336
T_LSB = 264,T_LSB70,2353
T_RSB = 265,T_RSB71,2370
T_QU = 266,T_QU72,2387
T_COL = 267,T_COL73,2403
T_LOG_OR = 268,T_LOG_OR74,2420
T_LOG_AND = 269,T_LOG_AND75,2440
T_OR = 270,T_OR76,2461
T_XOR = 271,T_XOR77,2477
T_AND = 272,T_AND78,2494
T_EQUALITY_OP = 273,T_EQUALITY_OP79,2511
T_REL_OP = 274,T_REL_OP80,2536
T_SHIFT_OP = 275,T_SHIFT_OP81,2556
T_MULT = 276,T_MULT82,2578
T_DIV = 277,T_DIV83,2596
T_REM = 278,T_REM84,2613
T_TILDE = 279,T_TILDE85,2630
T_NOT = 280,T_NOT86,2649
T_DOT = 281,T_DOT87,2666
T_ARROW = 282,T_ARROW88,2683
T_INCDEC = 283,T_INCDEC89,2702
T_ADDSUB_OP = 284,T_ADDSUB_OP90,2722
T_ASSIGN_OPER = 285,T_ASSIGN_OPER91,2745
T_EQ = 286,T_EQ92,2770
T_SIZEOF = 287,T_SIZEOF93,2786
T_INT_CONST = 288,T_INT_CONST94,2806
T_IF = 289,T_IF95,2829
T_WHILE = 290,T_WHILE96,2845
T_DO = 291,T_DO97,2864
T_FOR = 292,T_FOR98,2880
T_RETURN = 293,T_RETURN99,2897
T_VOID = 294,T_VOID100,2917
T_CHAR = 295,T_CHAR101,2935
T_SCHAR = 296,T_SCHAR102,2953
T_UCHAR = 297,T_UCHAR103,2972
T_SSINT = 298,T_SSINT104,2991
T_USINT = 299,T_USINT105,3010
T_LINT = 300,T_LINT106,3029
T_ULINT = 301,T_ULINT107,3047
T_UINT = 302,T_UINT108,3066
T_SINT = 303,T_SINT109,3084
T_RRB = 304,T_RRB110,3102
T_ELSE = 305T_ELSE111,3119
union YYSTYPEYYSTYPE118,3224
Node* node;node122,3297
TranslationUnit* trans_unit;trans_unit123,3313
Function* function;function124,3346
Statement* statement;statement125,3370
Declaration* declaration;declaration126,3396
Expression* expression;expression127,3426
Type* type;type128,3454
double number;number129,3470
std::string* string;string130,3489
typedef union YYSTYPE YYSTYPE;YYSTYPE135,3582
# define YYSTYPE_IS_TRIVIAL YYSTYPE_IS_TRIVIAL136,3613
# define YYSTYPE_IS_DECLARED YYSTYPE_IS_DECLARED137,3643
src/compiler_main.cpp,43
int main(int argc, char *argv[])main5,41
src/declaration.cpp,654
Declaration::Declaration(const std::string& _id)Declaration6,48
void Declaration::print() constprint10,115
void Declaration::printxml() constprintxml19,255
void Declaration::printasm() constprintasm32,504
void Declaration::addDeclaration(Declaration* _next_decl)addDeclaration42,746
void Declaration::addList(Declaration* _next_decl)addList47,837
void Declaration::setType(Type* _type)setType52,926
Declaration* Declaration::getNext() constgetNext57,988
Declaration* Declaration::getNextListItem() constgetNextListItem62,1057
std::string Declaration::getId() constgetId67,1139
std::string Declaration::getType() constgetType72,1198
src/translation_unit.cpp,276
TranslationUnit::TranslationUnit(Node* decl)TranslationUnit6,53
void TranslationUnit::print() constprint11,119
void TranslationUnit::printxml() constprintxml18,223
void TranslationUnit::printasm() constprintasm27,445
void TranslationUnit::push(Node* decl)push34,555
src/type.cpp,626
void Type::print() constprint6,41
void Type::printxml() constprintxml11,119
void Type::printasm() constprintasm14,151
Pointer::Pointer(Type* _pointer_type) : pointer_type(_pointer_type)Pointer20,207
std::string Pointer::getType() constgetType23,279
Array::Array(Type* _array_type, int32_t _size) : size(_size), array_type(_array_type)Array31,392
std::string Array::getType() constgetType34,482
Void::Void()Void42,588
std::string Void::getType() constgetType45,605
Int::Int()Int53,682
std::string Int::getType() constgetType56,697
Char::Char()Char64,774
std::string Char::getType() constgetType67,791
src/c_parser.y,1943
ROOT:ROOT74,2156
TranslationUnit:TranslationUnit80,2226
ExternalDeclaration:ExternalDeclaration85,2367
FunctionDefinition:FunctionDefinition92,2492
ParameterList:ParameterList96,2628
Parameter:Parameter102,2787
DeclarationList:DeclarationList108,2881
Declaration:Declaration113,2998
DeclarationSpec:DeclarationSpec125,3233
InitDeclaratorList:InitDeclaratorList138,3543
InitDeclarator:InitDeclarator143,3695
Declarator:Declarator148,3831
DirectDeclarator:DirectDeclarator153,3920
IdentifierList:IdentifierList162,4241
StatementList:StatementList168,4380
Statement:Statement173,4487
CompoundStatement:CompoundStatement181,4678
CompoundStatement_2:CompoundStatement_2185,4743
SelectionStatement:SelectionStatement192,5008
ExpressionStatement:ExpressionStatement197,5209
JumpStatement:JumpStatement202,5332
IterationStatement:IterationStatement206,5413
Expression:Expression214,5664
AssignmentExpression:AssignmentExpression218,5717
ASSIGN_OPER:ASSIGN_OPER223,5846
ConditionalExpression:ConditionalExpression228,5899
LogicalOrExpression:LogicalOrExpression233,6042
LogicalAndExpression:LogicalAndExpression238,6170
InclusiveOrExpression:InclusiveOrExpression243,6303
ExclusiveOrExpression:ExclusiveOrExpression248,6433
AndExpression:AndExpression253,6548
EqualityExpression:EqualityExpression258,6657
RelationalExpression:RelationalExpression263,6795
ShiftExpression:ShiftExpression268,6921
AdditiveExpression:AdditiveExpression273,7039
MultiplicativeExpression:MultiplicativeExpression278,7176
MultDivRemOP:MultDivRemOP283,7306
CastExpression:CastExpression289,7391
UnaryExpression:UnaryExpression294,7502
UnaryOperator:UnaryOperator302,7750
PostfixExpression:PostfixExpression310,7888
PostfixExpression2:PostfixExpression2319,8212
ArgumentExpressionList:ArgumentExpressionList324,8329
PrimaryExpression:PrimaryExpression329,8460
Constant:Constant335,8599
test/out/03.s,16
main:main3,20
test/out/01.s,16
main:main3,20
test/out/04.s,28
main:main3,20
f:f14,153
test/out/05.s,0
test/out/02.s,16
main:main3,20
test/in/02.c,22
int main() {main1,0
test/in/05.c,44
char *glob;glob1,0
int main() {main3,13
test/in/01.c,22
int main() {main1,0
test/in/03.c,22
int main() {main1,0
test/in/04.c,51
int main() {main1,0
int f(int a, int v) {f7,55
test/ref/03.s,18
main:main15,207
test/ref/01.s,18
main:main15,207
test/ref/04.s,30
main:main15,207
f:f47,695
test/ref/05.s,36
$LC0:$LC012,145
main:main21,267
test/ref/02.s,18
main:main15,207
|