I am currently using Spidemo to parse some JavaScript scripts and to obtain related ASTs. I have already done assignment expressions and sort with, but when I try to make a statement, I get the following error while navigating the AST pre-order:
TypeError: My order to translate pre-order is as follows: function printTreePreOrder {currentNodeSequence.push (root.type)
; If (root.left! = Null) {printTreePreOrder (root.left); } If (root.right! = Null) {printTreePreOrder (root.right); }}
My approximate results will be root. Type = "ifStatement" I am using the Mozilla Pars API as the basis for this:
Can anyone know what the problem is? Is it trying to use this type?
This is the script that I am currently trying to parse:
if (a & gt; b) a = 2; Other b = 3;
In addition, I am using Reflect.parse to parse the script and receive its AST. This AST is then passed to the above method (as the parameter root)
Comments
Post a Comment