Guest User

Untitled

a guest
Mar 10th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Oz 1.19 KB | None | 0 0
  1. declare
  2. fun {SimpleJack Source Temp FinalList CurrState}
  3.    case Source
  4.    of nil then
  5.       local A in
  6.      {String.toAtom Temp A}
  7.      A|FinalList
  8.       end
  9.    [] H|T then
  10.       case CurrState
  11.       of 0 then %not sure what we're dealing with...need to determine
  12.      local B in
  13.         {Char.isDigit H B}
  14.         if B then
  15.            {SimpleJack Source Temp FinalList 1}
  16.         else
  17.            {SimpleJack Source Temp FinalList 2}
  18.         end
  19.      end
  20.       [] 1 then %dealing with numbers
  21.      local B in
  22.         {Char.isDigit H B}
  23.         if B then
  24.            {SimpleJack T H|Temp FinalList 1}
  25.         else %state change. take the temp list, atomize it and add to Final List
  26.            local A in
  27.           {String.toAtom Temp A}
  28.           {SimpleJack Source nil A|FinalList 2}
  29.           end
  30.         end
  31.      end
  32.       [] 2 then %dealing with letters
  33.      local B in
  34.         {Char.isDigit H B}
  35.         if B then %state change.
  36.            local A in
  37.           {String.toAtom Temp A}
  38.           {SimpleJack Source nil A|FinalList 1}
  39.            end
  40.         else
  41.            {SimpleJack T H|Temp FinalList 2}
  42.         end
  43.      end
  44.       end
  45.    end
  46. end
  47.  
  48. local FinalListOfTokens in
  49.    FinalListOfTokens = {SimpleJack "abcd1234fdsa5438" nil nil 0}
  50.    {Browse FinalListOfTokens}
  51. end
Add Comment
Please, Sign In to add comment