Description: Compiler theory lexical analysis experiment
First, the purpose of the experiment :
Design prepared by commissioning a specific lexical analysis program to deepen the understanding of the principles of lexical analysis . And mastery of the programming language source code scanning process will be broken down into various types of word lexical analysis methods .
Second, experimental content
Preparation of an ability to analyze integer, decimal , string, identifier , separator, lexical analysis program operators and keywords. At the same time to be able to filter line comments and block comments.
Third, the experimental requirements
A lexical rules
Keywords : if, then, else, while, do, int, float, string, begin, end
Words Category : 1
Identifier: beginning with the letter alphanumeric string .
Word category: 2
Integer: numeric string .
Words Category : 3
Decimal : numeric string • string of digits
Words Category : 4
String: a pair of " " text string enclosed
To Search:
File list (Check if you may need any files):
CP_test_1\CP_test_1\a.txt
.........\.........\Compiler.cpp
.........\.........\CP_test_1.vcxproj
.........\.........\CP_test_1.vcxproj.filters
.........\.........\Debug\2.obj
.........\.........\.....\CL.read.1.tlog
.........\.........\.....\CL.write.1.tlog
.........\.........\.....\Compiler.obj
.........\.........\.....\Compiler1.obj
.........\.........\.....\CP_test_1.lastbuildstate
.........\.........\.....\CP_test_1.log
.........\.........\.....\..........tlog\CL.read.1.tlog
.........\.........\.....\..............\CL.write.1.tlog
.........\.........\.....\..............\CP_test_1.lastbuildstate
.........\.........\.....\..............\link.read.1.tlog
.........\.........\.....\..............\link.write.1.tlog
.........\.........\.....\link-cvtres.read.1.tlog
.........\.........\.....\link-cvtres.write.1.tlog
.........\.........\.....\link-rc.read.1.tlog
.........\.........\.....\link-rc.write.1.tlog
.........\.........\.....\link.1268-cvtres.read.1.tlog
.........\.........\.....\link.1268-cvtres.write.1.tlog
.........\.........\.....\link.1268-rc.read.1.tlog
.........\.........\.....\link.1268-rc.write.1.tlog
.........\.........\.....\link.1268.read.1.tlog
.........\.........\.....\link.1268.write.1.tlog
.........\.........\.....\link.2068-cvtres.read.1.tlog
.........\.........\.....\link.2068-cvtres.write.1.tlog
.........\.........\.....\link.2068-rc.read.1.tlog
.........\.........\.....\link.2068-rc.write.1.tlog
.........\.........\.....\link.2068.read.1.tlog
.........\.........\.....\link.2068.write.1.tlog
.........\.........\.....\link.2220-cvtres.read.1.tlog
.........\.........\.....\link.2220-cvtres.write.1.tlog
.........\.........\.....\link.2220-rc.read.1.tlog
.........\.........\.....\link.2220-rc.write.1.tlog
.........\.........\.....\link.2220.read.1.tlog
.........\.........\.....\link.2220.write.1.tlog
.........\.........\.....\link.2572-cvtres.read.1.tlog
.........\.........\.....\link.2572-cvtres.write.1.tlog
.........\.........\.....\link.2572-rc.read.1.tlog
.........\.........\.....\link.2572-rc.write.1.tlog
.........\.........\.....\link.2572.read.1.tlog
.........\.........\.....\link.2572.write.1.tlog
.........\.........\.....\link.3172-cvtres.read.1.tlog
.........\.........\.....\link.3172-cvtres.write.1.tlog
.........\.........\.....\link.3172-rc.read.1.tlog
.........\.........\.....\link.3172-rc.write.1.tlog
.........\.........\.....\link.3172.read.1.tlog
.........\.........\.....\link.3172.write.1.tlog
.........\.........\.....\link.3316-cvtres.read.1.tlog
.........\.........\.....\link.3316-cvtres.write.1.tlog
.........\.........\.....\link.3316-rc.read.1.tlog
.........\.........\.....\link.3316-rc.write.1.tlog
.........\.........\.....\link.3316.read.1.tlog
.........\.........\.....\link.3316.write.1.tlog
.........\.........\.....\link.360-cvtres.read.1.tlog
.........\.........\.....\link.360-cvtres.write.1.tlog
.........\.........\.....\link.360-rc.read.1.tlog
.........\.........\.....\link.360-rc.write.1.tlog
.........\.........\.....\link.360.read.1.tlog
.........\.........\.....\link.360.write.1.tlog
.........\.........\.....\link.4656-cvtres.read.1.tlog
.........\.........\.....\link.4656-cvtres.write.1.tlog
.........\.........\.....\link.4656-rc.read.1.tlog
.........\.........\.....\link.4656-rc.write.1.tlog
.........\.........\.....\link.4656.read.1.tlog
.........\.........\.....\link.4656.write.1.tlog
.........\.........\.....\link.5260-cvtres.read.1.tlog
.........\.........\.....\link.5260-cvtres.write.1.tlog
.........\.........\.....\link.5260-rc.read.1.tlog
.........\.........\.....\link.5260-rc.write.1.tlog
.........\.........\.....\link.5260.read.1.tlog
.........\.........\.....\link.5260.write.1.tlog
.........\.........\.....\link.6196-cvtres.read.1.tlog
.........\.........\.....\link.6196-cvtres.write.1.tlog
.........\.........\.....\link.6196-rc.read.1.tlog
.........\.........\.....\link.6196-rc.write.1.tlog
.........\.........\.....\link.6196.read.1.tlog
.........\.........\.....\link.6196.write.1.tlog
.........\.........\.....\link.6284-cvtres.read.1.tlog
.........\.....