Institute of Computer Science
  1. Courses
  2. 2017/18 spring
  3. Automata, Languages and Compilers (LTAT.03.006)
ET
Log in

Automata, Languages and Compilers 2017/18 spring

  • Üldinfo
  1. Õppekorraldus
  2. Eksam
  3. Reeglid
  4. Töövahendid
  5. Projekt
  • Kava
  1. Soojendus
  2. Regulaaravaldised
  3. Olekumasinad
  4. Lõplikud automaadid
  5. Avaldise struktuur
  6. Grammatikad ja lekser
  7. Käsitsi parsimine
  8. ANTLR intro
  9. AST loomine
  10. Interpretaator
  11. Semantiline analüüs
  12. Kompilaator
  • Moodle
  • Bitbucket
  • Fleep!

ANTLR-i IDE plugina paigaldamine

ANTLR-it on kõige mugavam kasutada mõne IDE plugina kujul. Õnneks on vastav plugin olemas kõigi populaarsete Java IDE-de jaoks.

IntelliJ

Vali "File" menüüst "Settings", siis "IDE Settings" osast "Plugins", klõpsa nuppu "Browser repositories" ja vali "ANTLR v4 grammar plugin". Klõpsa install ja taaskäivita IDE.

Täpsem info siit: https://github.com/antlr/intellij-plugin-v4

Eclipse

Plugina koduleht on siin: https://github.com/jknack/antlr4ide.

  1. Installi Xtext. Kuna ANTLR plugin ei tööta Xtexti viimase versiooniga, siis lae alla http://www.eclipse.org/downloads/download.php?file=/modeling/tmf/xtext/downloads/drops/2.7.3/R201411190455/tmf-xtext-Update-2.7.3.zip, vali Eclipse'is Help => Install new software => Add ... (nupp dialoogi üleval-paremal nurgas) => Archive => vali allalaetud zip fail => märgi installeerimiseks "Xtext" ja lase Eclipse'il installida. Kui Eclipse nõuab restarti, siis lase see tal teha
  2. Installi ANTLR-i plugin (vt https://github.com/jknack/antlr4ide#installation)

Paigalduse kontrollimine

Kontrollimaks kas plugina installimine õnnestus, loo mingi Java projekti alla fail nimega Avaldis.g4, ava see ning kopeeri sinna järgnev tekst:

grammar Avaldis;

avaldis
    :   avaldis '+' term
    |   avaldis '-' term
    |   term
    ;

term
    :   term '*' faktor
    |   term '/' faktor
    |   faktor
    ;

faktor
    :   '(' avaldis ')'
    |   Muutuja
    |   Konstant
    ;

Muutuja
    :   [a-zA-Z_][a-zA-Z_0-9]*
    ;

Konstant
    :    [0-9]|[1-9][0-9]+
    ;

Kui editor näitab seda teksti värviliselt, siis on tõenäoliselt paigaldus õnnestunud.

  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment