Simple golfing interpreter Challenge:

Your job is to create a simple interpreter for a simple golfing language.



Input:

Input will be in the form of string separated by spaces. 

You can replace space separation with what you want



Output:

Output the result (a number or a string) obtained after performing all operations. If there are more than one output join the together to give a single result (no separators). The variable's initial value is always zero. i.e: It start at 0



Language Syntax :

The language has following operators :

inc  ---&gt; add one to variable
dec  ---&gt; remove one from variable
mult ---&gt; multiply variable by 2
half ---&gt; divide the variable by 2
Pri  ---&gt; print the variable to console (or whatever your language has)
exit ---&gt; end the program (anything after this is ignored)




Examples:

inc inc inc dec Pri exit                 ---&gt; 2
dec inc mult inc inc Pri                 ---&gt; 2
inc inc inc mult half Pri exit inc       ---&gt; 3
inc Pri inc Pri inc Pri exit half mult   ---&gt; 123
Pri exit                                 ---&gt; 0
inc half Pri exit                        ---&gt; 0.5 




Restriction:

This is code-golf so shortest code in bytes for each language will win.



Note:


Input will always be valid . (string of operators separated with space)
You can round down to nearest integer if you don't want decimal places.
shell + sed + dc, 56 61 bytes

sed '1i0
s/.//2g;y&quot;idmhe&quot;+-*/q&quot;;i1
/[*/]/i1+
/P/crdn'|dc

Try it online!
Converts the program into a dc program, then evaluates it as dc code. This takes the input separated by newlines. Note that dc is stack-based and uses reverse polish notation, so 5 2- gives 3, and numbers are always rounded down.
The input is first piped to sed
1i0 on the first line of input, insert (prepend) a 0, this will be the accumulator
s/.//2g remove everything but the first character on each line
y&quot;idmhe&quot;+-*/q&quot; transliterate idmhe into +-*/q respectively, + - * / are the arithmetic commands and q quits the program
i1 on every line insert a 1 - this satisfies addition and subtraction
/[*/]/ on every line containing * or /, i1+ additionally insert 1+ because of the preceding 1, which dc will eventually evaluate into 2
/P/ on every line containing P, crdn change it into rdn, equivalent to reverse the top two elements, to rid the inserted 1, and duplicate and output as a number without newline (whilst popping it, hence the earlier duplicate) in dc
Now this is evaluated as a dc expression.