Releases: ceylon/ceylon.ast
ceylon.ast 1.3.3
ceylon.ast 1.3.3
Changes from the previous version (1.3.2):
- A
CaseClause
and aCaseExpression
have an additional boolean modifier,elseCase
,
indicating a non-disjoint case (syntaxelse case
instead of justcase
). See #137. - A
ModuleSpecifier
has an additionalClassifier
(a new alias forStringLiteral
). See #135. - A
ModuleBody
has an additional listconstantDefinitions
ofValueDefinition
s, and aModuleImport
’sversion
may also be aBaseExpression
. See #136.
Unfortunately, one minor language change could not be adopted in this version: Support for of package.foo
is not added in this release. See #134.
The .car
files for this release have been made reproducible using a fork of Debian’s strip-nondeterminism
program. The following script, on a fresh Debian Jessie GNU/Linux system, should produce the exact same binary:
#!/bin/bash
languageVersion=1.3.3
languageRelease=0
projectVersion=1.3.3
repoUser=ceylon
repoName=ceylon.ast
modules=(ceylon.ast.{core,create,redhat,samples})
repo=https://modules.ceylon-lang.org/repo/1
timestamp=1511111111
# install dependencies
apt install --yes --allow-unauthenticated \
git \
default-jre \
wget \
curl \
ant \
zip \
unzip \
libarchive-zip-perl \
python3 \
nodejs
# install Ceylon
cd /opt
wget https://downloads.ceylon-lang.org/cli/ceylon-${languageVersion}_${languageVersion}-${languageRelease}_all.deb
dpkg -i ceylon-${languageVersion}_${languageVersion}-${languageRelease}_all.deb
# build project
git clone https://github.com/$repoUser/$repoName
cd $repoName
git checkout $projectVersion
sed -i "/dist.root.dir=/ s =.*$ =/usr/share/ceylon/$languageVersion " build.properties
ant compile
cd ..
# strip nondeterminism
git clone https://github.com/lucaswerkmeister/strip-nondeterminism
cd strip-nondeterminism
for module in "${modules[@]}"; do
car="../$repoName/modules/${module//\.//}/$projectVersion/$module-$projectVersion.car"
perl -I lib -- bin/strip-nondeterminism -t car -T $timestamp "$car"
echo -n $(sha1sum "$car" | cut -f1 -d' ') > "$car".sha1
done
cd ..
# compare checksums
for module in "${modules[@]}"; do
echo
echo "$module"
cat "$repoName/modules/${module//\.//}/$projectVersion/$module-$projectVersion.car.sha1"; echo
curl "$repo/${module//\.//}/$projectVersion/$module-$projectVersion.car.sha1"; echo
done
exit 0
ceylon.ast 1.3.2
ceylon.ast 1.3.2
Changes from the previous version (1.3.1):
- Module descriptors have received an update. A new node type,
ModuleSpecifier
, has been added, representing the specification grammar rule of the same name. AModuleDescriptor
and aModuleImport
can each have one (replacing aModuleImport
’srepositoryType
member). TheRepositoryType
has been renamed to justRepository
to match the specification (which did not exist whenRepositoryType
was added), and aliasesArtifact
,ModuleName
andModule
have been added. See #128, #129 and #133. Assertion
now has aStringLiteral|StringTemplate? message
instead ofAnnotations annotations
, defaulting tonull
. See #131.- An incorrect example in the
MemberMeta
documentation has been removed. See #130.
The .car
files for this release have been made reproducible using a fork of Debian’s strip-nondeterminism
program. The following script, on a fresh Debian Jessie GNU/Linux system, should produce the exact same binary:
#!/bin/bash
languageVersion=1.3.2
languageRelease=0
projectVersion=1.3.2
repoUser=ceylon
repoName=ceylon.ast
modules=(ceylon.ast.{core,create,redhat,samples})
repo=https://modules.ceylon-lang.org/repo/1
timestamp=1490370000
# install dependencies
apt install --yes --allow-unauthenticated \
git \
default-jre \
wget \
curl \
ant \
zip \
unzip \
libarchive-zip-perl \
python3 \
nodejs
# install Ceylon
cd /opt
wget https://downloads.ceylon-lang.org/cli/ceylon-${languageVersion}_${languageVersion}-${languageRelease}_all.deb
dpkg -i ceylon-${languageVersion}_${languageVersion}-${languageRelease}_all.deb
# build project
git clone https://github.com/$repoUser/$repoName
cd $repoName
git checkout $projectVersion
sed -i "/dist.root.dir=/ s =.*$ =/usr/share/ceylon/$languageVersion " build.properties
ant compile
cd ..
# strip nondeterminism
git clone https://github.com/lucaswerkmeister/strip-nondeterminism
cd strip-nondeterminism
for module in "${modules[@]}"; do
car="../$repoName/modules/${module//\.//}/$projectVersion/$module-$projectVersion.car"
perl -I lib -- bin/strip-nondeterminism -t car -T $timestamp "$car"
echo -n $(sha1sum "$car" | cut -f1 -d' ') > "$car".sha1
done
cd ..
# compare checksums
for module in "${modules[@]}"; do
echo
echo "$module"
cat "$repoName/modules/${module//\.//}/$projectVersion/$module-$projectVersion.car.sha1"; echo
curl "$repo/${module//\.//}/$projectVersion/$module-$projectVersion.car.sha1"; echo
done
exit 0
ceylon.ast 1.3.1
ceylon.ast 1.3.1
Changes from the previous version (1.3.0):
ceylon.ast
’s goal has shifted:
ceylon.ast
now aims to support all programs accepted by the typechecker,
including ones that are not covered by the specification.
See #123.- Imports no longer distinguish by case:
ImportAlias
andImportElement
are now concrete classes,
their former-Type-
and-FunctionValue-
subclasses
have been merged into the superclasses and removed.
See #122. - Tuple literal cases are now supported:
AMatchCase
’sexpressions
may now containTuple
s.
See #125. - Nested imports are now supported:
Body
now has a memberImport[] imports
analogous to the one inAnyCompilationUnit
.
In the subclass constructors, it defaults to[]
.
See #126. - Assignment operations can now have any
Expression
on the right-hand side, not justAssigningExpression
s.
This has always been supported by the typechecker,
butceylon.ast
did not previously support it
due to a misunderstanding of the specification.
See #121.
Note that on the JS backend, this release is afflicted by eclipse-archived/ceylon#6767; certain uses of ceylon.ast on the JS backend may be impossible.
The .car
files for this release have been made reproducible using a fork of Debian’s strip-nondeterminism
program. The following script, on a fresh Debian Jessie GNU/Linux system, should produce the exact same binary:
#!/bin/bash
version=1.3.1
project=ceylon.ast
modules=(ceylon.ast.{core,create,redhat,samples})
repo=https://modules.ceylon-lang.org/repo/1
timestamp=1480180000
# install dependencies
apt install --yes --allow-unauthenticated \
git \
default-jre \
wget \
curl \
ant \
zip \
unzip \
libarchive-zip-perl \
python3 \
nodejs
# install Ceylon
cd /opt
wget https://downloads.ceylon-lang.org/cli/ceylon-1.3.1_1.3.1-1_all.deb
dpkg -i ceylon-1.3.1_1.3.1-1_all.deb
# build project
git clone https://github.com/ceylon/$project
cd $project
git checkout $version
sed -i 's ../ceylon/dist/dist /usr/share/ceylon/1.3.1/ ' build.properties
ant compile
cd ..
# strip nondeterminism
git clone https://github.com/lucaswerkmeister/strip-nondeterminism
cd strip-nondeterminism
for module in "${modules[@]}"; do
car="../$project/modules/${module//\.//}/$version/$module-$version.car"
perl -I lib -- bin/strip-nondeterminism -t car -T $timestamp "$car"
echo -n $(sha1sum "$car" | cut -f1 -d' ') > "$car".sha1
done
cd ..
# compare checksums
for module in "${modules[@]}"; do
echo
echo "$module"
cat "$project/modules/${module//\.//}/$version/$module-$version.car.sha1"; echo
curl "$repo/${module//\.//}/$version/$module-$version.car.sha1"; echo
done
exit 0
On other systems, adjust the first two command sections to use the correct package manager, and potentially the sed build.properties
line to point to the correct Ceylon distribution directory.
(Note that the .car
files depend slightly on the Java version; building under Java 8 instead of 7 is known to result in differently ordered MANIFEST.MF
entries.)
ceylon.ast 1.3.0
ceylon.ast 1.3.0
Changes from the previous version (1.2.2):
ceylon.ast.redhat
’scompileX
functions have been renamed toparseX
to better reflect their actual behavior. See #101 and b8f3959.- Support for repository types (aka namespaces) has been added.
ModuleImport
gained a new optional parameterrepositoryType
of typeRepositoryType?
(a new alias forLIdentifier
). See 4aa9051. - An
internal
constructor forLIdentifier
andUIdentifier
has been added, which accepts dollar signs ($
) in the name, to be used for internal variables generated by the compiler. A new field,valid
, has been added toIdentifier
to distinguish between valid and invalid identifiers. See #119. - The type of
KeySubscript.key
has been widened fromAddingExpression
toExpression
. OnlySpanOperation
andMeasureOperation
are not permitted as children. See #118. - The type of
ExtensionOrConstruction.qualifier
has been widened fromBaseType|PackageQualifier|Super?
toSimpleType|PackageQualifier|Super?
, and the type ofExtension.qualifier
has been widened fromPackageQualifier|Super?
toPackageQualifier|Super|SimpleType?
. See #117. ImportElements
may now be empty, that is, contain neither regular elements nor a wildcard. See #120.- The
Identifier
conversion from RedHat AST to ceylon.ast did not accept identifiers with no token. As the typechecker sometimes adds such identifiers to the AST (desugaring), they are now supported. See #114, #115. - New build targets
test-tap
,test-jvm-tap
andtest-js-tap
can be used to obtain Test Anything Protocol reports for the tests (written to filestest-jvm.tap
andtest-js.tap
). - The RedHat AST gained a new node type
ParExpression
for grouped expressions (instead of just anExpression
with start and end token), soceylon.ast.redhat
learned to convert to/from this new type. See eclipse-archived/ceylon#6247, 593d167. - The size of the
ceylon.ast.redhat
CAR file has been drastically reduced. See a2fd9d8.
The .car
files for this release have been made reproducible using a fork of Debian’s strip-nondeterminism
program. The following script, on a fresh Debian GNU/Linux system, should produce the exact same binary:
#!/bin/bash
version=1.3.0
project=ceylon.ast
modules=(ceylon.ast.{core,create,redhat,samples})
repo=https://modules.ceylon-lang.org/repo/1
timestamp=1474200000
# install dependencies
apt install --yes --allow-unauthenticated \
git \
default-jre \
wget \
curl \
ant \
zip \
unzip \
libarchive-zip-perl \
python3 \
nodejs
# install Ceylon
cd /opt
wget https://downloads.ceylon-lang.org/cli/ceylon-1.3.0_1.3.0_all.deb
dpkg -i ceylon-1.3.0_1.3.0_all.deb
# build project
git clone https://github.com/ceylon/$project
cd $project
git checkout $version
sed -i 's ../ceylon/dist/dist /usr/share/ceylon/1.3.0/ ' build.properties
ant compile
cd ..
# strip nondeterminism
git clone https://github.com/lucaswerkmeister/strip-nondeterminism
cd strip-nondeterminism
for module in "${modules[@]}"; do
car="../$project/modules/${module//\.//}/$version/$module-$version.car"
perl -I lib -- bin/strip-nondeterminism -t car -T $timestamp "$car"
echo -n $(sha1sum "$car" | cut -f1 -d' ') > "$car".sha1
done
cd ..
# compare checksums
for module in "${modules[@]}"; do
echo
echo "$module"
cat "$project/modules/${module//\.//}/$version/$module-$version.car.sha1"; echo
curl "$repo/${module//\.//}/$version/$module-$version.car.sha1"; echo
done
exit 0
On other systems, adjust the first two command sections to use the correct package manager,
and potentially the sed build.properties line to point to the correct Ceylon distribution directory.
ceylon.ast 1.2.2
ceylon.ast 1.2.2
Changes from the previous version (1.2.1):
- Several changes have been made to
Editor
in an effort to improve performance:- The
edit
methods for abstract node classes and precedence aliases are no longerdefault
. They are usually not called anyways, sinceEditor
satisfiesImmediateNarrowingTransformer
, so if you overwrote them for whatever reason, this was almost certainly a bug. See #112. - The
edit
methods for leaf nodes (that is, nodes without child nodes) have been changed to skip thecopy
call and directly return the edited node, since for these nodescopy
is a no-op anyways. See #111. - The method
editNode
is added to provide a heuristic whether a given node will be changed by the editor or not. IfeditNode
returnsfalse
, the default implementations of theedit
methods for non-leaf nodes will directly return the edited node without callingcopy
or editing child nodes. By default,editNode
always returnstrue
, so the behavior is the same as before. But editors that seek to improve performance can overwrite it with some heuristic to avoid unnecessary edits in some cases. See #111.
- The
- The
ClassDec
conversion from RedHat AST to ceylon.ast did not accept lowercase identifiers, which are valid in declarations that refer to the class of an object. See #113.
The .car
files for this release have been made reproducible using a fork of Debian’s strip-nondeterminism
program.
The following script, on a fresh Arch Linux system, should produce the exact same binary:
#!/bin/bash
version=1.2.2
project=ceylon.ast
modules=(ceylon.ast.{core,create,redhat,samples})
repo=https://modules.ceylon-lang.org/repo/1
timestamp=1460140000
# install dependencies
pacman -S --noconfirm \
git \
jdk8-openjdk \
wget \
curl \
apache-ant \
zip \
unzip \
perl-archive-zip \
python
# install Ceylon
cd /opt
wget https://downloads.ceylon-lang.org/cli/ceylon-$version.zip
unzip ceylon-$version.zip
export PATH="$PATH:/opt/ceylon-$version/bin"
# build project
git clone https://github.com/ceylon/$project
cd $project
git checkout $version
sed -i "s|../ceylon/dist/dist|/opt/ceylon-$version|" build.properties
ant compile
cd ..
# strip nondeterminism
git clone https://github.com/lucaswerkmeister/strip-nondeterminism
cd strip-nondeterminism/lib
for module in "${modules[@]}"; do
car="../../$project/modules/${module//\.//}/$version/$module-$version.car"
../bin/strip-nondeterminism -t car -T $timestamp "$car"
echo -n $(sha1sum "$car" | cut -f1 -d' ') > "$car".sha1
done
# compare checksums
for module in "${modules[@]}"; do
echo
echo "$module"
cat "../../$project/modules/${module//\.//}/$version/$module-$version.car.sha1"; echo
curl "$repo/${module//\.//}/$version/$module-$version.car.sha1"; echo
done
(This is almost certainly not specific to Arch Linux, but that’s where it was tested. On other systems, adjust the pacman -S
line to use the correct package manager, or remove it entirely if the packages are already installed.)
ceylon.ast 1.2.1
Changes from the previous version (1.2.0):
-
Support for value constructors, forgotten in 1.2.0, was added. The node type previously called
ConstructorDefinition
was renamed toCallableConstructorDefinition
(and itsceylon.ast.create
function accordingly), and a new typeValueConstructorDefinition
(including aceylon.ast.create
function), as well as a new supertypeConstructorDefinition
, were added. See #102. -
When adding conditional, let, and object expressions for 1.2.0, I did not realize that they could also appear within operations:
The expression ... is parsed with precedence just higher than the
||
operator, and just lower than thethen
andelse
operators, that is, between the layers 3 and 4 defined in §6.8.1 Operator precedence.To rectify this, a new precedence alias
StructureExpression
has been inserted betweenThenElseExpression
andDisjoiningExpression
. This also required thatBinaryOperation
andOperation
were slightly relaxed, now allowing anyExpression
as children rather than justValueExpression
s. See #104. -
switch
cases can contain certain expressions that, grammatically, are qualified expressions:switch (thing) case (package.someObject) {} case (SomeClass.valueConstructor) {}
This was not previously supported in
ceylon.ast
; to fix this, aMatchCase
may now also containQualifiedExpression
s. See #103. -
There are now two sets of methods to access a node’s additional information:
get
,put
, andremove
offer more type information, whilegetObject
,set
, anddelete
can be slightly faster. (set
already existed;getObject
anddelete
are new.) For those that use additional information very extensively and absolutely need it to perform the best possible, there is also a new, untyped fielddata
that can be directly set or gotten. Don’t use it. See #108. -
Visitor
no longer satisfiesWideningTransformer<Anything>
; instead, it’s an independent, unparameterized interface. This was done for performance reasons. This should have no effect on your code, unless you actually utilized this (mostly theoretical) connection. See #109. -
Various bugfixes and minor changes. See #105, #106, #107, #110.
The .car
files for this release have been made reproducible using a fork of Debian’s strip-nondeterminism
program. The following script, on a fresh Arch Linux system, should produce the exact same binary:
#!/bin/bash
# install dependencies
pacman -S --noconfirm \
git \
jdk8-openjdk \
wget \
curl \
apache-ant \
zip \
unzip \
perl-archive-zip \
python
# install Ceylon
cd /opt
wget https://downloads.ceylon-lang.org/cli/ceylon-1.2.1.zip
unzip ceylon-1.2.1.zip
export PATH="$PATH:/opt/ceylon-1.2.1/bin"
# build ceylon.ast
git clone https://github.com/ceylon/ceylon.ast
cd ceylon.ast
git checkout 1.2.1
sed -i 's|../ceylon/dist/dist|/opt/ceylon-1.2.1|' build.properties
ant compile
cd ..
modules=(ceylon.ast.{core,redhat,create,samples})
version=1.2.1
# strip nondeterminism
git clone https://github.com/lucaswerkmeister/strip-nondeterminism
cd strip-nondeterminism/lib
for module in "${modules[@]}"; do
car="../../ceylon.ast/modules/${module//\.//}/$version/$module-$version.car"
../bin/strip-nondeterminism -t car -T 1455380000 "$car"
echo -n $(sha1sum "$car" | cut -f1 -d' ') > "$car".sha1
done
# compare checksums
for module in "${modules[@]}"; do
echo
echo "$module"
cat "../../ceylon.ast/modules/${module//\.//}/$version/$module-$version.car.sha1"; echo
curl "https://modules.ceylon-lang.org/repo/1/${module//\.//}/$version/$module-$version.car.sha1"; echo
done
ceylon.ast 1.2.0
Changes from the previous version (1.1.0):
- Support for new language features
- To support constructors,
ConstructorDefinition
andConstructorDec
were added.ClassInstantiation
was replaced byExtensionOrConstruction
and its two subclasses,Extension
andConstruction
.ClassDefinition
was updated to make theparameters
optional.
See #71 and ceylon/ceylon-spec#796. LetExpression
,ObjectExpression
,ConditionalExpression
,IfElseExpression
,CaseExpression
andSwitchCaseElseExpression
were added.
See #65, #66, #67, and #68.- To support destructuring,
VariadicVariable
,Pattern
,VariablePattern
,TuplePattern
,EntryPattern
,SpecifiedPattern
,PatternList
andDestructure
were added.KeyValueIterator
was removed; instead, aForIterator
now has apattern
and aniterated
expression.ExistsCondition
andNonemptyCondition
now take aSpecifiedPattern
instead of aSpecifiedVariable
, and the child member was renamed fromvariable
totested
.
See #75 and ceylon/ceylon-spec#520. - Qualifiers of meta and declaration expressions, as well as of types, were updated.
PackageQualifier
was added. An optionalqualifier
was added toBaseType
. Instead of a nonempty list of eitherUIdentifier
s orLIdentifier
s, aDecQualifier
now has a possibly-empty list ofIdentifier
s, as well as an optionalPackageQualifier
. Since aDecQualifier
may now be empty, it is no longer optional as child of allDec
types.MetaQualifier
was removed, andMemberMeta
s are instead qualified by anyPrimaryType
. An optionalPackageQualifier
qualifier
was added toBaseMeta
.
See #80, ceylon/ceylon-spec#1243 and ceylon/ceylon-spec#1245. - The
identifier
ofModuleDec
,PackageDec
, andTypeDec
and its subclasses (ClassDec
,InterfaceDec
) is now optional to support the new abbreviated syntax for references:module
,class
etc.
See ceylon/ceylon-spec#1115. - A
SequentialType
now has an optionallength
(anIntegerLiteral
) to support the new length-based abbreviation for tuple types (which was already in Ceylon 1.1, but only specified in 1.2).
See #52 and ceylon/ceylon-spec#1041. - A
SwitchClause
now has aswitched
instead of anexpression
, which may be aSpecifiedVariable
as well as anExpression
. To avoid ambiguity, ifswitched
is anAssignOperation
, thetarget
may not be aBaseExpression
.
See #70 and ceylon/ceylon-spec#1119. SpreadType
, a type prefixed by an asterisk, was added. ACallableType
’sargumentTypes
may now be aSpreadType
as well as aTypeList
.
See #72 and ceylon/ceylon-spec#1121.- To support negated
exists
andnonempty
conditions, a flagnegated
was added toExistsOrNonemptyCondition
,ExistsCondition
andNonemptyCondition
.
See #76. - An optional
this
qualifier
was added toValueSpecification
andLazySpecification
.
See #78 and ceylon/ceylon-spec#1122. StringTemplate
was changed to contain anyExpression
s, not justValueExpression
s.
See #83 and ceylon/ceylon-spec#1270.TypeArguments
may now be empty.
See ceylon/ceylon-spec#791.IterableType
’svariadicType
is no longer optional. This was actually incorrect before, since ceylon/ceylon-spec#1005 was never added.
See #84.CallableParameter
andFunctionDeclaration
’stype
were changed to allow the same types asFunctionDefinition
:Type|VoidModifier|FunctionModifier|DynamicModifier
.
See 0124da5 and ceylon/ceylon-spec#1303.InterfaceBody
was changed to allow specification statements in addition to declarations.
See #91 and ceylon/ceylon-spec#1389.
- To support constructors,
- All
xToCeylon
andcompileX
functions now take an optional second parameter,update
. This is a function that is called once for every RedHat AST node and ceylon.ast node converted. It can be used to attach information from the RedHat AST node to the ceylon.ast node that was created from that RedHat AST node. The default value for this parameter isnoop
; the functionattachOriginalNode
is available as an alternative option, which attaches the original node using theoriginalNodeKey
.
See #87. FloatLiteral.float
andIntegerLiteral.integer
were removed. ceylon.ast now doesn’t evaluate any literals for you.
See #97 and #98.ExpressionIsh
was removed.
See #73.- The default instances of
SelfReference
types -thisInstance
,superInstance
,outerInstance
, andpackageInstance
- have been removed. If you used them, that was a mistake, since the assumption that they are indistinguishable was violated even in the 1.1.0 release by the introduction of extra info on nodes (see #17).
See ffc0af3. - The
annotations
parameter ofVariadicParameter
andCallablePArameter
now defaults to emptyAnnotations()
.
See 1249322. - The order of child nodes in
children
did not always match their order in source code. This was fixed.
See #77. - The
equals
method of all node types was rewritten to be smaller and (hopefully) more efficient.
See #79. - The type of certain
children
members was changed to be more precise, which had previously been prevented by several compiler bugs.
See 5661c23 and 446bc06. - JS modules are now also published to Herd (forgotten last release).
1.1.0
Initial release of ceylon.ast. Includes four modules:
ceylon.ast.core
: Pure Ceylon definition of a Ceylon Abstract Syntax Tree.
Includes interfaces to analyze (Visitor
), modify (Editor
) and operate on
(Transformer
) ASTs.ceylon.ast.redhat
: Conversion betweenceylon.ast
and RedHat AST nodes.
Required for interoperation with the compiler or the formatter.ceylon.ast.create
: Utility functions to simplify the creation of various
types of nodes.ceylon.ast.samples
: Demonstrations of various aspects ofceylon.ast
.
Google Summer of Code 2014 submission state
This is the state of ceylon.ast
as of 2014-08-18 19:00 UTC, the Google Summer of Code 2014 deadline.
The following syntactic elements of Ceylon have not yet been added:
- interfaces
- some types of named arguments
- switch/case
- try/catch/finally
- comprehensions
- dynamic blocks
- element expressions (
x[i]
,s[x..y]
) - different member operators:
.
,?.
,*.
- most decs (detyped metamodel literals)
- interface and type aliases (class aliases might change too)
- operator-style expressions
For all other syntactic elements of Ceylon, the following features are
available:
- An immutable Ceylon class representing the syntactic element (node), feasible for creation using named arguments (a highly readable syntax)
- Means to attach any amount of arbitrary information to any node, in a typesafe way (for example, a parser might attach tokens, a compiler may attach model information, etc.)
- A mechanism to operate on and transform nodes (
Transformer
), including- a way to implement any operations on nodes (
Visitor
) (transformation into nothing) - a scaffolding to edit and change nodes (
Editor
) (transformation into a copy of the same type)
- a way to implement any operations on nodes (
- A transformation of nodes into their textual representation: a Ceylon expression that, when evaluated, yields an exact copy of the node (
CeylonExpressionVisitor
,Node.string
) - Transformation of nodes to and from the RedHat compiler’s AST (
RedHatTransformer
) - Compilation of nodes from a code string, using the RedHat compiler’s parser and the aforementioned transformation
The core functionality resides in the ceylon.ast.core
module, which is implemented in pure Ceylon and backend-independent. The RedHat AST conversion and compilation resides in the ceylon.ast.redhat
module and naturally depends on the RedHat compiler; therefore, it is, like the RedHat compiler itself, only available for the Java backend.
The ceylon.ast.samples
module contains sample ASTs for illustratory, educational or testing purposes. Currently, the only sample available is the ceylon.ast.samples.helloworld
package, containing ASTs for a module descriptor, a package descriptor and a regular compilation unit which together form a complete "Hello, World!" program.