Challenge Overview
Requirements
During the last week, we’ve launched some challenges to build a peg.js parser for parsing SOQL queries.
Now, we would like to build upon this further - Using EsTraverse as a base; we want to build a traverser for the Abstract Syntax Tree (AST) generated by our SOQL parser. It should have the same API as EsTraverse. If there are changes needed to the parser to support the functions, document these with examples.
You will need access to the parser codebase (the data for the tests can be used as dummy data for your own tests). Apply for access in the forums and work off the feature/est branch.
Resources
-
Example :
-
If we take the Gherkin language as an example and use the AST produced by the Gherkin.js parser we would modify EsTraverse as follows :
// Node types.
var Syntax = {
Feature: 'Feature',
Background: 'Background',
Step: 'Step',
Scenario: 'Scenario',
Tag: 'Tag',
Examples: 'Examples',
DataTable : 'DataTable',
TableRow : 'TableRow',
TableCell : 'TableCell',
ScenarioOutline : 'ScenarioOutline'
};
// This tells the traverser where the next child node is located. ie if we are in the Scenario node we next need to visit its children : tags', 'steps', 'name'.
var VisitorKeys = {
Feature: ['tags', 'background', 'scenarioDefinitions', 'comments'],
Background: ['steps', 'tags'],
Step: ['argument', 'text'],
Scenario: ['tags', 'steps', 'name'],
Tag: ['tags'],
Examples : ['tableBody', 'tableHeader'],
DataTable : ['rows'],
TableRow : ['cells'],
TableCell : [],
ScenarioOutline : ['examples']
};
Repo/Housekeeping
-
You will need to base your work off the git repository provided.
-
You will be required to handle any merge issues that occur from your submission.
Coding Standards
-
All code should be fully unit tested and documented. Please use best practise here (you do not need to document getters and setters, etc)!
-
All existing tests should be fully maintained (ie if you make a change to the existing functionality that breaks a test you need to fix that).
Documentation
Video
Note - Winner needs to ensure that the submission works with complex SOQL queries and will be asked to make final fixes as required from PM/ client
- Please provide a Deployment Guide containing configuration, installation and verification information as a Word document.
-
Please provide a demo video covering both a functional demo as well as code walkthrough of your parser implementation
Final Submission Guidelines
Deliverables
-
The AST traverser
-
A full test suite for available types
-
Documentation on the available types
-
Documentation on any changes to the AST needed
-
Demo video
-
Live Heroku URL hosting your AST traverser