Entraînez-vous et vérifiez vos solutions grâce aux outils

Grammars with attributes and their implementation as smart parsers in ocaml

  • Using the camlp4o "parser" syntax and its automatic translation to ocaml

    1. A simple example (and many refinments): anbn_parser.ml, its translation into pure ocaml: anbn.ml
    2. Arithmetic expressions: expr_parser.ml, expr.ml
    3. Declarations of variables in C: decl_parser.ml, decl.ml
    4. More realistic examples (require extStream.ml)

      1. A stream parser that skip spaces and returns a token (=typed word) stream: token_parser.ml
      2. A translation from Pascal assignments to optimized Ocaml code: assignement_parser.ml
        (requires the previous token_parser)
  • Without camlp4o: Parsers that return the remaining sequence of chars

    A simple example (and many many refinments): anbn.ml
  • The Wizard level: Parser combinators that can deal with ambigous grammars

    A simple ambigous grammar and its simple parser: as_many_as.ml

Automata: infinite languages finetely represented

Student Projects

  • projet 2011 - Implantation d'un gestionnaire de processus à base d'automate (ocaml): multi-threading.ml
  • projet 2010 - Réalisation de l'interface d'un téléphone portable à l'aide d'automate à pile (C)

    Implantation du cas particulier des automates avec mémorisation de l'état de retour: stack-dfa.c
  • projet 2009 - Implantation des automates à espace d'états fini:

    • Deterministic Finite Automata (C): dfa.c
    • Non-Deterministic Finite Automata (C): ndfa.c
Responsable du site : Michaël PÉRIN