Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tddd55-lab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TDDD55 - Compilers and Interpreters
tddd55-lab
Commits
daedbda5
Commit
daedbda5
authored
1 year ago
by
johti17
Browse files
Options
Downloads
Patches
Plain Diff
Fixed capitalization expanded Lab 4 instructions slightly README
parent
426bfae8
No related branches found
No related tags found
1 merge request
!5
Feedback 2023
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lab3-4/README.md
+50
-1
50 additions, 1 deletion
lab3-4/README.md
with
50 additions
and
1 deletion
lab3-4/README.md
+
50
−
1
View file @
daedbda5
...
...
@@ -71,9 +71,58 @@ diff -y my_output.txt ../traces/trace-lab3.txt
## Lab 4
In
l
ab 4 you will work in file
`codegen.cc`
search for
`/* --- Your code here --- */`
'
In
L
ab 4 you will work in file
`codegen.cc`
search for
`/* --- Your code here --- */`
'
to see where you need to introduce your changes.
A good place to start is the function
`BinaryGenerateCode`
```
C++
/*
*
* This function is used to generate code for all kinds of binary
* operators and relations. The arguments to the function are the
* following:
*
* q The QuadsList onto which the generated code is placed.
* realop The quad to generate for the operator if the arguments
* are of type real.
* intop The quad to generate for the operator if the arguments
* are of type integer.
* left The AST for the left-hand side of the operator. The
* value type of this AST must be the same as that of the
* AST for the right-hand side.
* right The AST for the right-hand side of the operator. The
* value type of this AST must be the same as that of the
* AST for the left-hand side.
* node The operator node itself. You probably won't need this
* unless you want to print an error message.
* type If not NULL, this is the type of the result. This is
* used for relations, where the type of the result is
* always integer, even if the operands are real. If this
* parameter is NULL, then the type of the result is the
* same as the type of the operands (the parser needs to
* make sure that the operands have the same type.)
*
* See the GenerateCode methods for the binary operators for
* examples of how this function is used.
*
*/
static VariableInformation *BinaryGenerateCode(QuadsList& q,
tQuadType realop,
tQuadType intop,
ASTNode *left,
ASTNode *right,
ASTNode *node,
TypeInformation *type = NULL)
{
/* --- Your code here --- */
return NULL;
/* --- End your code --- */
}
```
### Testing Lab 4
In order to test Lab 4, there exists a test script.
For more details see the README in the test folder.
...
...
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