Guest User

Untitled

a guest
Jun 18th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. util = require('util'),
  2. fs = require('fs'),
  3. peg = require('./peg')
  4.  
  5. file = fs.readFileSync('ecmascript.pegjs','utf-8')
  6. parser = peg.buildParser(file)
  7. ast = parser.parse('var a = 1+2')
  8. json = JSON.stringify(ast, null, ' ')
  9. util.puts(json)
Add Comment
Please, Sign In to add comment