Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
编译原理课程设计
compiler
Commits
4b972d34
Commit
4b972d34
authored
2 years ago
by
aidan_wx
Browse files
Options
Download
Patches
Plain Diff
op=1/2/13/14时 && A_table=6时;有关if九元式的获取数据(从参数表中)
parent
5c76d1af
main
divide
No related merge requests found
Pipeline
#7918
passed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.cpp
+2
-2
src/main.cpp
src/tmp.h
+5
-5
src/tmp.h
with
7 additions
and
7 deletions
+7
-7
src/main.cpp
+
2
−
2
View file @
4b972d34
...
...
@@ -228,10 +228,10 @@ int main(int argc, const char *argv[]) {
// print(1);
//cout << *ast << endl;
/*
targetCodeGenerator
.
codeGenerator
();
cout
<<
"TargetCode:
\n\n\n\n
"
;
cout
<<
targetCode
;
*/
return
0
;
}
This diff is collapsed.
Click to expand it.
src/tmp.h
+
5
−
5
View file @
4b972d34
...
...
@@ -198,7 +198,7 @@ public:
}
}
targetCode
+=
"Out of registers!
\n
"
;
exit
(
1
)
;
return
-
1
;
}
else
if
(
!
(
flag
%
2
))
{
for
(
int
i
=
0
;
i
<
12
;
i
++
)
{
...
...
@@ -209,7 +209,7 @@ public:
}
}
targetCode
+=
"Out of registers!
\n
"
;
exit
(
1
)
;
return
-
1
;
}
}
...
...
@@ -325,7 +325,7 @@ public:
if
(
op
==
1
||
op
==
2
||
op
==
13
||
op
==
14
)
{
op_1_2_13_14
(
now
->
op
,
now
);
}
else
if
(
op
>=
3
&&
op
<=
11
)
{
op_3to12
(
now
->
op
,
now
);
//
op_3to12(now -> op, now);
}
else
if
(
op
>=
15
&&
op
<=
37
&&
op
%
2
==
1
)
{
op_if
(
now
->
op
,
now
);
}
else
if
(
op
==
39
)
{
...
...
@@ -1176,9 +1176,9 @@ public:
}
//
else
if
(
now
->
B_table
==
3
)
{
id
=
regManager
.
alloc_register
(
type
);
ParamRecord
*
now_param
=
&
(
paramTable
.
paramrecord
[(
int
)
now
->
A
]);
ParamRecord
*
now_param
=
&
(
paramTable
.
paramrecord
[(
int
)
now
->
B
]);
if
(
now_param
->
reg_type
==
1
)
{
id
=
regManager
.
alloc_register
(
1
);
//id = now_param -> rank;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets