Compilerbau – Done!

Heute war meine erste Klausur. Compilerbau. Ich würde sagen, dass es “okay” gelaufen ist. Allerdings bedeutet das bei dem Dozenten noch lange nichts. Leider.

Jedenfalls bin ich sehr froh, ich hab danach noch mit den anderen draußen gestanden, über die Klausur geredet und eine Pfeife geraucht. =) Als Belohnung sozusagen. =)

Für alle, die nicht wissen, was man in Compilerbau machen muss, hier mal eine Aufgabe, die ich besonders scheiße finde 😉

Assume the following sequence of a translation scheme

S -> {S1.B := S.B} S1 b a {S.A := S1.A + 1}

S -> a {S1.B := S.B} S1 b {S.A := S1.A + 1}

S -> a {S.A := S.B}

Give an implementation of this sequence (in PASCAL-like notation) using the method ‘recursive descent’. A call of SCANNER(X) can be used to get the next lexical element into the global variable X.