       NonTerminal("ref #{node.index}")
 
     when "literal"
-      if node.body == " "
-        NonTerminal("SP")
-      else
-        Terminal(node.body)
+      makeLiteral(node.body)
 
     when "word"
       NonTerminal("word-character")

            literal = n.body
        else
          if literal?
            sequence.push Terminal(literal)
            literal = null

          sequence.push rx2rr n

      if literal?
        sequence.push Terminal(literal)

      if sequence.length == 1
        sequence[0]

      charset = (x.text for x in node.body)

      if charset.length == 1
        char = charset[0]

        if char == " "
          char = "SP"

        if node.invert
          return NonTerminal("not #{charset[0]}")
        else
          return Terminal(charset[0])
      else
        list = charset[0...-1].join(", ")

        for x,i in list
          if x == " "
            list[i] = "SP"

        if node.invert
          return NonTerminal("not #{list} and #{charset[-1..]}")
        else
          return NonTerminal("#{list} or #{charset[-1..]}")

    when "hex", "octal", "unicode"
      Terminal(node.text)
