Affiliation:
1. University of Tokyo, Japan
Abstract
This paper presents a tool named Silverchain, which generates class definitions for a fluent API from the grammar of the API. A fluent API is an API that is used by method chaining and its grammar is a BNF-like set of rules that defines method chains accepted in type checking. Fluent APIs generated by Silverchain provide two styles of APIs: One is for building a chain by concatenating all method calls in series. The other is for building a chain from partial chains by passing child chains to method calls in the parent chain as their arguments. To generate such a fluent API, Silverchain first translates given grammar into a set of deterministic pushdown automata without ϵ-transitions, then encodes these automata into class definitions. Each constructed automata corresponds to a nonterminal in given grammar and recognizes symbol sequences produced from its corresponding nonterminal.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Reference29 articles.
1. Visibly pushdown languages
2. Efficient hybrid typestate analysis by determining continuation-equivalent states
3. TS4J
4. Janusz Brzozowski. 1962. Canonical Regular Expressions and Minimal State Graphs for Definite Events. (1962) 529–561. Janusz Brzozowski. 1962. Canonical Regular Expressions and Minimal State Graphs for Definite Events. (1962) 529–561.