Support custom user defined declarative APIs
See original GitHub issue$.RULE("selectStatement", () => {
$.SUBRULE($.selectClause)
$.SUBRULE($.fromClause)
$.OPTION(() => {
$.SUBRULE($.whereClause)
})
})
rule('selectStatement', [{
rule: 'selectClause',
}, {
rule: 'fromClause',
}, {
option: {rule: 'whereClause'}
}
])
$.RULE("selectClause", () => {
$.CONSUME(Select);
$.AT_LEAST_ONE_SEP({SEP: Comma, DEF: () => {
$.CONSUME(Identifier);
}});
})
$rule('selectClause', [{
consume: Select
}, {
repeat: {
min: 1,
separator: Comma,
rule: {
consume: Identifier
}
}
}
])
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Declarative API — SQLAlchemy 1.3 Documentation
Construct a base class for declarative class definitions. The new base class will be given a metaclass that produces appropriate Table objects ...
Read more >Declarative API
Construct a base class for declarative class definitions. ... A type to use as the base for the generated declarative base class.
Read more >Creating a declarative API | core - Cloud Robotics
In this guide we will use a Kubernetes-style declarative API to interface ... This is a custom resource definition (CRD) for a resource...
Read more >Designing Declarative APIs. Ilya Birman - YouTube
What if it was a part of HTML? In this talk, I will give examples of declarative APIs, will guide you through designing...
Read more >Declarative Configuration Reference Guide
An array of routes configured for this API instance towards the service. ... include the basic credentials defined in config.username and config.password ....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
btw, I understand the appeal of a “clearer natural API”.
But one of the reasoning for the existing ugly APIs is that by being “pure” programatic APIs with very little abstraction is that the parser can be easily debugged just by setting a regular break point inside the parser. No in any generated code or in any additional abstraction.
Usage Docs and links to runable example here: http://sap.github.io/chevrotain/website/Deep_Dive/custom_apis.html (link will be valid after 2.0 release.)