Name |
Bidirectional ceylon.ast / RedHat compiler AST conversion |
---|---|
Backends | JVM |
Maven coordinates | |
Compatible Ceylon release |
JVM: 1.2.x, 1.3.x (latest) |
Published | Apr 8, 2016 |
Stats |
Downloads (JVM): 286 Source downloads: 250 |
Authors |
Lucas Werkmeister <mail@lucaswerkmeister.de> |
License | http://www.apache.org/licenses/LICENSE-2.0.html |
Description |
This module defines a bidirectional conversion between
that.transform(RedHatTransformer(SimpleTokenFactory())) RedHat AST → compilationUnitToCeylon(that) Code → compileCompilationUnit(code) For the latter two, there are also functions for (almost) every other
node type, e. g. All Anything(JNode,Node) update = noop This function is invoked once for every [[ceylon.ast.core::Node]] created
with the original RedHat AST node (above aliased to Key<Token[]> tokensKey = ScopedKey<Token[]>(`module`, "tokens"); value cu = compileCompilationUnit { code; void update(JNode orig, Node res) { res.set(tokensKey, [orig.mainToken, orig.mainEndToken].coalesced); } }; // later assert (exists tokens = cu.get(tokensKey)); The default is value cu = compileCompilationUnit { code; update = attachOriginalNode; }; // later assert (exists orig = cu.get(originalNodeKey)); value tokens = [orig.mainToken, orig.mainEndToken].coalesced; |
Dependencies |
ceylon.ast.core/1.2.2
shared
|
Usage |
import ceylon.ast.redhat "1.2.2"; |
Module links |
Members Imported By Home Code repository Issue tracker Browse Download .car No .js archive Download source archive Download module documentation View API documentation |