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.

210 lines
5.9 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. 32macro.h
  5. Abstract:
  6. MSNET.X - YACC input file to produce parser for NETCMD. OS2 must be defined
  7. to produce os2cmd.c, OS/2 parser DOS3 must be defined to produce doscmd.c,
  8. DOS parser.
  9. IMPORTANT NOTE: ALL SWITCHES MUST BE IN UPPER CASE!!
  10. Author:
  11. Dan Hinsley (danhi) 8-Jun-1991
  12. Environment:
  13. XACC must be used under OS/2 to generate the source files, which are
  14. then checked into the tree. The source files generated are:
  15. NET.C
  16. OS2CMD.C
  17. OS2CMD.H
  18. OS2INCL.H
  19. These files are created by: NMAKE /F MAKEFIL1 ALL
  20. Notes:
  21. This file will create a version of the net command that will allow
  22. all commands to be executed. Some of these do not work due to the
  23. underlying Net API not being available. This should be used for testing.
  24. --*/
  25. %type char *
  26. %parse os2cmd
  27. %start net
  28. %lex lexor
  29. /* Need to get windows.h (out of os2.h) expanded before defines */
  30. %{
  31. #define INCL_NOCOMMON
  32. #include <os2.h>
  33. %}
  34. %token USE use
  35. %token VIEW view
  36. /* Tokens for various services, gives synonyms */
  37. %term EOS EOF /* user defined end of string */
  38. %{
  39. #include <stdio.h>
  40. #include <lmcons.h>
  41. #include <lmshare.h>
  42. #include "netcmds.h"
  43. #include "nettext.h"
  44. #include "swtchtbl.h"
  45. #include "os2incl.h"
  46. extern void call_net1(void) ;
  47. %}
  48. %%
  49. net : no_command |
  50. use |
  51. view |
  52. unknown
  53. ;
  54. use : USE (ValidateSwitches(0,use_switches))
  55. [
  56. EOS
  57. [
  58. (noswitch())
  59. { use_display_all(); }
  60. |
  61. /PERSISTENT (oneswitch())
  62. { use_set_remembered(); }
  63. ]
  64. |
  65. networkname
  66. [
  67. EOS
  68. [
  69. /DELETE (oneswitch())
  70. { use_del($2, TRUE, TRUE); }
  71. |
  72. /* processes display or add; don't know which it is */
  73. { use_unc($2); }
  74. ]
  75. |
  76. pass EOS
  77. { use_add(NULL, $2, $3, FALSE, TRUE); }
  78. ]
  79. |
  80. device_or_wildcard
  81. [
  82. EOS
  83. [
  84. (noswitch())
  85. { use_display_dev($2); }
  86. |
  87. /DELETE (oneswitch())
  88. { use_del($2, FALSE, TRUE); }
  89. |
  90. /HOME
  91. { use_add_home($2, NULL); }
  92. ]
  93. |
  94. pass EOS
  95. [
  96. /HOME
  97. { use_add_home($2, $3); }
  98. ]
  99. |
  100. networkname
  101. [
  102. pass EOS
  103. [
  104. { use_add($2, $3, $4, FALSE, TRUE); }
  105. /* No longer supported
  106. |
  107. /COMM (oneswitch())
  108. { use_add($2, $3, $4, TRUE, TRUE); }
  109. */
  110. ]
  111. |
  112. EOS
  113. [
  114. { use_add($2, $3, NULL, FALSE, TRUE); }
  115. /* No longer supported
  116. |
  117. /COMM (oneswitch())
  118. { use_add($2, $3, NULL, TRUE, TRUE); }
  119. */
  120. ]
  121. ]
  122. ]
  123. ];
  124. view : VIEW (ValidateSwitches(0,view_switches))
  125. [
  126. EOS
  127. { view_display(NULL); }
  128. |
  129. networkname2 EOS
  130. { view_display($2); }
  131. ];
  132. /* ====================================== */
  133. /* Catch-alls for bad or missing commands */
  134. /* ====================================== */
  135. unknown : %any
  136. { call_net1(); }
  137. ;
  138. no_command : EOS
  139. { call_net1(); }
  140. ;
  141. /* ===================== */
  142. /* Component definitions */
  143. /* ===================== */
  144. device_or_wildcard : %any (IsDeviceName($1) || IsWildCard($1)) ;
  145. device_name : %any (IsDeviceName($1)) ;
  146. resource_name : %any (IsResource($1)) ;
  147. netname : %any (IsNetname($1)) ;
  148. username : %any (IsUsername($1)) ;
  149. qualified_username : %any (IsQualifiedUsername($1)) ;
  150. pass : %any (IsPassword($1)) ;
  151. networkname : %any (!IsDeviceName($1) && !IsWildCard($1));
  152. networkname2 : %any (!IsWildCard($1)) ;
  153. %%