Source code of Windows XP (NT5)
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.

81 lines
2.2 KiB

  1. %{
  2. /*
  3. FILE: HID.L
  4. DESCR: LEX analyzer for HID.Y
  5. AUTHOR: John Pierce (johnpi)
  6. DATE: 04.18.96
  7. */
  8. #include <windows.h>
  9. #include "hid.h"
  10. extern int yylval;
  11. int yylineno=1;
  12. void yyerror(char*);
  13. %}
  14. %%
  15. [ \t]+ {/* ignore whitespace */ }
  16. ;.*[\n] { /*ignore comments*/ }
  17. [\n] { yylineno++; }
  18. . { /* ignore unkowns */ }
  19. COLLECTION { return COLLECTION; }
  20. END_COLLECTION { return END_COLLECTION; }
  21. INPUT { return INPUT; }
  22. OUTPUT { return OUTPUT; }
  23. FEATURE { return FEATURE; }
  24. USAGE_PAGE { return USAGE_PAGE; }
  25. LOGICAL_MINIMUM { return LOG_MIN; }
  26. LOGICAL_MAXIMUM { return LOG_MAX; }
  27. PHYSICAL_MINIMUM { return PHYS_MIN; }
  28. PHYSICAL_MAXIMUM { return PHYS_MAX; }
  29. UNIT { return UNIT; }
  30. EXPONENT { return EXPONENT; }
  31. REPORT_COUNT { return REPORT_COUNT; }
  32. REPORT_SIZE { return REPORT_SIZE; }
  33. REPORT_ID { return REPORT_ID; }
  34. PUSH { return PUSH; }
  35. POP { return POP; }
  36. SET_DELIMITER[ ](Open) { return OPEN_SET; }
  37. SET_DELIMITER[ ](Close) { return CLOSE_SET; }
  38. USAGE { return USAGE; }
  39. USAGE_MINIMUM { return USAGE_MIN; }
  40. USAGE_MAXIMUM { return USAGE_MAX; }
  41. DESIGNATOR_INDEX { return DESIGNATOR_INDEX; }
  42. DESIGNATOR_MINIMUM { return DESIGNATOR_MIN; }
  43. DESIGNATOR_MAXIMUM { return DESIGNATOR_MAX; }
  44. STRING_INDEX { return STRING_INDEX; }
  45. STRING_MINIMUM { return STRING_MIN; }
  46. STRING_MAXIMUM { return STRING_MAX; }
  47. END { return END; }
  48. %%
  49. void yyerror(char *string)
  50. {
  51. char buff[128];
  52. #ifdef CONSOLE
  53. fprintf(stderr,"%s line %d \"%s\"\n",string,yylineno,yytext);
  54. #else
  55. MessageBeep(MB_ICONEXCLAMATION);
  56. wsprintf(buff,"%s line %d \"%s\"\n",string,yylineno,yytext);
  57. MessageBox(NULL,buff,"Parse Results",MB_OK);
  58. #endif
  59. }
  60. int yywrap(void){ return 1; }