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.

99 lines
3.3 KiB

  1. /*------------------------------------------------------------------
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. tnadmin.l generates tnadminl.c (using flex)
  4. vikram ([email protected])
  5. This lex file recognises tokens in the command line and passes it to the
  6. command line parser.(tnadmin.y)
  7. -----------------------------------------------------------------*/
  8. %{
  9. #include <string.h>
  10. #include <stdlib.h>
  11. #include "tnadminy.h"
  12. #define YY_NEVER_INTERACTIVE 1
  13. #define fileno _fileno
  14. #define strdup _strdup
  15. int nMoccur=-1;
  16. char **filelist;
  17. int currentfile=1;
  18. //between yacc and lex
  19. int g_fMessage=0;
  20. int g_fComp=1;
  21. int g_fNormal=1;
  22. char * szCompname=NULL;
  23. %}
  24. %option noyywrap
  25. delim [ \t]
  26. ws {delim}+
  27. letter [A-Za-z\"]
  28. digit [0-9]
  29. digit2 [0-5]
  30. integer {digit}+
  31. time (({integer}:)?[0-5]?[0-9]:)?[0-5]?[0-9]
  32. num123 {digit}{digit}?{digit}?
  33. string {letter}({letter}|{digit})*
  34. message [A-Za-z0-9\\\|\}\{\]\[\+\=\-\_\(\)\*\&\^\%\$\@\!\~\`\;\:\"\'\<\,\>\.\?\/ ]+
  35. ipno ((0|1)?[0-9]|2[0-4])?[0-9]|25[0-5]
  36. ipaddr {ipno}\.{ipno}\.{ipno}\.{ipno}
  37. comp [^ \t\n\r\.\=\+\/\\]*
  38. cname ({comp}\.)*{comp}
  39. computer (\\\\)?({cname}|{ipaddr})
  40. %%
  41. "#"/"\n" {return _ENDINPUT;}
  42. "-?"|"/?" {if(g_fNormal==0)REJECT;return _HELP;}
  43. <<EOF>> {return 0;}
  44. "\n" {return(0);}
  45. "tnadmin" {if(g_fNormal==0)REJECT;return(_TNADMIN);}
  46. "-u"/[ \t] {if(g_fNormal==0)REJECT;return(_tU);}
  47. "-p"/[ \t] {if(g_fNormal==0)REJECT;return(_tP);}
  48. "start" {if(g_fNormal==0)REJECT;return(_START);}
  49. "stop" {if(g_fNormal==0)REJECT;return( _STOP);}
  50. "pause" {if(g_fNormal==0)REJECT;return(_PAUSE);}
  51. "continue" {if(g_fNormal==0)REJECT;return(_CONTINUE);}
  52. "-s"/[ \t] {if(g_fNormal==0)REJECT;return(_S);}
  53. "-k"/[ \t] {if(g_fNormal==0)REJECT;return(_K);}
  54. "-m"/[ \t] {if(g_fNormal==0)REJECT;nMoccur=0;return(_M);}
  55. "config" {if(g_fNormal==0)REJECT;return(_CONFIG);}
  56. "dom" {if(g_fNormal==0)REJECT;return(_DOM);}
  57. "ctrlakeymap" {if(g_fNormal==0)REJECT;return(_CTRLKEYMAP);}
  58. "no"|"n" {if(g_fNormal==0)REJECT;return(_N);}
  59. "yes"|"y" {if(g_fNormal==0)REJECT;return(_Y);}
  60. "timeout" {if(g_fNormal==0)REJECT;return(_TIMEOUT);}
  61. "timeoutactive" {if(g_fNormal==0)REJECT;return(_TIMEOUTACTIVE);}
  62. "maxfail" {if(g_fNormal==0)REJECT;return(_MAXFAIL);}
  63. "maxconn" {if(g_fNormal==0)REJECT;return(_MAXCONN);}
  64. "port" {if(g_fNormal==0)REJECT;return(_PORT);}
  65. "killall" {if(g_fNormal==0)REJECT;return(_KILLALL);}
  66. "sec" {if(g_fNormal==0)REJECT;return(_SEC);}
  67. "-NTLM" {if(g_fNormal==0)REJECT;return _MINUSNTLM;}
  68. [+]?"NTLM" {if(g_fNormal==0)REJECT;return _PLUSNTLM;}
  69. "-PASSWD" {if(g_fNormal==0)REJECT;return _MINUSPASSWD;}
  70. [+]?"PASSWD" {if(g_fNormal==0)REJECT;return _PLUSPASSWD;}
  71. "mode" {if(g_fNormal==0)REJECT;return(_MODE);}
  72. "console" {if(g_fNormal==0)REJECT;return(_CONSOLE);}
  73. "stream" {if(g_fNormal==0)REJECT;return(_STREAM);}
  74. "=" {if(g_fNormal==0)REJECT;return(_EQ);}
  75. {integer} {if(g_fNormal==0)REJECT;return(_INTEGER);}
  76. {time} {if(g_fNormal==0)REJECT;return(_TIME);}
  77. "all" {if(g_fNormal==0)REJECT;return(_SESID);}
  78. {computer}|\. {if(g_fComp==0)
  79. REJECT;
  80. szCompname=strdup(yytext);return(_COMPNAME);}
  81. {ws} {}
  82. . {return _DUNNO;}
  83. %%