Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cs444
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Xun Yang
cs444
Commits
4c9bc8f3
Commit
4c9bc8f3
authored
5 years ago
by
Xun Yang
Browse files
Options
Downloads
Patches
Plain Diff
change testcase Name, fix AssignNode
parent
8ba08dc8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ExprPrimaryNodes.py
+5
-3
5 additions, 3 deletions
ExprPrimaryNodes.py
Tests/A5/J1_01_basicTest.java
+3
-3
3 additions, 3 deletions
Tests/A5/J1_01_basicTest.java
with
8 additions
and
6 deletions
ExprPrimaryNodes.py
+
5
−
3
View file @
4c9bc8f3
...
@@ -247,9 +247,11 @@ class AssignNode(ASTNode):
...
@@ -247,9 +247,11 @@ class AssignNode(ASTNode):
def
codeGen
(
self
):
def
codeGen
(
self
):
self
.
right
.
codeGen
()
self
.
right
.
codeGen
()
self
.
code
=
self
.
right
.
code
self
.
code
=
self
.
right
.
code
if
self
.
left
.
prefixLink
.
__class__
.
__name__
==
"
VarDclNode
"
:
# move init result to var location
if
self
.
left
.
__class__
.
__name__
==
"
NameNode
"
:
self
.
code
+=
p
(
"
mov
"
,
"
[ebp +
"
+
str
(
self
.
left
.
prefixLink
.
offset
)
+
"
]
"
,
"
eax
"
)
if
self
.
left
.
prefixLink
.
__class__
.
__name__
==
"
VarDclNode
"
:
# move init result to var location
self
.
code
+=
p
(
"
mov
"
,
"
[ebp +
"
+
str
(
self
.
left
.
prefixLink
.
offset
)
+
"
]
"
,
"
eax
"
)
##################################################################################
##################################################################################
...
...
This diff is collapsed.
Click to expand it.
Tests/A5/J1_basicTest.java
→
Tests/A5/J1_
01_
basicTest.java
+
3
−
3
View file @
4c9bc8f3
public
class
J1_basicTest
{
public
class
J1_
01_
basicTest
{
public
J1_basicTest
()
{}
public
J1_
01_
basicTest
()
{}
public
static
int
test
()
{
public
static
int
test
()
{
return
J1_basicTest
.
test2
();
return
J1_
01_
basicTest
.
test2
();
}
}
public
static
int
test2
(){
public
static
int
test2
(){
...
...
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