Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interpreter = function( codeList, scope )
- {
- while( codeList.hasNextInstruction() )
- {
- instr = codeList.next() ;
- switch (instr )
- case '='
- expression = interpreter( instr.expression ) ;
- if( instr.var.type != expression.type )
- {
- this.typeViolation() ; // function calls can be listened too
- return ;
- }
- case 'function'
- if( function.unitTest ) interpreter( function.unitTest, scope )
- case default // ie. +, - etc
- for( i in instr ) interpreter( i, scope ) ;
- instr() ;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement