Rekursiver Abstieg - Zerteiler + Interpretierer Beispiel K. Hug 2010-07-02, 2012-03-01 Quellsprache C++: Type = "class" Typename "{" { DataMemberSection } "}". Zielsprache Eiffel: Type = "class" Typename { FeatureSection } "end". Implementationssprache pascalisch: Type : String: IF symbol = class THEN next Result := "class " ELSE error END Result := Result + Typename IF symbol = openingbrace THEN next ELSE error END WHILE symbol IN {public, protected } DO Result := Result + DataMemberSection END IF symbol = closingbrace THEN next Result := Result + " end" ELSE error END Umgekehrte Richtung: Quellsprache Eiffel: Type = "class" Typename { FeatureSection } "end". Zielsprache C++: Type = "class" Typename "{" { DataMemberSection } "}". Implementationssprache C-ähnlich: void string Type () { string result; if (symbol == class) next; else error; result = "class " + Typename() + " { "; while (symbol == feature) { result += FeatureSection(); } if (symbol == end) next; else error; return result + " }"; }