pattern.go 622 B

12345678910111213141516171819202122
  1. package utilities
  2. // An OpCode is a opcode of compiled path patterns.
  3. type OpCode int
  4. // These constants are the valid values of OpCode.
  5. const (
  6. // OpNop does nothing
  7. OpNop = OpCode(iota)
  8. // OpPush pushes a component to stack
  9. OpPush
  10. // OpLitPush pushes a component to stack if it matches to the literal
  11. OpLitPush
  12. // OpPushM concatenates the remaining components and pushes it to stack
  13. OpPushM
  14. // OpConcatN pops N items from stack, concatenates them and pushes it back to stack
  15. OpConcatN
  16. // OpCapture pops an item and binds it to the variable
  17. OpCapture
  18. // OpEnd is the least postive invalid opcode.
  19. OpEnd
  20. )