This is related to this other question:  Last evaluated expression in Javascript  But I wanted to provide more details about what I wanted to do and show how I finally solved the problem as some users requested in the comments.  I have snippets of Ja...
How do you build an AST (Abstract Syntax Tree) for left-associative operators using PEG.js?  I've tried to write some code based on the information I found on the internet, but I seem to have made a mistake.  The code I wrote generates an incorre...
var foo = (function(){   var x = "bar";   return function(){     console.log(x);   }; })();  console.log(foo.toString()); // function() {console.log(x);} (foo)(); // 'bar' eval('(' + foo.toString()+')()')); // error: x...
I'd like to use JavaScript to parse an html document into an abstract syntax tree, where each node also includes start and end line numbers (and hopefully also character positions) for each node.  Are there any existing solutions that can do this...
I'm looking for a library in scala that generates JavaScript from an abstract syntax tree. I want to use it in an compiler that generates JavaScript at the end and I don't want to implement the pretty printing part myself....
I am working with reflect.js (a nice Javascript parser) from Zach Carter on github; I am trying to modify the behavior of his parser to handle comments as normal tokens that should be parsed like anything else.  The default behavior of reflect.js is...
I'm back to exploring pegjs and clearly have not grasped the core concept yet.  I'm trying to parse a "query language" that starts with a predicate and then a list of operands (which could include another predicate).  So a simple exam...
I have been struggling to adding a new object to array of objects with jscodeshift. My problem is I can't figure out how I have to query an array after I got VariableDeclarator. I need to get a last element in the array after that I can insert a...
For a research project that I'm currently conducting, one of the tasks that I need to do is as follows: given a rooted, labeled, directed tree, I need to find all the subtree repeats within this tree; in other words, given all the subtrees (with...
I want to get full AST ( Abstract Syntax Tree ) of a javascript code and I have decided to use V8's parser. After trying to use V8, what I realize is that V8 does not parse functions which are not executed ( dead code ). My assumption is V8 is tr...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.