-
Notifications
You must be signed in to change notification settings - Fork 0
Simple Compiler
Nzen edited this page Jul 26, 2012
·
5 revisions
Deitel's simple compiler compiles simple language programs directly to simpletron instructions. The simple language is a subset of the basic language.
SIMPLE COMPILER GRAMMER:
A: D X | D C E | D I E G D C: rem | input | let | print D: { 0-9 } | DD E: L | D | L O D | L O E G: goto I: if L: { a-z } | LL O: + | - | * | / | % | = | > | < | == X: end
SIMPLE COMMANDS
rem "" - commented string input x - value from terminal let x = ( 5 + 3 ) / 2 - assign via x = expression print 5 - print to terminal goto 6 - unconditional jump if 5 >= n goto 3 - conditional jump, form of if [ expression ] goto [ line number ] end - stop execution