Difference between revisions of "Computer Science/164/proj3"

From lensowiki
Jump to: navigation, search
m (moved CS/164 to CS/164/proj3)
m (Lensovet moved page CS/164/proj3 to Computer Science/164/proj3)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Milestone 1==
 
==Milestone 1==
 
* Fields and methods
 
* Fields and methods
*:The starter code supports empty objects and string literals, but it does not support adding fields or methods to objects.  You can test your implementation on the provided test-fields.164 file, which also details what fields must support and what syntax you must support. ''This should be done now''.
+
*:The starter code supports empty objects and string literals, but it does not support adding fields or methods to objects.  You can test your implementation on the provided test-fields.164 file, which also details what fields must support and what syntax you must support. ''This should be done now. Precedence is now correct as well.''
 
**basic syntax for put and get
 
**basic syntax for put and get
 
***S -> E[E] = E
 
***S -> E[E] = E
Line 12: Line 12:
 
***E -> E:Id(arglist) → E[Id](E[Id], arglist)
 
***E -> E:Id(arglist) → E[Id](E[Id], arglist)
 
*If/else and while statements
 
*If/else and while statements
*:You must add support for if/else and while statements.  You can test your implementation on the provided test-ifwhile.164 file.
+
*:You must add support for if/else and while statements.  You can test your implementation on the provided test-ifwhile.164 file. ''This should be done now''.
 
*Function arguments and return values
 
*Function arguments and return values
*:The starting code supports function calls with no arguments or return values.  You must add these features.  You can test your implementation on the provided test-functions.164 file.
+
*:The starting code supports function calls with no arguments or return values.  You must add these features.  You can test your implementation on the provided test-functions.164 file. ''This should be done now''. Did some additional testing such as passing a lambda which is then called immediately in the arg list. ''Now fixed to deal with recursion.''
 
*Coroutines
 
*Coroutines
*:You must add support for coroutines and the coroutine, yield, and resume expressions.  The coroutine expression creates a new coroutine.  The resume expression resumes a coroutine from where it last stopped, raising an error if it has already finished.  The yield expression yields back to whoever resumed the coroutine.  You can test your implementation on the provided test-coroutine.164 file.  Unlike functions, you do not have to support a variable number of arguments for resume and yield.  Resume takes two arguments, the second of which is passed as an argument to the function (the first time it is resumed) or returned by the corresponding yield (after the first resume).  So yield's return value is the argument passed to the corresponding resume.
+
*:You must add support for coroutines and the coroutine, yield, and resume expressions.  The coroutine expression creates a new coroutine.  The resume expression resumes a coroutine from where it last stopped, raising an error if it has already finished.  The yield expression yields back to whoever resumed the coroutine.  You can test your implementation on the provided test-coroutine.164 file.  Unlike functions, you do not have to support a variable number of arguments for resume and yield.  Resume takes two arguments, the second of which is passed as an argument to the function (the first time it is resumed) or returned by the corresponding yield (after the first resume).  So yield's return value is the argument passed to the corresponding resume. ''Finally implemented and works regardless of how deeply inside a callstack the yield happens.''

Latest revision as of 03:51, 20 February 2023

Milestone 1

  • Fields and methods
    The starter code supports empty objects and string literals, but it does not support adding fields or methods to objects. You can test your implementation on the provided test-fields.164 file, which also details what fields must support and what syntax you must support. This should be done now. Precedence is now correct as well.
    • basic syntax for put and get
      • S -> E[E] = E
      • E -> E[E]
    • sugar for variable access
      • S -> E.E = E → E[E] = E
      • E -> E.E → E[E]
    • sugar for method calls with self
      • S -> def E:id(arglist) { body } → E[id] = lambda('self,'+arglist, body)
      • E -> E:Id(arglist) → E[Id](E[Id], arglist)
  • If/else and while statements
    You must add support for if/else and while statements. You can test your implementation on the provided test-ifwhile.164 file. This should be done now.
  • Function arguments and return values
    The starting code supports function calls with no arguments or return values. You must add these features. You can test your implementation on the provided test-functions.164 file. This should be done now. Did some additional testing such as passing a lambda which is then called immediately in the arg list. Now fixed to deal with recursion.
  • Coroutines
    You must add support for coroutines and the coroutine, yield, and resume expressions. The coroutine expression creates a new coroutine. The resume expression resumes a coroutine from where it last stopped, raising an error if it has already finished. The yield expression yields back to whoever resumed the coroutine. You can test your implementation on the provided test-coroutine.164 file. Unlike functions, you do not have to support a variable number of arguments for resume and yield. Resume takes two arguments, the second of which is passed as an argument to the function (the first time it is resumed) or returned by the corresponding yield (after the first resume). So yield's return value is the argument passed to the corresponding resume. Finally implemented and works regardless of how deeply inside a callstack the yield happens.