Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compiler-construction
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
User expired
compiler-construction
Commits
7a954632
Commit
7a954632
authored
5 years ago
by
FlorianKrull
Browse files
Options
Downloads
Patches
Plain Diff
Moved header
parent
573d5287
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/mcc/tac_build.h
+71
-0
71 additions, 0 deletions
include/mcc/tac_build.h
with
71 additions
and
0 deletions
include/mcc/tac_build.h
0 → 100644
+
71
−
0
View file @
7a954632
#ifndef MCC_TAC_BUILD_H
#define MCC_TAC_BUILD_H
#include
"ast.h"
#include
<stdio.h>
enum
mcc_tac_operation
{
MCC_TAC_BOOL_LITERAL
,
MCC_TAC_INT_LITERAL
,
MCC_TAC_STRING_LITERAL
,
MCC_TAC_FLOAT_LITERAL
,
MCC_TAC_IDENTIFIER
,
MCC_TAC_UNARY_EXPRESSION
,
MCC_TAC_BINARY_EXPRESSION
,
MCC_TAC_NEGATE_INT
,
MCC_TAC_NEGATE_FLOAT
,
MCC_TAC_NOT_BOOL
,
MCC_TAC_PLUS_INT
,
MCC_TAC_PLUS_FLOAT
,
MCC_TAC_MINUS_INT
,
MCC_TAC_MINUS_FLOAT
,
MCC_TAC_MUL_INT
,
MCC_TAC_MUL_FLOAT
,
MCC_TAC_DIV_INT
,
MCC_TAC_DIV_FLOAT
,
MCC_TAC_EQ
,
MCC_TAC_NEQ
,
MCC_TAC_GT
,
MCC_TAC_LT
,
MCC_TAC_LTEQ
,
MCC_TAC_GTEQ
,
MCC_TAC_LT_FLOAT
,
MCC_TAC_LTEQ_FLOAT
,
MCC_TAC_GT_FLOAT
,
MCC_TAC_GTEQ_FLOAT
,
MCC_TAC_EQ_FLOAT
,
MCC_TAC_NEQ_FLOAT
,
MCC_TAC_AND
,
MCC_TAC_OR
,
MCC_TAC_VARIABLE_DECLARATION
,
MCC_TAC_VARIABLE_ASSIGNMENT
,
MCC_TAC_JMP
};
// use quadruples like this : https://github.com/fauzanzaid/Quadruple-Three-Address-Code-in-C ??
struct
mcc_tac
{
enum
mcc_tac_operation
tac_op
;
char
*
arg1
;
char
*
arg2
;
char
*
result
;
struct
mcc_tac
*
next
;
struct
mcc_tac
*
prev
;
};
struct
mcc_tac
*
mcc_create_tac
(
struct
mcc_ast_expression
*
expr
,
struct
mcc_tac
*
tac
);
struct
mcc_tac
*
mcc_new_tac
();
int
mcc_tac_add
(
struct
mcc_tac
*
tac_prev
,
struct
mcc_tac
*
tac_add
);
void
mcc_tac_delete
(
struct
mcc_tac
*
tac
);
#endif
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment