Skip to content

gubaojian/esprima-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

C++ port of Esprima

This is a JavaScript parser with a syntax tree that mostly conforms to the SpiderMonkey parser API. It was a quick port that I did in a couple of hours and doesn't yet support unicode or regular expression validation.

Usage

#include "esprima.h"
#include <iostream>

int main(int argc, char *argv[]) {
  try {
    esprima::Pool pool;
    esprima::Program *program = esprima::parse(pool, "print('hello');");
  } catch (const esprima::ParseError &error) {
    std::cout << "error: " << error.description << std::endl;
  }
  return 0;
}

About

JavaScript parser in C++ (port of Esprima)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages