Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.7 KiB

  1. //
  2. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  3. //
  4. #ifndef SIMC_MODULE_INFO
  5. #define SIMC_MODULE_INFO
  6. /*
  7. * This file contains the SIMCModuleInfoScanner and SIMCModuleInfoParser
  8. * classes, which are light-weight scanners and parsers of a module,
  9. * as opposed to the heavy-weights SIMCScanner and SIMCParser.
  10. * The difference is that the latter are compler scanners and parsers
  11. * of SNMP modules, while the former just parse a module enough to
  12. * get the module name, and the information in the IMPORT section
  13. */
  14. typedef CList<CString, CString&> SIMCStringList;
  15. // The light-weight scanner. This is derived from the ModuleInfo_scan
  16. // that is generated by the MKS LEX utility, from the information in
  17. // the file infoLex.l
  18. class SIMCModuleInfoScanner : public ModuleInfo_scan
  19. {
  20. public:
  21. virtual void ModuleInfoerror(char *,...)
  22. {}
  23. virtual void output(int x)
  24. {}
  25. };
  26. // The light-weight parser. This is derived from the ModuleInfo_parse
  27. // that is generated by the MKS YACC utility, from the information in
  28. // the file infoYacc.y. This parser uses the above scanner
  29. class SIMCModuleInfoParser : public ModuleInfo_parse
  30. {
  31. CString moduleName;
  32. SIMCStringList importModules;
  33. public:
  34. // Parse the module. Once this function is called, the other
  35. // functions make sense.
  36. BOOL GetModuleInfo(SIMCModuleInfoScanner *infoScanner);
  37. const SIMCStringList * GetImportModuleList() const
  38. {
  39. return &importModules;
  40. }
  41. void AddImportModule(CString name)
  42. {
  43. importModules.AddTail(name);
  44. }
  45. CString GetModuleName() const
  46. {
  47. return moduleName;
  48. }
  49. void SetModuleName(const CString& name)
  50. {
  51. moduleName = name;
  52. }
  53. };
  54. #endif