Beruflich Dokumente
Kultur Dokumente
1. OBJECTIVE
The objectives of Lab 1 are (1) to play with the Ocamllex/Ocamlyacc & ECLIPSE IDE
tool; (2) to construct a simple lexer with few regular expressions (REs) using
Ocamllex/Ocamlyacc.
2. INTRODUCTION
Ocamllex/Ocamlyacc is a powerful tool for those who want to develop a language
compiler quickly and stably. To download and get more information about
Ocamllex/Ocamlyacc, visit http://caml.inria.fr/pub/docs/manual-ocaml/manual026.html.
3. LAB CONTENTS
http://java.sun.com/javase/downloads/index.jsp
http://www.eclipse.org/downloads/packages/eclipse-classic-352/galileosr2
• Install OcaIDE
Open Eclipse and choose the Eclipse workspace for the first run
Change the current perspective into Ocaml (Window -> Open Perspective -> Other,
choose Ocaml)
4.1 Open text2.txt and point out the difference between two files.
4.2 Now insert this line into lex.mll, after recent added line
Look at the result, what do you think about square brackets (“[]”) and parentheses
(“(|)”)?