# To See how js parses scripts ?

**URL:** <https://forum.kirupa.com/t/to-see-how-js-parses-scripts/635508>\
**Category:** Uncategorized\
**Created:** [November 1, 2016, 1:28am UTC](https://forum.kirupa.com/t/to-see-how-js-parses-scripts/635508 "2016-11-01T01:28:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vmars316](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vmars316](https://forum.kirupa.com/u/vmars316)\
**Post date:** [November 1, 2016, 1:28am UTC](https://forum.kirupa.com/t/to-see-how-js-parses-scripts/635508/1 "2016-11-01T01:28:13Z")

</div>

Hello & Thanks ,  
I am learning javascript from “js101” and it would be a great help  
if I understood how js works , Parsing scripts , lexical analysis and syntax tree ,  
to actually see what js does with the different objects and elements  
as it encounters them .

Pls, where can I read up on this ?

Thanks

---

<div class="post-metadata">

**Author:** ![Jonny\_Silva](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jonny_silva/32/7836_2.png) [@Jonny\_Silva](https://forum.kirupa.com/u/Jonny_Silva)\
**Post date:** [November 2, 2016, 2:51pm UTC](https://forum.kirupa.com/t/to-see-how-js-parses-scripts/635508/2 "2016-11-02T14:51:07Z")

</div>

Is this what you are looking for ?

> **[JavaScript reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference)**
>
> This part of the JavaScript section on MDN serves as a repository of facts about the JavaScript language. Read more about this reference.

---

<div class="post-metadata">

**Author:** ![vmars316](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vmars316](https://forum.kirupa.com/u/vmars316)\
**Post date:** [November 2, 2016, 5:43pm UTC](https://forum.kirupa.com/t/to-see-how-js-parses-scripts/635508/3 "2016-11-02T17:43:18Z")

</div>

No , I want to know what the interpreter does as it encounters  
various js statements .  
Thanks

---

<div class="post-metadata">

**Author:** ![kadaj](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kadaj/32/9061_2.png) [@kadaj](https://forum.kirupa.com/u/kadaj)\
**Post date:** [November 3, 2016, 1:12pm UTC](https://forum.kirupa.com/t/to-see-how-js-parses-scripts/635508/4 "2016-11-03T13:12:34Z")

</div>

Interpreter converts it into bytecode. You can read on V8 internals: [http://v8project.blogspot.in/2016/08/firing-up-ignition-interpreter.html](http://v8project.blogspot.in/2016/08/firing-up-ignition-interpreter.html)

---

<div class="post-metadata">

**Author:** ![vmars316](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vmars316](https://forum.kirupa.com/u/vmars316)\
**Post date:** [November 4, 2016, 4:31pm UTC](https://forum.kirupa.com/t/to-see-how-js-parses-scripts/635508/5 "2016-11-04T16:31:09Z")

</div>

I know what an iterpreter does ,  
I want to see/know What and When it does it .  
When iterpreter encounters a Function Declaration what does it do , and when .  
When iterpreter encounters a Function Expression what does it do , and when .  
When iterpreter encounters am IIF Function what does it do , and when .

Thanks

---

<div class="post-metadata">

**Author:** ![kadaj](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kadaj/32/9061_2.png) [@kadaj](https://forum.kirupa.com/u/kadaj)\
**Post date:** [November 5, 2016, 1:39pm UTC](https://forum.kirupa.com/t/to-see-how-js-parses-scripts/635508/6 "2016-11-05T13:39:20Z")

</div>

See the source code for lexer, parser for [JavaScriptCore](http://trac.webkit.org/wiki/JavaScriptCore) at [https://github.com/kitsilanosoftware/JavaScriptCore](https://github.com/kitsilanosoftware/JavaScriptCore)

---

<div class="post-metadata">

**Author:** ![vmars316](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vmars316](https://forum.kirupa.com/u/vmars316)\
**Post date:** [November 6, 2016, 1:01am UTC](https://forum.kirupa.com/t/to-see-how-js-parses-scripts/635508/7 "2016-11-06T01:01:08Z")

</div>

> to actually see what js does with the different objects and elements  
> as it encounters them .  
> ie., I want to watch as things are interpreted .  
> ie., show me , so I can see it happening .  
> Thanks

---

<div class="post-metadata">

**Author:** ![vmars316](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vmars316](https://forum.kirupa.com/u/vmars316)\
**Post date:** [November 9, 2016, 3:37pm UTC](https://forum.kirupa.com/t/to-see-how-js-parses-scripts/635508/8 "2016-11-09T15:37:58Z")

</div>

Thanks

---

<div class="post-metadata">

**Author:** ![kadaj](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kadaj/32/9061_2.png) [@kadaj](https://forum.kirupa.com/u/kadaj)\
**Post date:** [November 10, 2016, 6:27pm UTC](https://forum.kirupa.com/t/to-see-how-js-parses-scripts/635508/9 "2016-11-10T18:27:43Z")

</div>

You can use [esprima](https://github.com/jquery/esprima) to see the tokens, AST etc.
