All Projects → OriRoth → fling

OriRoth / fling

Licence: other
A fluent API generator

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to fling

1c http
Подсистема 1С для работы с HTTP
Stars: ✭ 48 (+140%)
Mutual labels:  code-generation
EasyEE-Auto
EasyEE 自动化代码生成器。EasyEE Automated code generator.
Stars: ✭ 39 (+95%)
Mutual labels:  code-generation
nmodl
Code Generation Framework For NEURON MODeling Language
Stars: ✭ 42 (+110%)
Mutual labels:  code-generation
ParNMPC
A Parallel Optimization Toolkit for Nonlinear Model Predictive Control (NMPC)
Stars: ✭ 173 (+765%)
Mutual labels:  code-generation
kube-code-generator
Kubernetes code generator docker image
Stars: ✭ 60 (+200%)
Mutual labels:  code-generation
Sweet.apex
Next Generation of Apex Development
Stars: ✭ 43 (+115%)
Mutual labels:  code-generation
openapi-client
Generate ES6 or Typescript service integration code from an OpenAPI 2 spec
Stars: ✭ 92 (+360%)
Mutual labels:  code-generation
toast
Plugin-driven CLI utility for code generation using Go source as IDL
Stars: ✭ 52 (+160%)
Mutual labels:  code-generation
gamma
An Eclipse-based modeling framework for the component-based design and analysis of reactive systems
Stars: ✭ 21 (+5%)
Mutual labels:  code-generation
tiles
Programmatic code generation
Stars: ✭ 78 (+290%)
Mutual labels:  code-generation
vscode-cmantic
C/C++ code generation for VS Code: Generate Definitions, Getters, Setters, and much more.
Stars: ✭ 61 (+205%)
Mutual labels:  code-generation
dynamic.yaml
DEPRECATED: YAML-based data transformations
Stars: ✭ 14 (-30%)
Mutual labels:  code-generation
kobby
Kobby is a codegen plugin of Kotlin DSL Client by GraphQL schema. The generated DSL supports execution of complex GraphQL queries, mutation and subscriptions in Kotlin with syntax similar to native GraphQL syntax.
Stars: ✭ 52 (+160%)
Mutual labels:  code-generation
orm
Go Typed ORM
Stars: ✭ 16 (-20%)
Mutual labels:  code-generation
Beef
Business Entity Execution Framework
Stars: ✭ 95 (+375%)
Mutual labels:  code-generation
cog
Command-line utility that makes it easy to organize a project which uses code generation
Stars: ✭ 15 (-25%)
Mutual labels:  code-generation
qp-arduino
QP real-time embedded frameworks/RTOS for Arduino (AVR and SAM)
Stars: ✭ 37 (+85%)
Mutual labels:  code-generation
FSharpWrap
Utility that automatically generates F# modules and functions based on your F# project file's references
Stars: ✭ 14 (-30%)
Mutual labels:  code-generation
AUXify
Introduces macro/meta annotations @ aux, @ self, @ instance, @ apply, @ delegated, @ syntax and String-based type class LabelledGeneric
Stars: ✭ 25 (+25%)
Mutual labels:  code-generation
islpy
Python wrapper for isl, an integer set library
Stars: ✭ 58 (+190%)
Mutual labels:  code-generation

Fling is the first general and practical solution of the fluent API problem. The implementation includes an algorithm that takes a deterministic context free language (equivalently, LR(k), k≥0 language) and encodes it in an unbounded parametric polymorphism type system employing only a polynomial number of types. The theoretical result is employed in an actual tool Fling—a fluent API compiler-compiler in the venue of YACC, tailored for embedding DSLs in polymorphic, object-oriented languages.

Fling

Fling (fluent interfaces generator) is a parser generator. Instead of generating the code of a real-time parser, Fling generates Java fluent interfaces, which implement a compile-time parser of the given language. Fling accepts either LL(1) grammar or DPDA specifications; If a grammar is given, Fling also generates the AST class definitions used to compile a fluent API INVOCATION into an abstract parse tree at run-time.

Download jar

Full release (includes examples)

Documentation

Example

Let us define the Datalog grammar, in Java, using Fling's interface:

// Datalog grammar defined in BNF
BNF bnf = bnf().
      start(Program).
      derive(Program).to(oneOrMore(Statement)).
      specialize(Statement).into(Fact, Rule, Query).
      derive(Fact).to(fact.with(S), of.many(S)).
      derive(Query).to(query.with(S), of.many(Term)).
      specialize(Rule).into(Bodyless, WithBody).
      derive(Bodyless).to(always.with(S), of.many(Term)).
      derive(WithBody).to(RuleHead, RuleBody).
      derive(RuleHead).to(infer.with(S), of.many(Term)).
      derive(RuleBody).to(FirstClause, noneOrMore(AdditionalClause)).
      derive(FirstClause).to(when.with(S), of.many(Term)).
      derive(AdditionalClause).to(and.with(S), of.many(Term)).
      derive(Term).to(l.with(S)).or(v.with(S)).
      build();

After Fling has created the fluent interfaces supporting Datalog, a simple Datalog program...

parent(john, bob)
parent(bob, donald)
ancestor(A, B) := parent(A, B)
ancestor(A, B) := parent(A, C), ancestor(C, B)
ancestor(john, X)?

...can be written in Java by method-chaining, as follows:

Program program =
  fact("parent").of("john", "bob").
  fact("parent").of("bob", "donald").
  always("ancestor").of(l("adam"), v("X")).
  infer("ancestor").of(v("A"), v("B")).
    when("parent").of(v("A"), v("B")).
  infer("ancestor").of(v("A"), v("B")).
    when("parent").of(v("A"), v("C")).
    and("ancestor").of(v("C"), v("B")).
  query("ancestor").of(l("john"), v("X")).$();

The produced program is represented in Java as an abstract syntax tree (AST) that can be traversed and analyzed by the client library.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].