Advertisement
Madmouse

a basic lexical analyzer for creating the regex generator

Jul 8th, 2016
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. First we tokenize the entire string:
  2.  
  3. aaaa - 1111111111
  4. AAAAS-SNNNNNNNNNN
  5. aaaa - 1411334411 - 987
  6. AAAAS-SNNNNNNNNNNS-SNNN
  7. aaaa - 1197887191 - 8
  8. AAAAS-SNNNNNNNNNNS-SN
  9.  
  10. this can then be broken down into like pieces:
  11.  
  12. aaaa - 1111111111
  13. [AAAA][S][-][S][NNNNNNNNNN]
  14. aaaa - 1411334411 - 987
  15. [AAAA][S][-][S][NNNNNNNNNN][S][-][S][NNN]
  16. aaaa - 1197887191 - 8
  17. [AAAA][S][-][S][NNNNNNNNNN][S][-][S][N]
  18.  
  19. which can then be broken down into like groups of tokens:
  20.  
  21. aaaa - 1111111111
  22. [
  23. [AAAA]
  24. [
  25. [S][-][S]
  26. ]
  27. [NNNNNNNNNN]
  28. ]
  29. aaaa - 1411334411 - 987
  30. [
  31. [AAAA]
  32. [
  33. [S][-][S]
  34. ]
  35. [NNNNNNNNNN]
  36. ]
  37. [
  38. [S][-][S]
  39. ]
  40. [NNN]
  41.  
  42. aaaa - 1197887191 - 8
  43. [
  44. [AAAA]
  45. [
  46. [S][-][S]
  47. ]
  48. [NNNNNNNNNN]
  49. ]
  50. [
  51. [S][-][S]
  52. ]
  53. [N]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement