1. #include"stdafx.h"
2. #include"LR.h"
3. #include"MLR1.h"
4.
5. #ifdef_DEBUG
6. #undefTHIS_FILE
7. staticcharTHIS_FILE[]=__FILE__;
8. #definenewDEBUG_NEW
9. #endif
10. //----调试部分使用的代码
11. CStringMLR1::GetFirst(inti){
12. if(i<0||i>=GetIdentNum())return"";
13. returnFirstSet5(m_first[i].Fi,m_first[i].flag&2);
14. }
15. CStringMLR1::GetFollow(inti){
16. if(i<0||i>=GetIdentNum())return"";
17. returnFollowSet1(m_first[i].Fo,m_first[i].flag&0x08);
18. }
19. //----构造部分
20. MLR1::MLR1(){
21. }
22. MLR1::~MLR1(){
23. }
24. voidMLR1::ReSet(FILE*pf){
25. //使用文件指针 pf 来重新驱动程序
26. inti;
27. p_file=pf;
28. list_Express.RemoveAll();
29. list_Ident.RemoveAll();
30. for(i=0;i<MAP_SIZE;I++)p
="(char*)m_first+sizeof(s_first)*MAX_IDENT-1;"for(char*bit_map[i]
="0;">=(char*)m_first;p--)
31. *p=0;
32. Lex3();
33. FirstSet6();
34. //FollowSet3();
35. }
36. //----输入分析部分
37. boolMLR1::Lex1(){
38. //截取一个分号段到 tocken 中
39. //功能字符取其负数
40. charch=0;
41. boolend=false;
42. token_len=0;