Research Article Open Access

Javascript Interpreter Using Non Recursive Abstract Syntax Tree Based Stack

Sambit Kumar Patra1, Binod Kumar Pattanayak2 and Bhagabat Puthal2
  • 1 Common Engineering Group, MAHINDRA COMVIVA, Bangalore, India
  • 2 Department of Computer Science and Engineering, ITER, Siksha ‘O’ Anusandhan University, Bhubaneswar, India

Abstract

In a Mobile device, apart from the battery and memory, the execution time is the key design constraint for executing the scripts of complex and unstructured JavaScript in the web-browser. Abstract Syntax Tree (AST) is a better option for mobile code as it is compiled only once. Due to very recursive nature of the AST, its traversal is going to be inherently recursive. Since use of recursion is out of scope, therefore the ultimate decision would be to emulate the recursive behavior using a set of stacks. We design an algorithm for a non recursive AST based stack, a lightweight interpreter which interprets and evaluates the complex scripts of JavaScript in the allocated time period.

American Journal of Applied Sciences
Volume 10 No. 4, 2013, 403-413

DOI: https://doi.org/10.3844/ajassp.2013.403.413

Submitted On: 5 March 2013 Published On: 27 April 2013

How to Cite: Patra, S. K., Pattanayak, B. K. & Puthal, B. (2013). Javascript Interpreter Using Non Recursive Abstract Syntax Tree Based Stack. American Journal of Applied Sciences, 10(4), 403-413. https://doi.org/10.3844/ajassp.2013.403.413

  • 3,063 Views
  • 3,463 Downloads
  • 0 Citations

Download

Keywords

  • Non-recursive Stack for Mobile Device
  • Script Interpreter
  • JavaScript Interprete
  • JavaScript Compiler