RegCodes.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. // These byte codes _cannot_ appear in the regexOpCode field of a Node.
  6. RegOp(GreedyStar ,Rev,Lng, 0 , 0 ) // 00/00 * label, cchMinRem
  7. RegOp(RevBranch ,Rev,Lng,Lng, 0 ) // 01/01 label, cchMinRem, pnode->cchMinTot
  8. RegOp(GreedyLoop ,Rev,Lng,Lng,Lng) // 02/02 label, min, max, cchMinRem
  9. RegOp(LoopInit ,Fwd,Int,Lng, 0 ) // 03/03 label, #, min
  10. RegOp(GreedyLoopTest ,Rev,Int,Lng,Lng) // 04/04 label, #, max-min, cchMinRem
  11. RegOp(NonGreedyStar ,Rev,Lng, 0 , 0 ) // 05 * label, cchMinRem
  12. RegOp(NonGreedyLoop ,Rev,Lng,Lng,Lng) // 06 label, min, max, cchMinRem
  13. RegOp(NonGreedyLoopTest,Rev,Int,Lng,Lng) // 07 label, #, max-min, cchMinRem
  14. RegOp(Open ,Int, 0 , 0 , 0 ) // 05/08 ( #
  15. RegOp(Close ,Int, 0 , 0 , 0 ) // 06/09 ) #
  16. RegOp(MatchOne ,Chr, 0 , 0 , 0 ) // 07/0A character
  17. RegOp(Need ,Lng, 0 , 0 , 0 ) // 08/0B cchMinRem
  18. RegOp(Fail , 0 , 0 , 0 , 0 ) // 09/0C no way to match this
  19. RegOp(Jump ,Fwd, 0 , 0 , 0 ) // 0A/0D label
  20. RegOp(PosLookahead ,Fwd, 0 , 0 , 0 ) // 0E label
  21. RegOp(NegLookahead ,Fwd, 0 , 0 , 0 ) // 0F label
  22. RegOp(LookaheadEnd , 0 , 0 , 0 , 0 ) // 10
  23. RegOp(End , 0 , 0 , 0 , 0 ) // 0B/11
  24. // These byte codes _can_ appear in the regexOpCode field of a Node.
  25. RegOp(Branch ,Fwd, 0 , 0 , 0 ) // 0C/12 label
  26. RegOp(Match ,Cch, 0 , 0 , 0 ) // 0D/13 cch, characters
  27. RegOp(MatchGroup ,Int, 0 , 0 , 0 ) // 0E/14 \1 #
  28. RegOp(Head , 0 , 0 , 0 , 0 ) // 0F/15 ^
  29. RegOp(Tail , 0 , 0 , 0 , 0 ) // 10/16 $
  30. RegOp(WordBound , 0 , 0 , 0 , 0 ) // 11/17 \b
  31. RegOp(NotWordBound , 0 , 0 , 0 , 0 ) // 12/18 \B
  32. RegOp(Any , 0 , 0 , 0 , 0 ) // 13/19 No longer used
  33. RegOp(AnyOf ,Cch, 0 , 0 , 0 ) // 14/1A [] cch, transition characters
  34. RegOp(AnyBut ,Cch, 0 , 0 , 0 ) // 15/1B [^] cch, transition characters
  35. RegOp(Digit , 0 , 0 , 0 , 0 ) // 16/1C \d
  36. RegOp(NotDigit , 0 , 0 , 0 , 0 ) // 17/1D \D
  37. RegOp(Space , 0 , 0 , 0 , 0 ) // 18/1E \s
  38. RegOp(NotSpace , 0 , 0 , 0 , 0 ) // 19/1F \S
  39. RegOp(Letter , 0 , 0 , 0 , 0 ) // 1A/20 \w
  40. RegOp(NotLetter , 0 , 0 , 0 , 0 ) // 1B/21 \W
  41. RegOp(NotLF , 0 , 0 , 0 , 0 ) // 1C/22 .
  42. RegOp(Dummy , 0 , 0 , 0 , 0 ) // 1D/23 Dummy. Default opcode to check for absence of opcode
  43. #undef RegOp