diff --git a/lab3-4/README.md b/lab3-4/README.md index 3c18a97dfb81a88afcff4e6ab766c89bc0541b07..c6dda4ee8bd54e75519a0e6927f2517d01bef923 100644 --- a/lab3-4/README.md +++ b/lab3-4/README.md @@ -29,6 +29,49 @@ The same procedure can be done for the more advanced test, that is `traces/trace diff -y my_output.txt ../traces/trace-lab3.txt ``` +A good starting point for Lab 3 is to start by implementing support for the different expressions: +```C +/* --- Your code here --- + * + * Insert the expression grammar here + * The start symbol of the expression grammar is + * expression. This is important since it's used + * in a number of other places. + * + * Make sure that your code creates itor nodes in the + * AST wherever necessary and that it only created + * trees for expressions with compatible types! + */ + +expression : + { + cerr << "Expression here" << endl; + } + ; +``` + +Followed by the different rules for the conditions of the language: + +```C +/* --- Your code here --- + * + * Insert the condition grammar here + * The start symbol is condition. It's used + * elsewhere, so make sure you get it right. + * The boolean constants false and true are represented using the BooleanConstant AST-node. + * The other logical relations are subclasses of BinaryRelation. + * See the file ast.hh for the declarations. +*/ +condition : + { + cerr << "Condition here" << endl; + } + ; + +/* --- End your code --- */ +``` + + ## Lab 4 In lab 4 you will work in file `codegen.cc` search for `/* --- Your code here --- */`'