├── 2020 ├── README.md ├── problem-set │ ├── hw-1 │ │ ├── README.md │ │ ├── figs │ │ │ └── number.png │ │ ├── hw-preamble.tex │ │ ├── hw1.pdf │ │ ├── hw1.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-2 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw2.pdf │ │ ├── hw2.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-3 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw3.pdf │ │ ├── hw3.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-4 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw4.pdf │ │ ├── hw4.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-5 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw5.pdf │ │ ├── hw5.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-6 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw6.pdf │ │ ├── hw6.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-7 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw7.pdf │ │ ├── hw7.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ └── hw-8 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw8.pdf │ │ ├── hw8.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex ├── solution │ ├── README.md │ ├── hw-1 │ │ ├── ans.pdf │ │ ├── ans.tex │ │ ├── figs │ │ │ └── number.png │ │ ├── hw-preamble.tex │ │ ├── hw1.pdf │ │ ├── hw1.tex │ │ ├── tufte-book.cls │ │ ├── tufte-handout.cls │ │ ├── tufte-preamble.tex │ │ └── wt-preamble.tex │ ├── hw-2 │ │ ├── ans.pdf │ │ ├── ans.tex │ │ ├── hw-preamble.tex │ │ ├── testpath.pdf │ │ ├── testpath.tex │ │ ├── tufte-book.cls │ │ ├── tufte-handout.cls │ │ ├── tufte-preamble.tex │ │ └── wt-preamble.tex │ ├── hw-3 │ │ ├── README.md │ │ ├── ans.aux │ │ ├── ans.log │ │ ├── ans.out │ │ ├── ans.pdf │ │ ├── ans.synctex.gz │ │ ├── ans.tex │ │ ├── ans.thm │ │ ├── hw-preamble.tex │ │ ├── hw3.pdf │ │ ├── hw3.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-4 │ │ ├── README.md │ │ ├── ans.pdf │ │ ├── ans.tex │ │ ├── hw-preamble.tex │ │ ├── hw4.pdf │ │ ├── hw4.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-5 │ │ ├── README.md │ │ ├── ans.pdf │ │ ├── ans.tex │ │ ├── hw-preamble.tex │ │ ├── hw5.pdf │ │ ├── hw5.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-6 │ │ ├── README.md │ │ ├── ans.pdf │ │ ├── ans.tex │ │ ├── hw-preamble.tex │ │ ├── hw6.pdf │ │ ├── hw6.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-7 │ │ ├── README.md │ │ ├── ans.pdf │ │ ├── ans.tex │ │ ├── hw-preamble.tex │ │ ├── hw7.pdf │ │ ├── hw7.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ └── hw-8 │ │ ├── README.md │ │ ├── ans.pdf │ │ ├── ans.tex │ │ ├── hw-preamble.tex │ │ ├── hw8.pdf │ │ ├── hw8.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex └── zip │ ├── hw-1.zip │ ├── hw-2.zip │ ├── hw-3.zip │ ├── hw-4.zip │ ├── hw-5.zip │ ├── hw-6.zip │ ├── hw-7.zip │ └── hw-8.zip ├── 2021 ├── README.md ├── problem-set │ ├── README.md │ ├── hw-1 │ │ ├── README.md │ │ ├── figs │ │ │ └── floating-constants.png │ │ ├── hw-preamble.tex │ │ ├── hw1.pdf │ │ ├── hw1.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-2 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw2.pdf │ │ ├── hw2.tex │ │ ├── hw2.zip │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-3 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw3.pdf │ │ ├── hw3.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-4 │ │ ├── README.md │ │ ├── figs │ │ │ ├── LRExpr.png │ │ │ └── LRExprPrec.png │ │ ├── hw-preamble.tex │ │ ├── hw4.pdf │ │ ├── hw4.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-5 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw5.pdf │ │ ├── hw5.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-6 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw6.pdf │ │ ├── hw6.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ └── hw-7 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw7.pdf │ │ ├── hw7.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex ├── solution │ ├── README.md │ ├── hw-1 │ │ ├── README.md │ │ ├── figs │ │ │ └── floating-constants.png │ │ ├── hw-preamble.tex │ │ ├── hw1.pdf │ │ ├── hw1.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-2 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw2.pdf │ │ ├── hw2.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-3 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw3.pdf │ │ ├── hw3.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-4 │ │ ├── README.md │ │ ├── figs │ │ │ ├── LRExpr.png │ │ │ └── LRExprPrec.png │ │ ├── hw-preamble.tex │ │ ├── hw4.pdf │ │ ├── hw4.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-5 │ │ ├── README.md │ │ ├── fig │ │ │ └── lr1.png │ │ ├── hw-preamble.tex │ │ ├── hw5.pdf │ │ ├── hw5.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-6 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw6.pdf │ │ ├── hw6.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ └── hw-7 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw7.pdf │ │ ├── hw7.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex └── zip │ ├── hw1-lexer.zip │ ├── hw2-lexer.zip │ ├── hw3-parser.zip │ ├── hw4-parser.zip │ ├── hw5-parser.zip │ ├── hw6-semantics.zip │ └── hw7-ir.zip ├── 2022 ├── problem-set │ ├── hw-1 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw1.pdf │ │ ├── hw1.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-2 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw2.pdf │ │ ├── hw2.tex │ │ ├── hw2.zip │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-3 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw3.pdf │ │ ├── hw3.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-4 │ │ ├── README.md │ │ ├── figs │ │ │ ├── LRExpr.png │ │ │ └── LRExprPrec.png │ │ ├── hw-preamble.tex │ │ ├── hw4.pdf │ │ ├── hw4.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-5 │ │ ├── README.md │ │ ├── figs │ │ │ ├── struct-code.png │ │ │ └── type-decl.png │ │ ├── hw-preamble.tex │ │ ├── hw5.pdf │ │ ├── hw5.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-6 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw6.pdf │ │ ├── hw6.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ └── hw-7 │ │ ├── README.md │ │ ├── figs │ │ └── while.png │ │ ├── hw-preamble.tex │ │ ├── hw7.pdf │ │ ├── hw7.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex ├── solution │ ├── hw-1 │ │ ├── hw-preamble.tex │ │ ├── hw1.pdf │ │ ├── hw1.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-2 │ │ ├── hw-preamble.tex │ │ ├── hw2.pdf │ │ ├── hw2.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-3 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw3.pdf │ │ ├── hw3.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-4 │ │ ├── README.md │ │ ├── figs │ │ │ ├── LRExpr.png │ │ │ ├── LRExprPrec.png │ │ │ └── jflap.png │ │ ├── hw-preamble.tex │ │ ├── hw4.pdf │ │ ├── hw4.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-5 │ │ ├── README.md │ │ ├── figs │ │ │ ├── struct-code.png │ │ │ └── type-decl.png │ │ ├── hw-preamble.tex │ │ ├── hw5.pdf │ │ ├── hw5.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ └── hw-6 │ │ ├── README.md │ │ ├── hw-preamble.tex │ │ ├── hw6.pdf │ │ ├── hw6.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex └── zip │ ├── hw1-lexer-re-antlr.zip │ ├── hw2-lexer-automata.zip │ ├── hw3-cfg.zip │ ├── hw4-parser-ll.zip │ ├── hw5-symboltable-typesystem.zip │ ├── hw6-ag.zip │ └── hw7-codegen.zip ├── 2023 ├── README.md ├── hw-0 │ ├── README.md │ ├── figs │ │ └── abstraction.jpg │ ├── hw-preamble.tex │ ├── hw0.pdf │ ├── hw0.tex │ ├── tufte-book.cls │ ├── tufte-common.def │ ├── tufte-handout.cls │ └── tufte-preamble.tex ├── hw-1 │ ├── README.md │ ├── figs │ │ └── regex-quote.png │ ├── hw-preamble.tex │ ├── hw1.pdf │ ├── hw1.tex │ ├── tufte-book.cls │ ├── tufte-common.def │ ├── tufte-handout.cls │ └── tufte-preamble.tex ├── hw-2 │ ├── README.md │ ├── figs │ │ ├── automata-quote.jpg │ │ ├── dfa.png │ │ └── regex-quote.png │ ├── hw-preamble.tex │ ├── hw2.pdf │ ├── hw2.tex │ ├── jflap │ │ └── dfa.jff │ ├── tufte-book.cls │ ├── tufte-common.def │ ├── tufte-handout.cls │ └── tufte-preamble.tex ├── hw-3 │ ├── README.md │ ├── figs │ │ └── design-patterns.png │ ├── hw-preamble.tex │ ├── hw3.pdf │ ├── hw3.tex │ ├── tufte-book.cls │ ├── tufte-common.def │ ├── tufte-handout.cls │ └── tufte-preamble.tex ├── hw-4 │ ├── README.md │ ├── cfg │ │ ├── cfg-a-b-lang.tex │ │ ├── cfg-equal-number-a-b.tex │ │ └── cfg-unequal-number-a-b.tex │ ├── figs │ │ ├── LRExpr.png │ │ └── LRExprPrec.png │ ├── hw-preamble.tex │ ├── hw4.pdf │ ├── hw4.tex │ ├── tufte-book.cls │ ├── tufte-common.def │ ├── tufte-handout.cls │ └── tufte-preamble.tex ├── hw-5 │ ├── README.md │ ├── cfg │ │ ├── cfg-a-b-lang.tex │ │ └── cfg-equal-number-a-b.tex │ ├── figs │ │ └── climbing.png │ ├── hw-preamble.tex │ ├── hw5.pdf │ ├── hw5.tex │ ├── tufte-book.cls │ ├── tufte-common.def │ ├── tufte-handout.cls │ └── tufte-preamble.tex ├── hw-6 │ ├── README.md │ ├── figs │ │ └── not-easy.jpg │ ├── hw-preamble.tex │ ├── hw6.pdf │ ├── hw6.tex │ ├── tufte-book.cls │ ├── tufte-common.def │ ├── tufte-handout.cls │ └── tufte-preamble.tex ├── hw-7 │ ├── README.md │ ├── figs │ │ └── knuth-paper-1967.png │ ├── hw-preamble.tex │ ├── hw7.pdf │ ├── hw7.tex │ ├── tufte-book.cls │ ├── tufte-common.def │ ├── tufte-handout.cls │ └── tufte-preamble.tex ├── hw-8 │ ├── README.md │ ├── figs │ │ └── LLVM-logo.png │ ├── hw-preamble.tex │ ├── hw8.pdf │ ├── hw8.tex │ ├── tufte-book.cls │ ├── tufte-common.def │ ├── tufte-handout.cls │ └── tufte-preamble.tex └── zip │ ├── hw-0.zip │ ├── hw-1.zip │ ├── hw-2.zip │ ├── hw-3.zip │ ├── hw-4.zip │ ├── hw-5.zip │ ├── hw-6.zip │ ├── hw-7.zip │ └── hw-8.zip ├── 2024 ├── README.md ├── problem-set │ ├── hw-0 │ │ ├── README.md │ │ ├── figs │ │ │ └── abstraction.jpg │ │ ├── hw-preamble.tex │ │ ├── hw0.pdf │ │ ├── hw0.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-1 │ │ ├── README.md │ │ ├── figs │ │ │ └── lexing.png │ │ ├── hw-preamble.tex │ │ ├── hw1.pdf │ │ ├── hw1.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-2 │ │ ├── Kleene Algorithm.pdf │ │ ├── README.md │ │ ├── figs │ │ │ ├── android.png │ │ │ ├── automata-quote.jpg │ │ │ ├── book-learn-re.jpg │ │ │ ├── design-patterns.png │ │ │ ├── fat-mat.png │ │ │ └── regex-quote.png │ │ ├── hw-preamble.tex │ │ ├── hw2.pdf │ │ ├── hw2.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-3 │ │ ├── README.md │ │ ├── cfg │ │ │ ├── cfg-a-b-lang.tex │ │ │ ├── cfg-equal-number-a-b-correct.tex │ │ │ ├── cfg-equal-number-a-b.tex │ │ │ └── cfg-unequal-number-a-b.tex │ │ ├── figs │ │ │ ├── LRExprPrec.png │ │ │ ├── ifstat-g4.png │ │ │ ├── ifstat-open-matched-g4.png │ │ │ ├── pumping-lemma.png │ │ │ └── pumping-lemma.webp │ │ ├── hw-preamble.tex │ │ ├── hw3.pdf │ │ ├── hw3.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-4 │ │ ├── README.md │ │ ├── cfg │ │ │ └── decl.tex │ │ ├── figs │ │ │ └── climbing.png │ │ ├── hw-preamble.tex │ │ ├── hw4.pdf │ │ ├── hw4.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-5 │ │ ├── README.md │ │ ├── figs │ │ │ ├── D-parse-tree-array.png │ │ │ ├── D-parse-tree-func.png │ │ │ ├── D-parse-tree-pointer.png │ │ │ └── knuth-paper-1967.png │ │ ├── grammar │ │ │ └── decl-ag.tex │ │ ├── hw-preamble.tex │ │ ├── hw5.pdf │ │ ├── hw5.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-6 │ │ ├── README.md │ │ ├── figs │ │ │ └── while.pdf │ │ ├── hw-preamble.tex │ │ ├── hw6.pdf │ │ ├── hw6.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-7 │ │ ├── README.md │ │ ├── figs │ │ │ ├── fib-rec-25-blank.png │ │ │ ├── fib-rec-25.png │ │ │ ├── fib-rec-49-blank.png │ │ │ ├── fib-rec-49.png │ │ │ ├── fib-rec-c.png │ │ │ ├── fib-rec-wrong-23-blank.png │ │ │ ├── fib-rec-wrong-23.png │ │ │ ├── fib-rec-wrong-46-blank.png │ │ │ ├── fib-rec-wrong-46.png │ │ │ ├── fib-rec-wrong-fib.png │ │ │ ├── fib-rec-wrong-main.png │ │ │ └── fig-fib-rec-wrong.tex │ │ ├── hw-preamble.tex │ │ ├── hw7.pdf │ │ ├── hw7.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-8 │ │ ├── README.md │ │ ├── figs │ │ │ ├── cfg-hierarchy.png │ │ │ └── parsing.jpeg │ │ ├── grammar │ │ │ └── lr.tex │ │ ├── hw-preamble.tex │ │ ├── hw8.pdf │ │ ├── hw8.tex │ │ ├── table │ │ │ └── slr.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ ├── hw-9 │ │ ├── README.md │ │ ├── algs │ │ │ └── exam.tex │ │ ├── hw-preamble.tex │ │ ├── hw9.pdf │ │ ├── hw9.tex │ │ ├── tufte-book.cls │ │ ├── tufte-common.def │ │ ├── tufte-handout.cls │ │ └── tufte-preamble.tex │ └── zip │ │ ├── hw-0-overview.zip │ │ ├── hw-1-lexer.zip │ │ ├── hw-2-re-automata.zip │ │ ├── hw-3-cfg.zip │ │ ├── hw-4-ll.zip │ │ ├── hw-5-ag.zip │ │ ├── hw-6-ir.zip │ │ ├── hw-7-riscv.zip │ │ ├── hw-8-lr.zip │ │ └── hw-9-codegen.zip └── solution │ ├── hw-1 │ ├── README.md │ ├── figs │ │ └── lexing.png │ ├── hw-preamble.tex │ ├── hw1-solution.pdf │ ├── hw1-solution.tex │ ├── tufte-book.cls │ ├── tufte-common.def │ ├── tufte-handout.cls │ └── tufte-preamble.tex │ ├── hw-3 │ ├── cfg │ │ ├── cfg-a-b-lang.tex │ │ ├── cfg-equal-number-a-b-correct.tex │ │ ├── cfg-equal-number-a-b.tex │ │ └── cfg-unequal-number-a-b.tex │ ├── figs │ │ ├── LRExprPrec.png │ │ ├── ifstat-g4.png │ │ ├── ifstat-open-matched-g4.png │ │ ├── pumping-lemma.png │ │ └── pumping-lemma.webp │ ├── hw-3.pdf │ ├── hw-preamble.tex │ ├── hw3.tex │ ├── tufte-book.cls │ ├── tufte-common.def │ ├── tufte-handout.cls │ └── tufte-preamble.tex │ ├── hw-5 │ ├── README.md │ ├── figs │ │ ├── D-parse-tree-array.png │ │ ├── D-parse-tree-func.png │ │ ├── D-parse-tree-pointer.png │ │ ├── depth-analysis.jpg │ │ ├── depth-solution.jpg │ │ ├── knuth-paper-1967.png │ │ ├── number-1.jpg │ │ ├── number-2-1.jpg │ │ └── number-2-2.jpg │ ├── grammar │ │ ├── decl-ag-sdt.tex │ │ └── decl-ag.tex │ ├── hw-preamble.tex │ ├── hw5.pdf │ ├── hw5.tex │ ├── tufte-book.cls │ ├── tufte-common.def │ ├── tufte-handout.cls │ └── tufte-preamble.tex │ ├── hw-7 │ ├── README.md │ ├── figs │ │ ├── fib-rec-25-blank.png │ │ ├── fib-rec-25.png │ │ ├── fib-rec-49-blank.png │ │ ├── fib-rec-49.png │ │ ├── fib-rec-c.png │ │ ├── fib-rec-wrong-23-blank.png │ │ ├── fib-rec-wrong-23.png │ │ ├── fib-rec-wrong-46-blank.png │ │ ├── fib-rec-wrong-46.png │ │ ├── fib-rec-wrong-fib.png │ │ ├── fib-rec-wrong-main.png │ │ └── fig-fib-rec-wrong.tex │ ├── hw-preamble.tex │ ├── hw7.pdf │ ├── hw7.tex │ ├── tufte-book.cls │ ├── tufte-common.def │ ├── tufte-handout.cls │ └── tufte-preamble.tex │ ├── hw-8 │ ├── README.md │ ├── figs │ │ ├── cfg-hierarchy.png │ │ ├── parsing.jpeg │ │ └── slr.png │ ├── grammar │ │ ├── ll1-not-slr.tex │ │ ├── lr.tex │ │ └── slr.jff │ ├── hw-preamble.tex │ ├── hw8.pdf │ ├── hw8.tex │ ├── table │ │ └── slr.tex │ ├── tufte-book.cls │ ├── tufte-common.def │ ├── tufte-handout.cls │ └── tufte-preamble.tex │ └── zip │ └── hw-1-lexer-solution.zip ├── .gitignore ├── LICENSE ├── README.md └── tools ├── README.md ├── algorithmicx.pdf ├── lshort-zh-cn.pdf ├── tikz-automata.pdf └── tufte-handout.pdf /2020/README.md: -------------------------------------------------------------------------------- 1 | # 2020 2 | 3 | - [problem-set](problem-set/) 4 | - [solution](solution/) 5 | - [zip](zip/) -------------------------------------------------------------------------------- /2020/problem-set/hw-1/README.md: -------------------------------------------------------------------------------- 1 | # README.md 2 | 3 | ## 2 4 | - s$: $ 属于 others -------------------------------------------------------------------------------- /2020/problem-set/hw-1/figs/number.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/problem-set/hw-1/figs/number.png -------------------------------------------------------------------------------- /2020/problem-set/hw-1/hw1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/problem-set/hw-1/hw1.pdf -------------------------------------------------------------------------------- /2020/problem-set/hw-1/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/problem-set/hw-1/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2020/problem-set/hw-2/README.md: -------------------------------------------------------------------------------- 1 | # hw-2 2 | 3 | - tools for writing `regex` and drawing `automata` (LaTeX, online) -------------------------------------------------------------------------------- /2020/problem-set/hw-2/hw2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/problem-set/hw-2/hw2.pdf -------------------------------------------------------------------------------- /2020/problem-set/hw-2/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/problem-set/hw-2/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2020/problem-set/hw-3/README.md: -------------------------------------------------------------------------------- 1 | # hw-3 2 | 3 | - tools for writing `cfg` and drawing `tree` (LaTeX, online) -------------------------------------------------------------------------------- /2020/problem-set/hw-3/hw3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/problem-set/hw-3/hw3.pdf -------------------------------------------------------------------------------- /2020/problem-set/hw-3/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/problem-set/hw-3/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2020/problem-set/hw-4/README.md: -------------------------------------------------------------------------------- 1 | # hw-4 -------------------------------------------------------------------------------- /2020/problem-set/hw-4/hw4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/problem-set/hw-4/hw4.pdf -------------------------------------------------------------------------------- /2020/problem-set/hw-4/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/problem-set/hw-4/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2020/problem-set/hw-5/README.md: -------------------------------------------------------------------------------- 1 | # hw-5 -------------------------------------------------------------------------------- /2020/problem-set/hw-5/hw5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/problem-set/hw-5/hw5.pdf -------------------------------------------------------------------------------- /2020/problem-set/hw-5/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/problem-set/hw-5/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2020/problem-set/hw-6/README.md: -------------------------------------------------------------------------------- 1 | # hw-6 -------------------------------------------------------------------------------- /2020/problem-set/hw-6/hw6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/problem-set/hw-6/hw6.pdf -------------------------------------------------------------------------------- /2020/problem-set/hw-6/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/problem-set/hw-6/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2020/problem-set/hw-7/README.md: -------------------------------------------------------------------------------- 1 | # hw-7 -------------------------------------------------------------------------------- /2020/problem-set/hw-7/hw7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/problem-set/hw-7/hw7.pdf -------------------------------------------------------------------------------- /2020/problem-set/hw-7/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/problem-set/hw-7/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2020/problem-set/hw-8/README.md: -------------------------------------------------------------------------------- 1 | # hw-8 -------------------------------------------------------------------------------- /2020/problem-set/hw-8/hw8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/problem-set/hw-8/hw8.pdf -------------------------------------------------------------------------------- /2020/problem-set/hw-8/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/problem-set/hw-8/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2020/solution/README.md: -------------------------------------------------------------------------------- 1 | * ans.tex:作业代码 2 | * ans.pdf:作业pdf 3 | 4 | -------------------------------------------------------------------------------- /2020/solution/hw-1/ans.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-1/ans.pdf -------------------------------------------------------------------------------- /2020/solution/hw-1/figs/number.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-1/figs/number.png -------------------------------------------------------------------------------- /2020/solution/hw-1/hw1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-1/hw1.pdf -------------------------------------------------------------------------------- /2020/solution/hw-1/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/solution/hw-1/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2020/solution/hw-2/ans.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-2/ans.pdf -------------------------------------------------------------------------------- /2020/solution/hw-2/testpath.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-2/testpath.pdf -------------------------------------------------------------------------------- /2020/solution/hw-2/testpath.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt]{article} 2 | %\usepackage[english]{babel} 3 | %\usepackage[utf8x]{inputenc} 4 | %\usepackage{amsmath} 5 | \usepackage{tikz} 6 | \usetikzlibrary{arrows,automata} 7 | \begin{document} 8 | \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2cm, 9 | scale = 1,transform shape] 10 | \tikzstyle{every state}=[fill={rgb:black,1;white,10}] 11 | \node[state,initial] (0) {$0$}; 12 | \node[state,accepting] (1) [right of=0] {$1$}; 13 | 14 | \path (0) edge node {$b$} (1); 15 | 16 | \end{tikzpicture} 17 | \begin{tikzpicture}[->,>=stealth,shorten >=1pt,node distance=2cm,auto, 18 | scale = 1,transform shape] 19 | \tikzstyle{every state}=[fill={rgb:black,1;white,10}] 20 | 21 | \node[state] (0) {$s_0$}; 22 | \node[state] (1) [right of=0] {$s_1$}; 23 | \path 24 | (0) edge[above] node{$a$} (1); 25 | 26 | \end{tikzpicture} 27 | \end{document} 28 | -------------------------------------------------------------------------------- /2020/solution/hw-2/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/solution/hw-2/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2020/solution/hw-3/README.md: -------------------------------------------------------------------------------- 1 | # hw-3 2 | 3 | - tools for writing `cfg` and drawing `tree` (LaTeX, online) -------------------------------------------------------------------------------- /2020/solution/hw-3/ans.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{\numberline {1}作业 (必做部分)}{1}{section.1}\protected@file@percent } 20 | \@writefile{thm}{\contentsline {problem}{{题目}{1}{\score {10 = 2 + 2 + 2 + 1 + 3}}}{1}{problem.1.0.1}\protected@file@percent } 21 | \@writefile{thm}{\contentsline {solution}{{解答}{1}{}}{1}{solution.1}\protected@file@percent } 22 | \@writefile{loa}{\contentsline {algorithm}{\numberline {1}Parser}{2}{algorithm.1}\protected@file@percent } 23 | \@writefile{toc}{\contentsline {section}{\numberline {2}反馈}{2}{section.2}\protected@file@percent } 24 | \ttl@finishall 25 | -------------------------------------------------------------------------------- /2020/solution/hw-3/ans.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section.1}{\376\377\117\134\116\032\000\040\000\050\137\305\120\132\220\350\122\006\000\051}{}% 1 2 | \BOOKMARK [1][-]{section.2}{\376\377\123\315\231\210}{}% 2 3 | -------------------------------------------------------------------------------- /2020/solution/hw-3/ans.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-3/ans.pdf -------------------------------------------------------------------------------- /2020/solution/hw-3/ans.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-3/ans.synctex.gz -------------------------------------------------------------------------------- /2020/solution/hw-3/ans.thm: -------------------------------------------------------------------------------- 1 | \contentsline {problem}{{题目}{1}{\score {10 = 2 + 2 + 2 + 1 + 3}}}{1}{problem.1.0.1}% 2 | \contentsline {solution}{{解答}{1}{}}{1}{solution.1}% 3 | -------------------------------------------------------------------------------- /2020/solution/hw-3/hw3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-3/hw3.pdf -------------------------------------------------------------------------------- /2020/solution/hw-3/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/solution/hw-4/README.md: -------------------------------------------------------------------------------- 1 | # hw-4 -------------------------------------------------------------------------------- /2020/solution/hw-4/ans.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-4/ans.pdf -------------------------------------------------------------------------------- /2020/solution/hw-4/hw4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-4/hw4.pdf -------------------------------------------------------------------------------- /2020/solution/hw-4/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/solution/hw-4/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2020/solution/hw-5/README.md: -------------------------------------------------------------------------------- 1 | # hw-5 -------------------------------------------------------------------------------- /2020/solution/hw-5/ans.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-5/ans.pdf -------------------------------------------------------------------------------- /2020/solution/hw-5/hw5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-5/hw5.pdf -------------------------------------------------------------------------------- /2020/solution/hw-5/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/solution/hw-5/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2020/solution/hw-6/README.md: -------------------------------------------------------------------------------- 1 | # hw-6 -------------------------------------------------------------------------------- /2020/solution/hw-6/ans.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-6/ans.pdf -------------------------------------------------------------------------------- /2020/solution/hw-6/hw6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-6/hw6.pdf -------------------------------------------------------------------------------- /2020/solution/hw-6/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/solution/hw-6/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2020/solution/hw-7/README.md: -------------------------------------------------------------------------------- 1 | # hw-7 -------------------------------------------------------------------------------- /2020/solution/hw-7/ans.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-7/ans.pdf -------------------------------------------------------------------------------- /2020/solution/hw-7/hw7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-7/hw7.pdf -------------------------------------------------------------------------------- /2020/solution/hw-7/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/solution/hw-7/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2020/solution/hw-8/README.md: -------------------------------------------------------------------------------- 1 | # hw-8 -------------------------------------------------------------------------------- /2020/solution/hw-8/ans.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-8/ans.pdf -------------------------------------------------------------------------------- /2020/solution/hw-8/hw8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/solution/hw-8/hw8.pdf -------------------------------------------------------------------------------- /2020/solution/hw-8/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2020/solution/hw-8/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2020/zip/hw-1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/zip/hw-1.zip -------------------------------------------------------------------------------- /2020/zip/hw-2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/zip/hw-2.zip -------------------------------------------------------------------------------- /2020/zip/hw-3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/zip/hw-3.zip -------------------------------------------------------------------------------- /2020/zip/hw-4.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/zip/hw-4.zip -------------------------------------------------------------------------------- /2020/zip/hw-5.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/zip/hw-5.zip -------------------------------------------------------------------------------- /2020/zip/hw-6.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/zip/hw-6.zip -------------------------------------------------------------------------------- /2020/zip/hw-7.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/zip/hw-7.zip -------------------------------------------------------------------------------- /2020/zip/hw-8.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2020/zip/hw-8.zip -------------------------------------------------------------------------------- /2021/README.md: -------------------------------------------------------------------------------- 1 | # 2021 2 | 3 | - [problem-set](problem-set/) 4 | - [solution](solution/) 5 | - [zip](zip/) -------------------------------------------------------------------------------- /2021/problem-set/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/problem-set/README.md -------------------------------------------------------------------------------- /2021/problem-set/hw-1/README.md: -------------------------------------------------------------------------------- 1 | # README.md -------------------------------------------------------------------------------- /2021/problem-set/hw-1/figs/floating-constants.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/problem-set/hw-1/figs/floating-constants.png -------------------------------------------------------------------------------- /2021/problem-set/hw-1/hw1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/problem-set/hw-1/hw1.pdf -------------------------------------------------------------------------------- /2021/problem-set/hw-1/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2021/problem-set/hw-1/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2021/problem-set/hw-2/README.md: -------------------------------------------------------------------------------- 1 | # hw-2 -------------------------------------------------------------------------------- /2021/problem-set/hw-2/hw2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/problem-set/hw-2/hw2.pdf -------------------------------------------------------------------------------- /2021/problem-set/hw-2/hw2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/problem-set/hw-2/hw2.zip -------------------------------------------------------------------------------- /2021/problem-set/hw-2/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2021/problem-set/hw-2/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2021/problem-set/hw-3/README.md: -------------------------------------------------------------------------------- 1 | # hw-3 2 | 3 | - tools for writing `cfg` and drawing `tree` (LaTeX, online) -------------------------------------------------------------------------------- /2021/problem-set/hw-3/hw3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/problem-set/hw-3/hw3.pdf -------------------------------------------------------------------------------- /2021/problem-set/hw-3/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2021/problem-set/hw-3/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2021/problem-set/hw-4/README.md: -------------------------------------------------------------------------------- 1 | # hw-4 -------------------------------------------------------------------------------- /2021/problem-set/hw-4/figs/LRExpr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/problem-set/hw-4/figs/LRExpr.png -------------------------------------------------------------------------------- /2021/problem-set/hw-4/figs/LRExprPrec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/problem-set/hw-4/figs/LRExprPrec.png -------------------------------------------------------------------------------- /2021/problem-set/hw-4/hw4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/problem-set/hw-4/hw4.pdf -------------------------------------------------------------------------------- /2021/problem-set/hw-4/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2021/problem-set/hw-4/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2021/problem-set/hw-5/README.md: -------------------------------------------------------------------------------- 1 | # hw-5 -------------------------------------------------------------------------------- /2021/problem-set/hw-5/hw5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/problem-set/hw-5/hw5.pdf -------------------------------------------------------------------------------- /2021/problem-set/hw-5/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2021/problem-set/hw-5/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2021/problem-set/hw-6/README.md: -------------------------------------------------------------------------------- 1 | # hw-6 -------------------------------------------------------------------------------- /2021/problem-set/hw-6/hw6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/problem-set/hw-6/hw6.pdf -------------------------------------------------------------------------------- /2021/problem-set/hw-6/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2021/problem-set/hw-7/README.md: -------------------------------------------------------------------------------- 1 | # hw-7 -------------------------------------------------------------------------------- /2021/problem-set/hw-7/hw7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/problem-set/hw-7/hw7.pdf -------------------------------------------------------------------------------- /2021/problem-set/hw-7/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2021/solution/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/solution/README.md -------------------------------------------------------------------------------- /2021/solution/hw-1/README.md: -------------------------------------------------------------------------------- 1 | # README.md -------------------------------------------------------------------------------- /2021/solution/hw-1/figs/floating-constants.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/solution/hw-1/figs/floating-constants.png -------------------------------------------------------------------------------- /2021/solution/hw-1/hw1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/solution/hw-1/hw1.pdf -------------------------------------------------------------------------------- /2021/solution/hw-1/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2021/solution/hw-2/README.md: -------------------------------------------------------------------------------- 1 | # hw-2 -------------------------------------------------------------------------------- /2021/solution/hw-2/hw2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/solution/hw-2/hw2.pdf -------------------------------------------------------------------------------- /2021/solution/hw-2/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2021/solution/hw-3/README.md: -------------------------------------------------------------------------------- 1 | # hw-3 2 | 3 | - tools for writing `cfg` and drawing `tree` (LaTeX, online) -------------------------------------------------------------------------------- /2021/solution/hw-3/hw3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/solution/hw-3/hw3.pdf -------------------------------------------------------------------------------- /2021/solution/hw-3/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2021/solution/hw-4/README.md: -------------------------------------------------------------------------------- 1 | # hw-4 -------------------------------------------------------------------------------- /2021/solution/hw-4/figs/LRExpr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/solution/hw-4/figs/LRExpr.png -------------------------------------------------------------------------------- /2021/solution/hw-4/figs/LRExprPrec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/solution/hw-4/figs/LRExprPrec.png -------------------------------------------------------------------------------- /2021/solution/hw-4/hw4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/solution/hw-4/hw4.pdf -------------------------------------------------------------------------------- /2021/solution/hw-4/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2021/solution/hw-5/README.md: -------------------------------------------------------------------------------- 1 | # hw-5 -------------------------------------------------------------------------------- /2021/solution/hw-5/fig/lr1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/solution/hw-5/fig/lr1.png -------------------------------------------------------------------------------- /2021/solution/hw-5/hw5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/solution/hw-5/hw5.pdf -------------------------------------------------------------------------------- /2021/solution/hw-5/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2021/solution/hw-6/README.md: -------------------------------------------------------------------------------- 1 | # hw-6 -------------------------------------------------------------------------------- /2021/solution/hw-6/hw6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/solution/hw-6/hw6.pdf -------------------------------------------------------------------------------- /2021/solution/hw-6/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2021/solution/hw-7/README.md: -------------------------------------------------------------------------------- 1 | # hw-7 -------------------------------------------------------------------------------- /2021/solution/hw-7/hw7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/solution/hw-7/hw7.pdf -------------------------------------------------------------------------------- /2021/solution/hw-7/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2021/zip/hw1-lexer.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/zip/hw1-lexer.zip -------------------------------------------------------------------------------- /2021/zip/hw2-lexer.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/zip/hw2-lexer.zip -------------------------------------------------------------------------------- /2021/zip/hw3-parser.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/zip/hw3-parser.zip -------------------------------------------------------------------------------- /2021/zip/hw4-parser.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/zip/hw4-parser.zip -------------------------------------------------------------------------------- /2021/zip/hw5-parser.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/zip/hw5-parser.zip -------------------------------------------------------------------------------- /2021/zip/hw6-semantics.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/zip/hw6-semantics.zip -------------------------------------------------------------------------------- /2021/zip/hw7-ir.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2021/zip/hw7-ir.zip -------------------------------------------------------------------------------- /2022/problem-set/hw-1/README.md: -------------------------------------------------------------------------------- 1 | # README.md -------------------------------------------------------------------------------- /2022/problem-set/hw-1/hw1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/problem-set/hw-1/hw1.pdf -------------------------------------------------------------------------------- /2022/problem-set/hw-1/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2022/problem-set/hw-2/README.md: -------------------------------------------------------------------------------- 1 | # hw-2 -------------------------------------------------------------------------------- /2022/problem-set/hw-2/hw2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/problem-set/hw-2/hw2.pdf -------------------------------------------------------------------------------- /2022/problem-set/hw-2/hw2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/problem-set/hw-2/hw2.zip -------------------------------------------------------------------------------- /2022/problem-set/hw-2/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2022/problem-set/hw-3/README.md: -------------------------------------------------------------------------------- 1 | # hw-3 2 | 3 | - tools for writing `cfg` and drawing `tree` (LaTeX, online) -------------------------------------------------------------------------------- /2022/problem-set/hw-3/hw3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/problem-set/hw-3/hw3.pdf -------------------------------------------------------------------------------- /2022/problem-set/hw-3/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2022/problem-set/hw-4/README.md: -------------------------------------------------------------------------------- 1 | # hw-4 -------------------------------------------------------------------------------- /2022/problem-set/hw-4/figs/LRExpr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/problem-set/hw-4/figs/LRExpr.png -------------------------------------------------------------------------------- /2022/problem-set/hw-4/figs/LRExprPrec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/problem-set/hw-4/figs/LRExprPrec.png -------------------------------------------------------------------------------- /2022/problem-set/hw-4/hw4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/problem-set/hw-4/hw4.pdf -------------------------------------------------------------------------------- /2022/problem-set/hw-4/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2022/problem-set/hw-5/README.md: -------------------------------------------------------------------------------- 1 | # hw-5 -------------------------------------------------------------------------------- /2022/problem-set/hw-5/figs/struct-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/problem-set/hw-5/figs/struct-code.png -------------------------------------------------------------------------------- /2022/problem-set/hw-5/figs/type-decl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/problem-set/hw-5/figs/type-decl.png -------------------------------------------------------------------------------- /2022/problem-set/hw-5/hw5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/problem-set/hw-5/hw5.pdf -------------------------------------------------------------------------------- /2022/problem-set/hw-5/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2022/problem-set/hw-6/README.md: -------------------------------------------------------------------------------- 1 | # hw-6 -------------------------------------------------------------------------------- /2022/problem-set/hw-6/hw6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/problem-set/hw-6/hw6.pdf -------------------------------------------------------------------------------- /2022/problem-set/hw-6/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2022/problem-set/hw-7/README.md: -------------------------------------------------------------------------------- 1 | # hw-7 -------------------------------------------------------------------------------- /2022/problem-set/hw-7/figs/while.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/problem-set/hw-7/figs/while.png -------------------------------------------------------------------------------- /2022/problem-set/hw-7/hw7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/problem-set/hw-7/hw7.pdf -------------------------------------------------------------------------------- /2022/problem-set/hw-7/hw7.tex: -------------------------------------------------------------------------------- 1 | % hw7.tex 2 | 3 | % !TEX program = xelatex 4 | %%%%%%%%%%%%%%%%%%%% 5 | % see http://mirrors.concertpass.com/tex-archive/macros/latex/contrib/tufte-latex/sample-handout.pdf 6 | % for how to use tufte-handout 7 | \documentclass[a4paper, justified]{tufte-handout} 8 | 9 | \input{hw-preamble} % feel free to modify this file if you understand LaTeX well 10 | %%%%%%%%%%%%%%%%%%%% 11 | \title{编译原理作业 (7)} 12 | \me{\hspace{50pt}}{\hspace{70pt}} 13 | \date{2023年1月3日} 14 | %%%%%%%%%%%%%%%%%%%% 15 | \begin{document} 16 | \maketitle 17 | %%%%%%%%%%%%%%%%%%%% 18 | \noplagiarism % PLEASE DON'T DELETE THIS LINE! 19 | %%%%%%%%%%%%%%%%%%%% 20 | \begin{abstract} 21 | \end{abstract} 22 | %%%%%%%%%%%%%%%%%%%% 23 | \beginrequired 24 | %%%%%%%%%%%%%%% 25 | 26 | %%%%%%%%%%%%%%% 27 | \begin{problem} 28 | 请将如下代码片段翻译成中间代码 29 | \fig{width = 0.50\textwidth}{figs/while} 30 | \end{problem} 31 | 32 | \begin{solution} 33 | \end{solution} 34 | %%%%%%%%%%%%%%% 35 | 36 | %%%%%%%%%%%%%%%%%%%% 37 | % 如果没有需要订正的题目,可以把这部分删掉 38 | 39 | % \begincorrection 40 | %%%%%%%%%%%%%%%%%%%% 41 | 42 | %%%%%%%%%%%%%%%%%%%% 43 | % 如果没有反馈,可以把这部分删掉 44 | \beginfb 45 | 46 | 你可以写 47 | \begin{itemize} 48 | \item 对课程及教师的建议与意见 49 | \item 教材中不理解的内容 50 | \item 希望深入了解的内容 51 | \item $\cdots$ 52 | \end{itemize} 53 | %%%%%%%%%%%%%%%%%%%% 54 | \end{document} -------------------------------------------------------------------------------- /2022/problem-set/hw-7/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2022/solution/hw-1/hw1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/solution/hw-1/hw1.pdf -------------------------------------------------------------------------------- /2022/solution/hw-1/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2022/solution/hw-2/hw2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/solution/hw-2/hw2.pdf -------------------------------------------------------------------------------- /2022/solution/hw-2/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2022/solution/hw-3/README.md: -------------------------------------------------------------------------------- 1 | # hw-3 2 | 3 | - tools for writing `cfg` and drawing `tree` (LaTeX, online) -------------------------------------------------------------------------------- /2022/solution/hw-3/hw3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/solution/hw-3/hw3.pdf -------------------------------------------------------------------------------- /2022/solution/hw-3/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2022/solution/hw-4/README.md: -------------------------------------------------------------------------------- 1 | # hw-4 -------------------------------------------------------------------------------- /2022/solution/hw-4/figs/LRExpr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/solution/hw-4/figs/LRExpr.png -------------------------------------------------------------------------------- /2022/solution/hw-4/figs/LRExprPrec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/solution/hw-4/figs/LRExprPrec.png -------------------------------------------------------------------------------- /2022/solution/hw-4/figs/jflap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/solution/hw-4/figs/jflap.png -------------------------------------------------------------------------------- /2022/solution/hw-4/hw4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/solution/hw-4/hw4.pdf -------------------------------------------------------------------------------- /2022/solution/hw-4/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2022/solution/hw-5/README.md: -------------------------------------------------------------------------------- 1 | # hw-5 -------------------------------------------------------------------------------- /2022/solution/hw-5/figs/struct-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/solution/hw-5/figs/struct-code.png -------------------------------------------------------------------------------- /2022/solution/hw-5/figs/type-decl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/solution/hw-5/figs/type-decl.png -------------------------------------------------------------------------------- /2022/solution/hw-5/hw5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/solution/hw-5/hw5.pdf -------------------------------------------------------------------------------- /2022/solution/hw-5/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2022/solution/hw-6/README.md: -------------------------------------------------------------------------------- 1 | # hw-6 -------------------------------------------------------------------------------- /2022/solution/hw-6/hw6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/solution/hw-6/hw6.pdf -------------------------------------------------------------------------------- /2022/solution/hw-6/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2022/zip/hw1-lexer-re-antlr.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/zip/hw1-lexer-re-antlr.zip -------------------------------------------------------------------------------- /2022/zip/hw2-lexer-automata.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/zip/hw2-lexer-automata.zip -------------------------------------------------------------------------------- /2022/zip/hw3-cfg.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/zip/hw3-cfg.zip -------------------------------------------------------------------------------- /2022/zip/hw4-parser-ll.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/zip/hw4-parser-ll.zip -------------------------------------------------------------------------------- /2022/zip/hw5-symboltable-typesystem.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/zip/hw5-symboltable-typesystem.zip -------------------------------------------------------------------------------- /2022/zip/hw6-ag.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/zip/hw6-ag.zip -------------------------------------------------------------------------------- /2022/zip/hw7-codegen.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2022/zip/hw7-codegen.zip -------------------------------------------------------------------------------- /2023/README.md: -------------------------------------------------------------------------------- 1 | # 2023 Spring -------------------------------------------------------------------------------- /2023/hw-0/README.md: -------------------------------------------------------------------------------- 1 | # README.md -------------------------------------------------------------------------------- /2023/hw-0/figs/abstraction.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-0/figs/abstraction.jpg -------------------------------------------------------------------------------- /2023/hw-0/hw0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-0/hw0.pdf -------------------------------------------------------------------------------- /2023/hw-0/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2023/hw-0/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2023/hw-1/README.md: -------------------------------------------------------------------------------- 1 | # README.md -------------------------------------------------------------------------------- /2023/hw-1/figs/regex-quote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-1/figs/regex-quote.png -------------------------------------------------------------------------------- /2023/hw-1/hw1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-1/hw1.pdf -------------------------------------------------------------------------------- /2023/hw-1/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2023/hw-1/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2023/hw-2/README.md: -------------------------------------------------------------------------------- 1 | # README.md -------------------------------------------------------------------------------- /2023/hw-2/figs/automata-quote.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-2/figs/automata-quote.jpg -------------------------------------------------------------------------------- /2023/hw-2/figs/dfa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-2/figs/dfa.png -------------------------------------------------------------------------------- /2023/hw-2/figs/regex-quote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-2/figs/regex-quote.png -------------------------------------------------------------------------------- /2023/hw-2/hw2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-2/hw2.pdf -------------------------------------------------------------------------------- /2023/hw-2/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2023/hw-2/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2023/hw-3/README.md: -------------------------------------------------------------------------------- 1 | # hw-3 2 | 3 | - tools for writing `cfg` and drawing `tree` (LaTeX, online) -------------------------------------------------------------------------------- /2023/hw-3/figs/design-patterns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-3/figs/design-patterns.png -------------------------------------------------------------------------------- /2023/hw-3/hw3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-3/hw3.pdf -------------------------------------------------------------------------------- /2023/hw-3/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2023/hw-3/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2023/hw-4/README.md: -------------------------------------------------------------------------------- 1 | # hw4 2 | 3 | 第一题的第二个文法**不表示**`包含相同数量的a/b构成的串` 4 | 5 | [这里有一个备选](https://cs.stackexchange.com/questions/64569/unambiguous-grammar-that-produce-equal-number-of-a-and-b),不过我还没有仔细验证 -------------------------------------------------------------------------------- /2023/hw-4/cfg/cfg-a-b-lang.tex: -------------------------------------------------------------------------------- 1 | % cfg-a-b-lang.tex 2 | 3 | \setcounter{equation}{0} 4 | \begin{align} 5 | S &\to aAbS \mid bBaS \mid \epsilon \\[8pt] 6 | A &\to aAb \mid \epsilon \\[8pt] 7 | B &\to bBa \mid \epsilon 8 | \end{align} -------------------------------------------------------------------------------- /2023/hw-4/cfg/cfg-equal-number-a-b.tex: -------------------------------------------------------------------------------- 1 | % cfg-equal-number-a-b.tex 2 | 3 | \setcounter{equation}{0} 4 | \begin{align*} 5 | V \to aVbV \mid bVaV \mid \epsilon 6 | \end{align*} -------------------------------------------------------------------------------- /2023/hw-4/cfg/cfg-unequal-number-a-b.tex: -------------------------------------------------------------------------------- 1 | % cfg-unequal-number-a-b.tex 2 | 3 | \setcounter{equation}{0} 4 | \begin{align} 5 | S &\to T \mid U \\[8pt] 6 | T &\to VaT \mid VaV \\[8pt] 7 | U &\to VbU \mid VbV \\[8pt] 8 | V &\to aVbV \mid bVaV \mid \epsilon 9 | \end{align} -------------------------------------------------------------------------------- /2023/hw-4/figs/LRExpr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-4/figs/LRExpr.png -------------------------------------------------------------------------------- /2023/hw-4/figs/LRExprPrec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-4/figs/LRExprPrec.png -------------------------------------------------------------------------------- /2023/hw-4/hw4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-4/hw4.pdf -------------------------------------------------------------------------------- /2023/hw-4/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2023/hw-4/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2023/hw-5/README.md: -------------------------------------------------------------------------------- 1 | # hw5 2 | 3 | 第一题的第二个文法**不表示**`包含相同数量的a/b构成的串` 4 | 5 | [这里有一个备选](https://cs.stackexchange.com/questions/64569/unambiguous-grammar-that-produce-equal-number-of-a-and-b),不过我还没有仔细验证 -------------------------------------------------------------------------------- /2023/hw-5/cfg/cfg-a-b-lang.tex: -------------------------------------------------------------------------------- 1 | % cfg-a-b-lang.tex 2 | 3 | \setcounter{equation}{0} 4 | \begin{align} 5 | S &\to aAbS \mid bBaS \mid \epsilon \\[8pt] 6 | A &\to aAb \mid \epsilon \\[8pt] 7 | B &\to bBa \mid \epsilon 8 | \end{align} -------------------------------------------------------------------------------- /2023/hw-5/cfg/cfg-equal-number-a-b.tex: -------------------------------------------------------------------------------- 1 | % cfg-equal-number-a-b.tex 2 | 3 | \setcounter{equation}{0} 4 | \begin{align*} 5 | V \to aVbV \mid bVaV \mid \epsilon 6 | \end{align*} -------------------------------------------------------------------------------- /2023/hw-5/figs/climbing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-5/figs/climbing.png -------------------------------------------------------------------------------- /2023/hw-5/hw5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-5/hw5.pdf -------------------------------------------------------------------------------- /2023/hw-5/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2023/hw-5/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2023/hw-6/README.md: -------------------------------------------------------------------------------- 1 | # hw5 2 | 3 | 第一题的第二个文法**不表示**`包含相同数量的a/b构成的串` 4 | 5 | [这里有一个备选](https://cs.stackexchange.com/questions/64569/unambiguous-grammar-that-produce-equal-number-of-a-and-b),不过我还没有仔细验证 -------------------------------------------------------------------------------- /2023/hw-6/figs/not-easy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-6/figs/not-easy.jpg -------------------------------------------------------------------------------- /2023/hw-6/hw6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-6/hw6.pdf -------------------------------------------------------------------------------- /2023/hw-6/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2023/hw-6/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2023/hw-7/README.md: -------------------------------------------------------------------------------- 1 | # hw5 2 | 3 | 第一题的第二个文法**不表示**`包含相同数量的a/b构成的串` 4 | 5 | [这里有一个备选](https://cs.stackexchange.com/questions/64569/unambiguous-grammar-that-produce-equal-number-of-a-and-b),不过我还没有仔细验证 -------------------------------------------------------------------------------- /2023/hw-7/figs/knuth-paper-1967.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-7/figs/knuth-paper-1967.png -------------------------------------------------------------------------------- /2023/hw-7/hw7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-7/hw7.pdf -------------------------------------------------------------------------------- /2023/hw-7/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2023/hw-7/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2023/hw-8/README.md: -------------------------------------------------------------------------------- 1 | # hw5 2 | 3 | 第一题的第二个文法**不表示**`包含相同数量的a/b构成的串` 4 | 5 | [这里有一个备选](https://cs.stackexchange.com/questions/64569/unambiguous-grammar-that-produce-equal-number-of-a-and-b),不过我还没有仔细验证 -------------------------------------------------------------------------------- /2023/hw-8/figs/LLVM-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-8/figs/LLVM-logo.png -------------------------------------------------------------------------------- /2023/hw-8/hw8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/hw-8/hw8.pdf -------------------------------------------------------------------------------- /2023/hw-8/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2023/hw-8/tufte-preamble.tex: -------------------------------------------------------------------------------- 1 | % \geometry{showframe}% for debugging purposes -- displays the margins 2 | 3 | % Set up the images/graphics package 4 | \usepackage{graphicx} 5 | \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} 6 | % \graphicspath{{figs/}} 7 | 8 | % The following package makes prettier tables. We're all about the bling! 9 | \usepackage{booktabs} 10 | 11 | % The units package provides nice, non-stacked fractions and better spacing for units. 12 | \usepackage{units} 13 | 14 | % Small sections of multiple columns 15 | \usepackage{multicol} 16 | 17 | % Provides paragraphs of dummy text 18 | \usepackage{lipsum} 19 | 20 | % These commands are used to pretty-print LaTeX commands 21 | \newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically 22 | \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument 23 | \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument 24 | \newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment 25 | \newcommand{\docenv}[1]{\textsf{#1}}% environment name 26 | \newcommand{\docpkg}[1]{\texttt{#1}}% package name 27 | \newcommand{\doccls}[1]{\texttt{#1}}% document class name 28 | \newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name 29 | -------------------------------------------------------------------------------- /2023/zip/hw-0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/zip/hw-0.zip -------------------------------------------------------------------------------- /2023/zip/hw-1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/zip/hw-1.zip -------------------------------------------------------------------------------- /2023/zip/hw-2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/zip/hw-2.zip -------------------------------------------------------------------------------- /2023/zip/hw-3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/zip/hw-3.zip -------------------------------------------------------------------------------- /2023/zip/hw-4.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/zip/hw-4.zip -------------------------------------------------------------------------------- /2023/zip/hw-5.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/zip/hw-5.zip -------------------------------------------------------------------------------- /2023/zip/hw-6.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/zip/hw-6.zip -------------------------------------------------------------------------------- /2023/zip/hw-7.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/zip/hw-7.zip -------------------------------------------------------------------------------- /2023/zip/hw-8.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2023/zip/hw-8.zip -------------------------------------------------------------------------------- /2024/README.md: -------------------------------------------------------------------------------- 1 | # 2024 Spring -------------------------------------------------------------------------------- /2024/problem-set/hw-0/README.md: -------------------------------------------------------------------------------- 1 | # README.md -------------------------------------------------------------------------------- /2024/problem-set/hw-0/figs/abstraction.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-0/figs/abstraction.jpg -------------------------------------------------------------------------------- /2024/problem-set/hw-0/hw0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-0/hw0.pdf -------------------------------------------------------------------------------- /2024/problem-set/hw-0/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2024/problem-set/hw-1/README.md: -------------------------------------------------------------------------------- 1 | # README.md -------------------------------------------------------------------------------- /2024/problem-set/hw-1/figs/lexing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-1/figs/lexing.png -------------------------------------------------------------------------------- /2024/problem-set/hw-1/hw1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-1/hw1.pdf -------------------------------------------------------------------------------- /2024/problem-set/hw-1/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2024/problem-set/hw-2/Kleene Algorithm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-2/Kleene Algorithm.pdf -------------------------------------------------------------------------------- /2024/problem-set/hw-2/README.md: -------------------------------------------------------------------------------- 1 | # README.md -------------------------------------------------------------------------------- /2024/problem-set/hw-2/figs/android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-2/figs/android.png -------------------------------------------------------------------------------- /2024/problem-set/hw-2/figs/automata-quote.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-2/figs/automata-quote.jpg -------------------------------------------------------------------------------- /2024/problem-set/hw-2/figs/book-learn-re.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-2/figs/book-learn-re.jpg -------------------------------------------------------------------------------- /2024/problem-set/hw-2/figs/design-patterns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-2/figs/design-patterns.png -------------------------------------------------------------------------------- /2024/problem-set/hw-2/figs/fat-mat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-2/figs/fat-mat.png -------------------------------------------------------------------------------- /2024/problem-set/hw-2/figs/regex-quote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-2/figs/regex-quote.png -------------------------------------------------------------------------------- /2024/problem-set/hw-2/hw2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-2/hw2.pdf -------------------------------------------------------------------------------- /2024/problem-set/hw-2/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2024/problem-set/hw-3/README.md: -------------------------------------------------------------------------------- 1 | # hw4 2 | 3 | 第一题的第二个文法**不表示**`包含相同数量的a/b构成的串` 4 | 5 | [这里有一个备选](https://cs.stackexchange.com/questions/64569/unambiguous-grammar-that-produce-equal-number-of-a-and-b),不过我还没有仔细验证 -------------------------------------------------------------------------------- /2024/problem-set/hw-3/cfg/cfg-a-b-lang.tex: -------------------------------------------------------------------------------- 1 | % cfg-a-b-lang.tex 2 | 3 | \setcounter{equation}{0} 4 | \begin{align} 5 | S &\to aAbS \mid bBaS \mid \epsilon \\[8pt] 6 | A &\to aAb \mid \epsilon \\[8pt] 7 | B &\to bBa \mid \epsilon 8 | \end{align} -------------------------------------------------------------------------------- /2024/problem-set/hw-3/cfg/cfg-equal-number-a-b-correct.tex: -------------------------------------------------------------------------------- 1 | % cfg-equal-number-a-b-correct.tex 2 | 3 | \begin{align*} 4 | V \to VV \mid aVb \mid bVa \mid \epsilon 5 | \end{align*} -------------------------------------------------------------------------------- /2024/problem-set/hw-3/cfg/cfg-equal-number-a-b.tex: -------------------------------------------------------------------------------- 1 | % cfg-equal-number-a-b.tex 2 | 3 | \setcounter{equation}{0} 4 | \begin{align*} 5 | V \to aVbV \mid bVaV \mid \epsilon 6 | \end{align*} -------------------------------------------------------------------------------- /2024/problem-set/hw-3/cfg/cfg-unequal-number-a-b.tex: -------------------------------------------------------------------------------- 1 | % cfg-unequal-number-a-b.tex 2 | 3 | \setcounter{equation}{0} 4 | \begin{align} 5 | S &\to T \mid U \\[8pt] 6 | T &\to VaT \mid VaV \\[8pt] 7 | U &\to VbU \mid VbV \\[8pt] 8 | V &\to aVbV \mid bVaV \mid \epsilon 9 | \end{align} -------------------------------------------------------------------------------- /2024/problem-set/hw-3/figs/LRExprPrec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-3/figs/LRExprPrec.png -------------------------------------------------------------------------------- /2024/problem-set/hw-3/figs/ifstat-g4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-3/figs/ifstat-g4.png -------------------------------------------------------------------------------- /2024/problem-set/hw-3/figs/ifstat-open-matched-g4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-3/figs/ifstat-open-matched-g4.png -------------------------------------------------------------------------------- /2024/problem-set/hw-3/figs/pumping-lemma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-3/figs/pumping-lemma.png -------------------------------------------------------------------------------- /2024/problem-set/hw-3/figs/pumping-lemma.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-3/figs/pumping-lemma.webp -------------------------------------------------------------------------------- /2024/problem-set/hw-3/hw3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-3/hw3.pdf -------------------------------------------------------------------------------- /2024/problem-set/hw-3/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2024/problem-set/hw-4/README.md: -------------------------------------------------------------------------------- 1 | # hw4 2 | 3 | 第一题的第二个文法**不表示**`包含相同数量的a/b构成的串` 4 | 5 | [这里有一个备选](https://cs.stackexchange.com/questions/64569/unambiguous-grammar-that-produce-equal-number-of-a-and-b),不过我还没有仔细验证 -------------------------------------------------------------------------------- /2024/problem-set/hw-4/cfg/decl.tex: -------------------------------------------------------------------------------- 1 | % decl.tex 2 | 3 | \begin{align*} 4 | D' &\to D \\ 5 | D &\to D\;((\;) \;\mid\; [\;]) \;\mid\; *\;D \;\mid\; (D) \;\mid\; \idkw 6 | \end{align*} -------------------------------------------------------------------------------- /2024/problem-set/hw-4/figs/climbing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-4/figs/climbing.png -------------------------------------------------------------------------------- /2024/problem-set/hw-4/hw4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-4/hw4.pdf -------------------------------------------------------------------------------- /2024/problem-set/hw-4/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2024/problem-set/hw-5/README.md: -------------------------------------------------------------------------------- 1 | # hw5 2 | -------------------------------------------------------------------------------- /2024/problem-set/hw-5/figs/D-parse-tree-array.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-5/figs/D-parse-tree-array.png -------------------------------------------------------------------------------- /2024/problem-set/hw-5/figs/D-parse-tree-func.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-5/figs/D-parse-tree-func.png -------------------------------------------------------------------------------- /2024/problem-set/hw-5/figs/D-parse-tree-pointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-5/figs/D-parse-tree-pointer.png -------------------------------------------------------------------------------- /2024/problem-set/hw-5/figs/knuth-paper-1967.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-5/figs/knuth-paper-1967.png -------------------------------------------------------------------------------- /2024/problem-set/hw-5/grammar/decl-ag.tex: -------------------------------------------------------------------------------- 1 | % decl-ll.tex 2 | 3 | \setcounter{equation}{0} 4 | \begin{align} 5 | D &\to D\;(\;) \\ 6 | D &\to D\;[\;] \\ 7 | D &\to *\;D \\ 8 | D &\to (D) \\ 9 | D &\to \idkw 10 | \end{align} -------------------------------------------------------------------------------- /2024/problem-set/hw-5/hw5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-5/hw5.pdf -------------------------------------------------------------------------------- /2024/problem-set/hw-5/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2024/problem-set/hw-6/README.md: -------------------------------------------------------------------------------- 1 | # hw5 2 | -------------------------------------------------------------------------------- /2024/problem-set/hw-6/figs/while.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-6/figs/while.pdf -------------------------------------------------------------------------------- /2024/problem-set/hw-6/hw6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-6/hw6.pdf -------------------------------------------------------------------------------- /2024/problem-set/hw-6/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2024/problem-set/hw-7/README.md: -------------------------------------------------------------------------------- 1 | # hw7 2 | -------------------------------------------------------------------------------- /2024/problem-set/hw-7/figs/fib-rec-25-blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-7/figs/fib-rec-25-blank.png -------------------------------------------------------------------------------- /2024/problem-set/hw-7/figs/fib-rec-25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-7/figs/fib-rec-25.png -------------------------------------------------------------------------------- /2024/problem-set/hw-7/figs/fib-rec-49-blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-7/figs/fib-rec-49-blank.png -------------------------------------------------------------------------------- /2024/problem-set/hw-7/figs/fib-rec-49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-7/figs/fib-rec-49.png -------------------------------------------------------------------------------- /2024/problem-set/hw-7/figs/fib-rec-c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-7/figs/fib-rec-c.png -------------------------------------------------------------------------------- /2024/problem-set/hw-7/figs/fib-rec-wrong-23-blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-7/figs/fib-rec-wrong-23-blank.png -------------------------------------------------------------------------------- /2024/problem-set/hw-7/figs/fib-rec-wrong-23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-7/figs/fib-rec-wrong-23.png -------------------------------------------------------------------------------- /2024/problem-set/hw-7/figs/fib-rec-wrong-46-blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-7/figs/fib-rec-wrong-46-blank.png -------------------------------------------------------------------------------- /2024/problem-set/hw-7/figs/fib-rec-wrong-46.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-7/figs/fib-rec-wrong-46.png -------------------------------------------------------------------------------- /2024/problem-set/hw-7/figs/fib-rec-wrong-fib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-7/figs/fib-rec-wrong-fib.png -------------------------------------------------------------------------------- /2024/problem-set/hw-7/figs/fib-rec-wrong-main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-7/figs/fib-rec-wrong-main.png -------------------------------------------------------------------------------- /2024/problem-set/hw-7/figs/fig-fib-rec-wrong.tex: -------------------------------------------------------------------------------- 1 | % fig-fib-rec-wrong.tex 2 | 3 | \begin{figure}[h] 4 | \centering 5 | \begin{subfigure}[c]{0.46\textwidth} 6 | \centering 7 | \includegraphics[width = 1.00\textwidth]{figs/fib-rec-wrong-23-blank.png} 8 | \includegraphics[width = 1.00\textwidth]{figs/fib-rec-wrong-46-blank.png} 9 | \end{subfigure} 10 | \hfill 11 | \begin{subfigure}[c]{0.46\textwidth} 12 | \centering 13 | \includegraphics[width = 1.00\textwidth]{figs/fib-rec-25.png} 14 | \includegraphics[width = 1.00\textwidth]{figs/fib-rec-49.png} 15 | \end{subfigure} 16 | \end{figure} 17 | -------------------------------------------------------------------------------- /2024/problem-set/hw-7/hw7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-7/hw7.pdf -------------------------------------------------------------------------------- /2024/problem-set/hw-7/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2024/problem-set/hw-8/README.md: -------------------------------------------------------------------------------- 1 | # hw8 2 | -------------------------------------------------------------------------------- /2024/problem-set/hw-8/figs/cfg-hierarchy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-8/figs/cfg-hierarchy.png -------------------------------------------------------------------------------- /2024/problem-set/hw-8/figs/parsing.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-8/figs/parsing.jpeg -------------------------------------------------------------------------------- /2024/problem-set/hw-8/grammar/lr.tex: -------------------------------------------------------------------------------- 1 | % decl-lr.tex 2 | 3 | \setcounter{equation}{-1} 4 | \begin{align} 5 | S' &\to S \\ 6 | S &\to (\;L\;) \\ 7 | S &\to x \\ 8 | L &\to S \\ 9 | L &\to L \;,\; S 10 | \end{align} -------------------------------------------------------------------------------- /2024/problem-set/hw-8/hw8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-8/hw8.pdf -------------------------------------------------------------------------------- /2024/problem-set/hw-8/table/slr.tex: -------------------------------------------------------------------------------- 1 | % slr.tex 2 | 3 | % \usepackage{multirow} 4 | % \usepackage{graphicx} 5 | \begin{table}[h] 6 | \centering 7 | \resizebox{0.60\textwidth}{!}{% 8 | \begin{tabular}{|c|c|c|c|c|c||c|c|c|} 9 | \hline 10 | \multirow{2}{*}{State} & \multicolumn{5}{c||}{\textsc{Action}} 11 | & \multicolumn{2}{c|}{\textsc{Goto}} 12 | \\ \cline{2-8} 13 | & $($ & $)$ & $x$ & $,$ & $\$$ & $S$ & $L$ 14 | \\ \hline \hline 15 | 0 & & & & & & & \\ \hline 16 | 1 & & & & & & & \\ \hline 17 | 2 & & & & & & & \\ \hline 18 | 3 & & & & & & & \\ \hline 19 | 4 & & & & & & & \\ \hline 20 | 5 & & & & & & & \\ \hline 21 | 6 & & & & & & & \\ \hline 22 | 7 & & & & & & & \\ \hline 23 | 8 & & & & & & & \\ \hline 24 | \end{tabular}% 25 | } 26 | \end{table} -------------------------------------------------------------------------------- /2024/problem-set/hw-8/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2024/problem-set/hw-9/README.md: -------------------------------------------------------------------------------- 1 | # hw9 2 | -------------------------------------------------------------------------------- /2024/problem-set/hw-9/algs/exam.tex: -------------------------------------------------------------------------------- 1 | % exam.tex 2 | 3 | \begin{algorithm}[H] 4 | \begin{algorithmic}[1] 5 | \Procedure{AreYouOK}{\text{score}, \text{exam}} 6 | \If{!(\text{exam})} 7 | \While{\text{true}} 8 | \State $\text{mood} \gets 666$ 9 | \State \text{\bf print} $\text{mood}$ 10 | \EndWhile 11 | \ElsIf{$\text{score} \ge 60$} 12 | \State $\text{mood} \gets 2333$ 13 | \State \text{\bf print} $\text{mood}$ 14 | \Else 15 | \State $\text{mood} \gets 555$ 16 | \State \text{\bf print} $\text{mood}$ 17 | \EndIf 18 | \EndProcedure 19 | \end{algorithmic} 20 | \end{algorithm} -------------------------------------------------------------------------------- /2024/problem-set/hw-9/hw9.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/hw-9/hw9.pdf -------------------------------------------------------------------------------- /2024/problem-set/hw-9/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2024/problem-set/zip/hw-0-overview.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/zip/hw-0-overview.zip -------------------------------------------------------------------------------- /2024/problem-set/zip/hw-1-lexer.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/zip/hw-1-lexer.zip -------------------------------------------------------------------------------- /2024/problem-set/zip/hw-2-re-automata.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/zip/hw-2-re-automata.zip -------------------------------------------------------------------------------- /2024/problem-set/zip/hw-3-cfg.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/zip/hw-3-cfg.zip -------------------------------------------------------------------------------- /2024/problem-set/zip/hw-4-ll.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/zip/hw-4-ll.zip -------------------------------------------------------------------------------- /2024/problem-set/zip/hw-5-ag.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/zip/hw-5-ag.zip -------------------------------------------------------------------------------- /2024/problem-set/zip/hw-6-ir.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/zip/hw-6-ir.zip -------------------------------------------------------------------------------- /2024/problem-set/zip/hw-7-riscv.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/zip/hw-7-riscv.zip -------------------------------------------------------------------------------- /2024/problem-set/zip/hw-8-lr.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/zip/hw-8-lr.zip -------------------------------------------------------------------------------- /2024/problem-set/zip/hw-9-codegen.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/problem-set/zip/hw-9-codegen.zip -------------------------------------------------------------------------------- /2024/solution/hw-1/README.md: -------------------------------------------------------------------------------- 1 | # README.md -------------------------------------------------------------------------------- /2024/solution/hw-1/figs/lexing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-1/figs/lexing.png -------------------------------------------------------------------------------- /2024/solution/hw-1/hw1-solution.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-1/hw1-solution.pdf -------------------------------------------------------------------------------- /2024/solution/hw-1/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2024/solution/hw-3/cfg/cfg-a-b-lang.tex: -------------------------------------------------------------------------------- 1 | % cfg-a-b-lang.tex 2 | 3 | \setcounter{equation}{0} 4 | \begin{align} 5 | S &\to aAbS \mid bBaS \mid \epsilon \\[8pt] 6 | A &\to aAb \mid \epsilon \\[8pt] 7 | B &\to bBa \mid \epsilon 8 | \end{align} -------------------------------------------------------------------------------- /2024/solution/hw-3/cfg/cfg-equal-number-a-b-correct.tex: -------------------------------------------------------------------------------- 1 | % cfg-equal-number-a-b-correct.tex 2 | 3 | \begin{align*} 4 | V \to VV \mid aVb \mid bVa \mid \epsilon 5 | \end{align*} -------------------------------------------------------------------------------- /2024/solution/hw-3/cfg/cfg-equal-number-a-b.tex: -------------------------------------------------------------------------------- 1 | % cfg-equal-number-a-b.tex 2 | 3 | \setcounter{equation}{0} 4 | \begin{align*} 5 | V \to aVbV \mid bVaV \mid \epsilon 6 | \end{align*} -------------------------------------------------------------------------------- /2024/solution/hw-3/cfg/cfg-unequal-number-a-b.tex: -------------------------------------------------------------------------------- 1 | % cfg-unequal-number-a-b.tex 2 | 3 | \setcounter{equation}{0} 4 | \begin{align} 5 | S &\to T \mid U \\[8pt] 6 | T &\to VaT \mid VaV \\[8pt] 7 | U &\to VbU \mid VbV \\[8pt] 8 | V &\to aVbV \mid bVaV \mid \epsilon 9 | \end{align} -------------------------------------------------------------------------------- /2024/solution/hw-3/figs/LRExprPrec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-3/figs/LRExprPrec.png -------------------------------------------------------------------------------- /2024/solution/hw-3/figs/ifstat-g4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-3/figs/ifstat-g4.png -------------------------------------------------------------------------------- /2024/solution/hw-3/figs/ifstat-open-matched-g4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-3/figs/ifstat-open-matched-g4.png -------------------------------------------------------------------------------- /2024/solution/hw-3/figs/pumping-lemma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-3/figs/pumping-lemma.png -------------------------------------------------------------------------------- /2024/solution/hw-3/figs/pumping-lemma.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-3/figs/pumping-lemma.webp -------------------------------------------------------------------------------- /2024/solution/hw-3/hw-3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-3/hw-3.pdf -------------------------------------------------------------------------------- /2024/solution/hw-3/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2024/solution/hw-5/README.md: -------------------------------------------------------------------------------- 1 | # hw5 2 | -------------------------------------------------------------------------------- /2024/solution/hw-5/figs/D-parse-tree-array.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-5/figs/D-parse-tree-array.png -------------------------------------------------------------------------------- /2024/solution/hw-5/figs/D-parse-tree-func.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-5/figs/D-parse-tree-func.png -------------------------------------------------------------------------------- /2024/solution/hw-5/figs/D-parse-tree-pointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-5/figs/D-parse-tree-pointer.png -------------------------------------------------------------------------------- /2024/solution/hw-5/figs/depth-analysis.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-5/figs/depth-analysis.jpg -------------------------------------------------------------------------------- /2024/solution/hw-5/figs/depth-solution.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-5/figs/depth-solution.jpg -------------------------------------------------------------------------------- /2024/solution/hw-5/figs/knuth-paper-1967.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-5/figs/knuth-paper-1967.png -------------------------------------------------------------------------------- /2024/solution/hw-5/figs/number-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-5/figs/number-1.jpg -------------------------------------------------------------------------------- /2024/solution/hw-5/figs/number-2-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-5/figs/number-2-1.jpg -------------------------------------------------------------------------------- /2024/solution/hw-5/figs/number-2-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-5/figs/number-2-2.jpg -------------------------------------------------------------------------------- /2024/solution/hw-5/grammar/decl-ag-sdt.tex: -------------------------------------------------------------------------------- 1 | % decl-ll.tex 2 | 3 | \setcounter{equation}{0} 4 | \begin{align} 5 | D &\to D\;(\;) \\ 6 | &\qquad \text{\printkw(function returning)} \notag\\ 7 | D &\to D\;[\;] \\ 8 | &\qquad \text{\printkw(array of)} \notag\\ 9 | D &\to *\;D \\ 10 | &\qquad \text{\printkw(pointer to)} \notag\\ 11 | D &\to (D) \\ 12 | &\qquad \text{\printkw()} \notag\\ 13 | D &\to \idkw \\ 14 | &\qquad \text{\printkw(declare \idkw{} as)} \notag 15 | \end{align} -------------------------------------------------------------------------------- /2024/solution/hw-5/grammar/decl-ag.tex: -------------------------------------------------------------------------------- 1 | % decl-ll.tex 2 | 3 | \setcounter{equation}{0} 4 | \begin{align} 5 | D &\to D\;(\;) \\ 6 | D &\to D\;[\;] \\ 7 | D &\to *\;D \\ 8 | D &\to (D) \\ 9 | D &\to \idkw 10 | \end{align} -------------------------------------------------------------------------------- /2024/solution/hw-5/hw5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-5/hw5.pdf -------------------------------------------------------------------------------- /2024/solution/hw-5/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2024/solution/hw-7/README.md: -------------------------------------------------------------------------------- 1 | # hw7 2 | -------------------------------------------------------------------------------- /2024/solution/hw-7/figs/fib-rec-25-blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-7/figs/fib-rec-25-blank.png -------------------------------------------------------------------------------- /2024/solution/hw-7/figs/fib-rec-25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-7/figs/fib-rec-25.png -------------------------------------------------------------------------------- /2024/solution/hw-7/figs/fib-rec-49-blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-7/figs/fib-rec-49-blank.png -------------------------------------------------------------------------------- /2024/solution/hw-7/figs/fib-rec-49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-7/figs/fib-rec-49.png -------------------------------------------------------------------------------- /2024/solution/hw-7/figs/fib-rec-c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-7/figs/fib-rec-c.png -------------------------------------------------------------------------------- /2024/solution/hw-7/figs/fib-rec-wrong-23-blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-7/figs/fib-rec-wrong-23-blank.png -------------------------------------------------------------------------------- /2024/solution/hw-7/figs/fib-rec-wrong-23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-7/figs/fib-rec-wrong-23.png -------------------------------------------------------------------------------- /2024/solution/hw-7/figs/fib-rec-wrong-46-blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-7/figs/fib-rec-wrong-46-blank.png -------------------------------------------------------------------------------- /2024/solution/hw-7/figs/fib-rec-wrong-46.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-7/figs/fib-rec-wrong-46.png -------------------------------------------------------------------------------- /2024/solution/hw-7/figs/fib-rec-wrong-fib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-7/figs/fib-rec-wrong-fib.png -------------------------------------------------------------------------------- /2024/solution/hw-7/figs/fib-rec-wrong-main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-7/figs/fib-rec-wrong-main.png -------------------------------------------------------------------------------- /2024/solution/hw-7/figs/fig-fib-rec-wrong.tex: -------------------------------------------------------------------------------- 1 | % fig-fib-rec-wrong.tex 2 | 3 | \begin{figure}[h] 4 | \centering 5 | \begin{subfigure}[c]{0.46\textwidth} 6 | \centering 7 | \includegraphics[width = 1.00\textwidth]{figs/fib-rec-wrong-23-blank.png} 8 | \includegraphics[width = 1.00\textwidth]{figs/fib-rec-wrong-46-blank.png} 9 | \end{subfigure} 10 | \hfill 11 | \begin{subfigure}[c]{0.46\textwidth} 12 | \centering 13 | \includegraphics[width = 1.00\textwidth]{figs/fib-rec-25.png} 14 | \includegraphics[width = 1.00\textwidth]{figs/fib-rec-49.png} 15 | \end{subfigure} 16 | \end{figure} 17 | -------------------------------------------------------------------------------- /2024/solution/hw-7/hw7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-7/hw7.pdf -------------------------------------------------------------------------------- /2024/solution/hw-7/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2024/solution/hw-8/README.md: -------------------------------------------------------------------------------- 1 | # hw8 2 | -------------------------------------------------------------------------------- /2024/solution/hw-8/figs/cfg-hierarchy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-8/figs/cfg-hierarchy.png -------------------------------------------------------------------------------- /2024/solution/hw-8/figs/parsing.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-8/figs/parsing.jpeg -------------------------------------------------------------------------------- /2024/solution/hw-8/figs/slr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-8/figs/slr.png -------------------------------------------------------------------------------- /2024/solution/hw-8/grammar/ll1-not-slr.tex: -------------------------------------------------------------------------------- 1 | % ll1-not-slr.tex 2 | 3 | \begin{align*} 4 | S &\to AaAb \\ 5 | S &\to BbBa \\ 6 | A &\to \epsilon \\ 7 | B &\to \epsilon 8 | \end{align*} -------------------------------------------------------------------------------- /2024/solution/hw-8/grammar/lr.tex: -------------------------------------------------------------------------------- 1 | % decl-lr.tex 2 | 3 | \setcounter{equation}{-1} 4 | \begin{align} 5 | S' &\to S \\ 6 | S &\to (\;L\;) \\ 7 | S &\to x \\ 8 | L &\to S \\ 9 | L &\to L \;,\; S 10 | \end{align} -------------------------------------------------------------------------------- /2024/solution/hw-8/grammar/slr.jff: -------------------------------------------------------------------------------- 1 | 2 | grammar 3 | 4 | 5 | S 6 | (L) 7 | 8 | 9 | S 10 | x 11 | 12 | 13 | L 14 | S 15 | 16 | 17 | L 18 | L,S 19 | 20 | -------------------------------------------------------------------------------- /2024/solution/hw-8/hw8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/hw-8/hw8.pdf -------------------------------------------------------------------------------- /2024/solution/hw-8/table/slr.tex: -------------------------------------------------------------------------------- 1 | % slr.tex 2 | 3 | % \usepackage{multirow} 4 | % \usepackage{graphicx} 5 | \begin{table}[h] 6 | \centering 7 | \resizebox{0.60\textwidth}{!}{% 8 | \begin{tabular}{|c|c|c|c|c|c||c|c|c|} 9 | \hline 10 | \multirow{2}{*}{State} & \multicolumn{5}{c||}{\textsc{Action}} 11 | & \multicolumn{2}{c|}{\textsc{Goto}} 12 | \\ \cline{2-8} 13 | & $($ & $)$ & $x$ & $,$ & $\$$ & $S$ & $L$ 14 | \\ \hline \hline 15 | 0 & & & & & & & \\ \hline 16 | 1 & & & & & & & \\ \hline 17 | 2 & & & & & & & \\ \hline 18 | 3 & & & & & & & \\ \hline 19 | 4 & & & & & & & \\ \hline 20 | 5 & & & & & & & \\ \hline 21 | 6 & & & & & & & \\ \hline 22 | 7 & & & & & & & \\ \hline 23 | 8 & & & & & & & \\ \hline 24 | \end{tabular}% 25 | } 26 | \end{table} -------------------------------------------------------------------------------- /2024/solution/hw-8/tufte-handout.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 | 3 | \ProvidesClass{tufte-handout}[2009/12/11 v3.5.0 Tufte-handout class] 4 | 5 | %% 6 | % Declare we're tufte-handout 7 | \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style) 8 | \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout) 9 | 10 | %% 11 | % Load the common style elements 12 | \input{tufte-common.def} 13 | 14 | 15 | %% 16 | % Set up any handout-specific stuff now 17 | 18 | %% 19 | % Abstract 20 | 21 | % TODO The abstract should be printed on its own page of the `titlepage' 22 | % option was specified. 23 | \renewenvironment{abstract} 24 | {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi} 25 | {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}} 26 | 27 | 28 | %% 29 | % If there is a `tufte-handout-local.tex' file, load it. 30 | 31 | \IfFileExists{tufte-handout-local.tex} 32 | {\input{tufte-handout-local} 33 | \TufteInfoNL{Loading tufte-handout-local.tex}} 34 | {} 35 | 36 | 37 | %% 38 | % End of file 39 | \endinput 40 | -------------------------------------------------------------------------------- /2024/solution/zip/hw-1-lexer-solution.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/2024/solution/zip/hw-1-lexer-solution.zip -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 hengxin(Hengfeng Wei) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # compilers-problem-set 2 | 3 | Problem Set for Course [Compilers@software.nju.edu](https://github.com/orgs/courses-at-nju-by-hfwei/teams/compilers-course-at-nju-software/repositories) 4 | 5 | ## 作业 6 | 7 | - [2024](2024/) 8 | - [2023](2023/) 9 | - [2022](2022/) 10 | - [2021](2021/) 11 | - [2020](2020/) 12 | 13 | ## 如何写作业 14 | - 习题使用 LaTeX `tufte-handout` 模板, 所以也推荐大家使用 LaTeX 写作业。 15 | 仅需要修改 `hw0.tex`, 并使用 `xelatex` 编译。 16 | LaTeX 使用方法见 `tools/` 文件夹。大家可以尝试 https://www.overleaf.com/ 在线 LaTeX 编辑器。 17 | - 如果不喜欢 LaTeX, 也可以用其它工具。比如 `word`, `.md` (https://stackedit.io/) 等。 18 | - 也可以使用传统的手工艺: 手写、拍照。 19 | 20 | ## 如何提交作业 21 | - 请通过"教学立方"提交作业 22 | - 不论大家使用什么工具, 最终需要提交一份单独的 `.pdf` 文件 23 | - 文件名命名: 作业编号-学号-姓名.pdf -------------------------------------------------------------------------------- /tools/README.md: -------------------------------------------------------------------------------- 1 | # tools 2 | 3 | - [LaTreeX: LaTeX-based tree generator](https://lautgesetz.com/latreex/) -------------------------------------------------------------------------------- /tools/algorithmicx.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/tools/algorithmicx.pdf -------------------------------------------------------------------------------- /tools/lshort-zh-cn.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/tools/lshort-zh-cn.pdf -------------------------------------------------------------------------------- /tools/tikz-automata.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/tools/tikz-automata.pdf -------------------------------------------------------------------------------- /tools/tufte-handout.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/courses-at-nju-by-hfwei/compilers-problem-set/a36130eea2064847b4cb7aa8df69e624bb8394b9/tools/tufte-handout.pdf --------------------------------------------------------------------------------