P1 P2
Project Description Lexical analyzer
Projet1
P3
Write a compiler for a sufficiently simple language To address the following themes:
1 Lexical analysis
2 Syntactic analysis
3 Semantic analysis
4 Interpretation
5 Virtual Machine Compilation
6 Real machine compilation
The language proposed is a language inspired by the Forth language(We will call it LAC)
P4
P5
Lexemes
1 Identifiers (any character string of at least one
Character, composed using the letters, numbers and symbols of the punctuation). 2 Strings (any character string
Beginning with ” (or” at the beginning of a line), not containing the character “inside and ending with the character. We will be careful that it can be on several lines and therefore contain line breaks.
3 Line comments starting with \ (Or \ at the beginning of the line) and ending at the end of the line.
4 Multi-line comments starting with characters ( (Or (at the beginning of the line) and ending with).
P6
What to do today
1 Define the lexeme type in C.
2 Write a lexical parser from a file containing a text in LAC: 1 Remove comments.
2 Produce a list of lexemes.
We will produce three files:
An analex.h file
An analex.c file
A main file L_AC.c
3 Test on the factorielle.lac file (provided).