back
WACC Compiler - Code Input and Execution
WACC Language Manual
begin int fibonacci(int n, bool toPrint) is if n <= 1 then return n else skip fi ; int f1 = call fibonacci(n - 1, toPrint) ; if toPrint then print f1 ; print ", " else skip fi ; int f2 = call fibonacci(n - 2, false) ; return f1 + f2 end println "The first 20 fibonacci numbers are:" ; print "0, " ; int result = call fibonacci(19, true) ; print result ; println "..." end
Compile & Run
Program Console:
Press "Compile & Run" to compile and execute the code inside the sandboxed virtual machine.
Program input (stdin) - one value per line for WACC "read" statements:
Standard Output(ERROR AND TAC):
Compilation to C Result:
Compilation to x86 Assembly Result: