Comments (1)
func <name>(<params>)[<context_params>] -> <res_type> = <exp>
func parseIR(input: supplier<string>)[irParse: IRParse] -> IStrategoTerm = ...
func invokeStrategoStrategy(...)[runtime: StrategoRuntime, @Named projectName: String] -> IStrategoTerm = ...
Description
- Parts of the context that the task needs access to.
- Just compiles to Dagger Dependency injection for now
- Different compiler could compile it to e.g. other injection framework, access of static variable, lookup in a store, etc.
- optional; if no context parameters the
[]
can be omitted- backwards compatible with existing syntax
requirements:
Required:
- has to work both with foreign java and in-DSL functions => should be part of signature
- not ambiguous with existing or future syntax
Nice to have:
- easy to distinguish regular and context parameters => not an annotation in regular parameters
Syntax
Same as parameters but with [ ]
instead of ( )
Examples / Goals
When this construct is implemented, the following should compile
func compileIrToDist(ast: supplier<IStrategoTerm>)[runtime: StrategoRuntime] -> IStrategoTerm =
runtime.invokeNoNull("compileToDist", ast.get<>());
func compileIrToPlsql(ast: supplier<IStrategoTerm>)[runtime: StrategoRuntime] -> IStrategoTerm =
runtime.invokeNoNull("compileToPlsql", ast.get<>());
func parseCpp(input: supplier<string>) -> ParseResult =
foreign oracle.cpp.spoofax.task.cppParse
class compileIrToDist implements TaskDef<Supplier<IStrategoTerm>, IStrategoTerm> {
private final StrategoRuntime runtime;
@Inject public compileIrToDist(StrategoRuntime runtime) {
this.runtime = runtime;
}
public String id() {...}
public IStrategoTerm exec(ExecContext execContext, Supplier<StrategoTerm> ast) {
return runtime.invokeNoNull("compileToDist", ast.get());
}
}
class compileIrToPlsql implements TaskDef<Supplier<IStrategoTerm>, IStrategoTerm> {
private final StrategoRuntime runtime;
@Inject public compileIrToPlsql(StrategoRuntime runtime) {
this.runtime = runtime;
}
public String id() {...}
public IStrategoTerm exec(ExecContext execContext, Supplier<StrategoTerm> ast) {
return runtime.invokeNoNull("compileToPlsql", ast.get());
}
}
from pie.
Related Issues (20)
- Make _ an anonymous value HOT 4
- Give warnings when type parameters do not have multiple solutions
- Give warning when two type parameters cannot be inequal
- Parse function declarations without equals sign
- Add list with explanations of editor messages
- Replace EmptyList with list of bottom type
- Useful link with explanation of subtyping in Kotlin?
- Replace NullType with NullableType(BottomType())
- Incorrect documentation: nullable types cannot access methods of inner type
- Use wildcards for least upper bound of two lists
- Bug in code generation
- List literal compilation should specify the generic arguments
- Least upper bound nullable relies on subtyping
- Use Statix incremental solver HOT 1
- Document meanings of message severities
- Generate valid Java code from invalid PIE code
- Annotation to suppress messages
- Let parsing recover from no expression after a ;
- Value declaration compiles to unit
- Add tests suffering from bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pie.