1 / 4

Ziele Heute

Explore the intricacies of compiler design, syntax analysis, and runtime type information in this detailed guide. Learn about regular expressions, data flow analysis, control flow analysis, and more. Practice building parsers and delve into utilizing runtime type information for enhanced programming efficiency. Discover techniques like slicing for variable value tracking. Enhance your knowledge with exercises on parser programming. Compiler tools such as lex/yacc, Eli, and JavaCC are also discussed. Dive into the backend implementation and abstract syntax tree generation with tools like JTB. Delve into class reflection for leveraging runtime type information in Java.

Download Presentation

Ziele Heute

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ziele Heute • Compilerbau Nachlese • Ausnutzung von Laufzeittypinformation

  2. Compilerbau Nachlese • reguläre Ausdrücke: einfach aber ungenau • Compilerbau: • genaue Analyse der Struktur von Texten • Analyse von "statischer" Semantik per Symboltabelle(Cross Reference Table) • Datenflussanalyse: "read-from" Beziehung • Kontrollflulssanalyse: Ausführungsreihenfolgen • Slicing: wer hat hier zum Wert der Variablen X beigetragen? • Übung zu Hause: • Jeder: selber die Parserübungen programmieren • Importe mit Berücksichtigen • if / while / for mit analysieren: wird in jedem Fall ein return ausgeführt?

  3. Compiler Compiler • Compiler / Parser können von Compiler Compilern generiert werdenz.B.: lex/yacc (veraltet), Eli, javacc (Standard für Java) • Back-End in die Grammatik einbauen: • Standard Back-End zur Erzeugung eines abstrakten Syntaxbaumsz.B.: JTB (Java Tree Builder) • Siehe Fujaba JavaParser Plugin

  4. Ausnutzung von Laufzeittypinformation • schreibt Methode ClassFinder.addDotClassToSymbolTable() benutz java.lang.reflect • Class.forName (String) • Class. getDeclaredMethods () • Method.getName () • . . . • Class.getDeclaredFields () • Field.getName() • . . . • Class.getInterfaces () • Class.getSuperClass () • testet im Dobs ClassFinder.addDotClassToSymbolTable ("java.lang.System"), ...

More Related