Skip to content

Instantly share code, notes, and snippets.

@erichocean
Created February 17, 2010 02:01
Show Gist options
  • Save erichocean/306202 to your computer and use it in GitHub Desktop.
Save erichocean/306202 to your computer and use it in GitHub Desktop.
Parsing this:
var x;
Produces this parse tree:
[true
,[0 Program
,6
,[[6 FormalParameterList
,6
,[[8 Statement
,6
,[[157 WhileTok
,3
,[]]
,[124 MultiLineCommentNoLB
,1
,[[113 RegularExpressionFlags
,1
,[]]]]
,[10 VariableStatement
,1
,[[132 Keyword
,1
,[[133 FutureReservedWord
,1
,[[134 Identifier
,1
,[[136 IdentifierStart
,1
,[]]]]]]]]]]
,[126 S
,1
,[]]]]]]]]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment