User Tools

Site Tools


en:cours_de_theorie_des_langages

This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

~~TRANS~~ ===== Course on formal languages ===== I teach the part of this course related to the [[wp>Chomsky hierarchy]] and [[wp>parsing]]. The materials of this course are distributed under a the [[https://en.wikipedia.org/wiki/Creative_Commons_license|Creative Commons Attribution Alone licence]] {{:ccby.png?60}} . ==== Slides ==== The slides for my part of the course are available {{:parsing.pdf|here}} (in French). ==== Practical assignment ==== The exercises for the practical assignment (in French) can be downloaded {{:parsing-tp.pdf|here}}. ==== Source code ==== In this course I show a simple interpreter for a language of variable assignments. The variables can either be strings or integer numbers. A program in this language may look as follows: <code> String var1 = "hello world 1 + 2"; int var2 = 1 - (2 + 3); int var3 = 4 + var2; </code> {{:parsing.zip|This}} archive contains the complete source code of the interpreter as well as several example programs. To build the project, run the following commands: <code bash> jflex arith.flex jacc arith.jacc javac ArithEval.java </code> The following command runs just the scanner on the first example: <code bash> java Yylex examples/example1.duck </code> The following command runs the interpreter on the first example: <code bash> java ArithEval examples/example1.duck </code> ==== Toolchain ==== The project relies on [[http://jflex.de/download.html|JFlex]] scanner generator and [[http://web.cecs.pdx.edu/~mpj/jacc/|Jacc]] parser generator. Both tools generate Java code. {{:parsing-workflow.pdf|Here}} is a short overview of a typical workflow. This toolchain was suggested by [[http://lacl.univ-paris12.fr/gava/actuel.htm|Frédéric Gava]] (section Parsing de fichiers en Java). This page also contains other slides about parsing.

en/cours_de_theorie_des_langages.1447697553.txt.gz · Last modified: 2015/11/16 19:12 by sivanov