Pound-Star Notation

Pound-Star Notation is an in-progress notation by SuperJedi224. The latest revision of the notation, Hyper Pound-Star (H#*), is defined as follows:

An expression consists of one or more entries seperated by groups of star characters (*) and/or carats (^). The first entry must be a pound sign (#). Subsequent entries my be either a pound sign, a single positive integer, an ordered, comma-seperated, set of one or more nonnegative integers, of which at least one must be positive, wrapped in a single set of parentheses; or a "proto-set" denoted as a single positive integer wrapped in two pairs of parentheses.

For instance, one valid expression is #*((2))*(1,3)*^*2**#*7.

These expressions are reduced by the following rules:

0. Start with n=1.

1. If the final group of seperator characters is anything other than a single *: 2. Else: 3. Repeat 1-2 until the expression is reduced to a single number. This is the value of the expression.
 * If the final character in the group is a carat, replace it with n stars.
 * If the final character in the group is a star, replace the final entry with a series of n identical entries whose seperator groups have had the final star removed.
 * If the last entry is a number, multiply n by this number, then remove it from the expression.
 * If the last entry is a pound sign, replace it with the current n.
 * If the last entry is a proto-set ((x)), replace it with a set of n entries each equalling x.
 * If the last entry is a set:
 * If the set contains only one element, replace the set with that number raised to the power of the current n.
 * Else, if the final element is 0, remove it and increment n by 1.
 * Else, decrement the final element by 1 and increment the element preceeding it by n.

A fully worked low-level example:

#*(1,0,1)*2

n=1, #*(1,0,1)*2

n=2, #*(1,0,1)

n=2, #*(1,2,0)

n=3, #*(1,2)

n=3, #*(4,1)

n=3, #*(7,0)

n=4, #*(7)

n=4, #*2401

n=9604, #

9604