============================================== CPW Pt. 8: Representing Assignment Expressions [TOC] ============================================== ---- VIDEO ------------------------------ https://www.youtube.com/embed/h8FP63W1PRY ----------------------------------------- Quiz 21 ======= Extend the interface and implementation for expression nodes so that assignments and identifiers are supported: - Provide a constructor _newIdentifierExpr()_ for creating a dynamically allocated expression node for an identifier specified as parameter. The identifier is a unique string. - Provide a method _isLValueExpr()_ that returns true if an expression node represents an identifier. - Provide a enum constant _EK_ASSIGN_ for an expression kind that represents a binary node for an assignment. - Change the implementations of all methods so that the new kinds of expression nodes are supported. In the implementation of _evalExp_ you can assume that for the identifier a symbol exists. If this is not the case your code should trigger an assertion. Write a test program ~xtest_expr.c~. ---- CODE (type=sh) ------------------------------------------------------------------------------------------ submit hpc quiz21 expr.h expr.c sym.h sym.c ustr.h ustr.c xtest_expr.c lexer.h lexer.c tokenkind.h tokenkind.c --------------------------------------------------------------------------------------------------------------