Complete compiler
We have individually viewed all the stages of a compiler. We will now combine the entire code together to write the complete compiler.
var input = '(add 2 (subtract 4 2))';console.log('Input: ' + input);var tokens = tokenizer(input);var ast = parser(tokens);var newAst = transformer(ast);var output = codeGenerator(newAst);console.log('Output: ' + output);