Objective: Develop a lexical analyzer (token generator) for the "Pascal" programming language.
Follow these steps to execute the Pascal Lexical Analyzer (Pascal.l file):
-
Generate the lexer code:
lex Pascal.l
-
Compile the lexer code:
gcc lex.yy.c -o lexer -ll
-
Run the lexer:
./lexer
Now, you can analyze Pascal syntax by running the ./lexer
executable and providing input through the terminal by running the syntax line by line and getting the desired output.
Here are the references used while creating the lexical analyzer for "Pascal":
- Stack Overflow: Regular Expression for Comments in Pascal
- TutorialsPoint: Pascal Programming Language
- GNU Pascal: Regular Expressions
- Wikipedia: Lexical Analysis
- Wikipedia: Pascal Programming Language
Feel free to explore these references for more insights into lexical analysis and the Pascal programming language.