/compiler-labs

22 fall, Principles of Compiler, Lab

Primary LanguageSWIG

compiler experiment assignments

init day: 2022/11/8 basically only because gitlab is quite useless, hard to push to remote repositories for us.

lab1 prework

lab2 prework2

lab3 lexer

lab4 parser

#wip

basic requests

  1. data type: int; func return value type: int, void
  2. declaration and initialization of variables and consts.
  3. sentences: assign(=) expr, expr, blocks, if 'while' 'return'
  4. expr:
    • arithmatics (binary: +, -, *, /, %; single: +,-)
    • relations (==, >, <, >=, <=, !=)
    • logistic (&&, ||, !)
  5. comments(blocks and lines)
  6. input output
  7. leaf func