C-minus lexical analyzer (rewrite tiny lexical analyzer)
2017-12-13
0 0 0
no vote
Other
Earn points
The design of C-lexical analyzer is rewritten on the basis of the lexical analyzer of tiny compiler. There are many difficulties in practical operation, but I still have a sense of achievement in the end. Because we really use the knowledge we have learned and really understand the lexical analyzer, we should pay attention to many things, such as rewriting the corresponding header file. One thing I have to mention is that when I write comments, because it involves multiple characters / * * /, compared with other lexical units, it is a little difficult to implement. Finally, I use multi-layer case loop. Although the principle is simple, it is a very clever way. In the end, the main code has more than 300 lines, which took a lot of effort to do. Also note that the operators & lt;, & lt; =, & gt;, & gt; =,! =When the second character is' = ', the operator can be successfully recognized. When the second character is other characters, it may also be a legal symbol. Pay attention to character fallback and token judgment.
Related Source Codes
Android AOA Android Open Accessory Development Usi
0
0
no vote
Golang AOA Android Open Accessory HID Control
0
0
no vote
PClite
0
0
no vote
GMSK Linear Receiver
0
0
no vote
The golden version of AFT that has been passed dow
0
0
no vote
No comment