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
1cce4cc5
Commit
1cce4cc5
authored
5 years ago
by
pycsham
Browse files
Options
Downloads
Patches
Plain Diff
modified test file to make debugging easier
parent
9bc45ca0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LineNodes.py
+6
-1
6 additions, 1 deletion
LineNodes.py
Test.py
+14
-7
14 additions, 7 deletions
Test.py
with
20 additions
and
8 deletions
LineNodes.py
+
6
−
1
View file @
1cce4cc5
...
@@ -59,7 +59,9 @@ def makeNodeFromNoTailStatement(parseTree):
...
@@ -59,7 +59,9 @@ def makeNodeFromNoTailStatement(parseTree):
elif
child
.
name
==
'
returnStatement
'
:
elif
child
.
name
==
'
returnStatement
'
:
return
ReturnNode
(
child
)
return
ReturnNode
(
child
)
###########################################################
# end of factory methods
###########################################################
# block
# block
# Rules:
# Rules:
...
@@ -78,6 +80,9 @@ class BlockNode(ASTNode):
...
@@ -78,6 +80,9 @@ class BlockNode(ASTNode):
self
.
children
=
self
.
statements
self
.
children
=
self
.
statements
# def buildEnv(self, parentEnv):
...
...
This diff is collapsed.
Click to expand it.
Test.py
+
14
−
7
View file @
1cce4cc5
...
@@ -40,6 +40,8 @@ def a2Multiple():
...
@@ -40,6 +40,8 @@ def a2Multiple():
testCases
=
[
f
.
path
for
f
in
scandir
(
testDirectory
)
if
f
.
is_dir
()]
testCases
=
[
f
.
path
for
f
in
scandir
(
testDirectory
)
if
f
.
is_dir
()]
for
c
in
testCases
:
for
c
in
testCases
:
print
(
"
**********************************************************
"
)
print
(
"
DIRECTORY
"
)
print
(
c
)
print
(
c
)
print
(
"
**********************************************************
"
)
print
(
"
**********************************************************
"
)
# get all files in the folder recursively
# get all files in the folder recursively
...
@@ -104,13 +106,18 @@ def run(testFiles):
...
@@ -104,13 +106,18 @@ def run(testFiles):
ASTs
=
astBuild
(
parseTrees
)
ASTs
=
astBuild
(
parseTrees
)
for
(
n
,
t
)
in
ASTs
:
# for (n, t) in ASTs:
print
(
n
)
# print(n)
print
(
"
--------------------
"
)
# print("--------------------")
t
.
printTree
()
# t.printTree()
print
(
"
\n
\n\n
\n
"
)
# print("\n \n\n \n")
buildEnvAndLink
(
ASTs
)
try
:
buildEnvAndLink
(
ASTs
)
except
Exception
as
e
:
print
(
"
error at environment building and linking
"
)
print
(
e
)
return
print
(
"
<<<<------- after buildEnvAndLink -------->>>>>>
"
)
print
(
"
<<<<------- after buildEnvAndLink -------->>>>>>
"
)
for
(
n
,
t
)
in
ASTs
:
for
(
n
,
t
)
in
ASTs
:
...
...
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