Skip to content

Releases: ceylon/ceylon.ast

ceylon.ast 1.3.3

19 Nov 19:13
1.3.3
Compare
Choose a tag to compare

ceylon.ast 1.3.3

Changes from the previous version (1.3.2):

  • A CaseClause and a CaseExpression have an additional boolean modifier, elseCase,
    indicating a non-disjoint case (syntax else case instead of just case). See #137.
  • A ModuleSpecifier has an additional Classifier (a new alias for StringLiteral). See #135.
  • A ModuleBody has an additional list constantDefinitions of ValueDefinitions, and a ModuleImport’s version may also be a BaseExpression. 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

24 Mar 22:17
1.3.2
Compare
Choose a tag to compare

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. A ModuleDescriptor and a ModuleImport can each have one (replacing a ModuleImport’s repositoryType member). The RepositoryType has been renamed to just Repository to match the specification (which did not exist when RepositoryType was added), and aliases Artifact, ModuleName and Module have been added. See #128, #129 and #133.
  • Assertion now has a StringLiteral|StringTemplate? message instead of Annotations annotations, defaulting to null. 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

07 Dec 15:21
1.3.1
Compare
Choose a tag to compare

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 and ImportElement 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:
    A MatchCase’s expressions may now contain Tuples.
    See #125.
  • Nested imports are now supported:
    Body now has a member Import[] imports
    analogous to the one in AnyCompilationUnit.
    In the subclass constructors, it defaults to [].
    See #126.
  • Assignment operations can now have any Expression
    on the right-hand side, not just AssigningExpressions.
    This has always been supported by the typechecker,
    but ceylon.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

18 Sep 22:38
1.3.0
Compare
Choose a tag to compare

ceylon.ast 1.3.0

Changes from the previous version (1.2.2):

  • ceylon.ast.redhat’s compileX functions have been renamed to parseX to better reflect their actual behavior. See #101 and b8f3959.
  • Support for repository types (aka namespaces) has been added. ModuleImport gained a new optional parameter repositoryType of type RepositoryType? (a new alias for LIdentifier). See 4aa9051.
  • An internal constructor for LIdentifier and UIdentifier 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 to Identifier to distinguish between valid and invalid identifiers. See #119.
  • The type of KeySubscript.key has been widened from AddingExpression to Expression. Only SpanOperation and MeasureOperation are not permitted as children. See #118.
  • The type of ExtensionOrConstruction.qualifier has been widened from BaseType|PackageQualifier|Super? to SimpleType|PackageQualifier|Super?, and the type of Extension.qualifier has been widened from PackageQualifier|Super? to PackageQualifier|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 and test-js-tap can be used to obtain Test Anything Protocol reports for the tests (written to files test-jvm.tap and test-js.tap).
  • The RedHat AST gained a new node type ParExpression for grouped expressions (instead of just an Expression with start and end token), so ceylon.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

08 Apr 19:27
1.2.2
Compare
Choose a tag to compare

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 longer default. They are usually not called anyways, since Editor satisfies ImmediateNarrowingTransformer, 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 the copy call and directly return the edited node, since for these nodes copy 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. If editNode returns false, the default implementations of the edit methods for non-leaf nodes will directly return the edited node without calling copy or editing child nodes. By default, editNode always returns true, 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 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

13 Feb 20:44
1.2.1
Compare
Choose a tag to compare

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 to CallableConstructorDefinition (and its ceylon.ast.create function accordingly), and a new type ValueConstructorDefinition (including a ceylon.ast.create function), as well as a new supertype ConstructorDefinition, 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 the then and else 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 between ThenElseExpression and DisjoiningExpression. This also required that BinaryOperation and Operation were slightly relaxed, now allowing any Expression as children rather than just ValueExpressions. 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, a MatchCase may now also contain QualifiedExpressions. See #103.

  • There are now two sets of methods to access a node’s additional information: get, put, and remove offer more type information, while getObject, set, and delete can be slightly faster. (set already existed; getObject and delete 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 field data that can be directly set or gotten. Don’t use it. See #108.

  • Visitor no longer satisfies WideningTransformer<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

08 Nov 17:43
1.2.0
Compare
Choose a tag to compare

Changes from the previous version (1.1.0):

  • Support for new language features
    • To support constructors, ConstructorDefinition and ConstructorDec were added. ClassInstantiation was replaced by ExtensionOrConstruction and its two subclasses, Extension and Construction. ClassDefinition was updated to make the parameters optional.
      See #71 and ceylon/ceylon-spec#796.
    • LetExpression, ObjectExpression, ConditionalExpression, IfElseExpression, CaseExpression and SwitchCaseElseExpression were added.
      See #65, #66, #67, and #68.
    • To support destructuring, VariadicVariable, Pattern, VariablePattern, TuplePattern, EntryPattern, SpecifiedPattern, PatternList and Destructure were added. KeyValueIterator was removed; instead, a ForIterator now has a pattern and an iterated expression. ExistsCondition and NonemptyCondition now take a SpecifiedPattern instead of a SpecifiedVariable, and the child member was renamed from variable to tested.
      See #75 and ceylon/ceylon-spec#520.
    • Qualifiers of meta and declaration expressions, as well as of types, were updated. PackageQualifier was added. An optional qualifier was added to BaseType. Instead of a nonempty list of either UIdentifiers or LIdentifiers, a DecQualifier now has a possibly-empty list of Identifiers, as well as an optional PackageQualifier. Since a DecQualifier may now be empty, it is no longer optional as child of all Dec types. MetaQualifier was removed, and MemberMetas are instead qualified by any PrimaryType. An optional PackageQualifier qualifier was added to BaseMeta.
      See #80, ceylon/ceylon-spec#1243 and ceylon/ceylon-spec#1245.
    • The identifier of ModuleDec, PackageDec, and TypeDec 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 optional length (an IntegerLiteral) 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 a switched instead of an expression, which may be a SpecifiedVariable as well as an Expression. To avoid ambiguity, if switched is an AssignOperation, the target may not be a BaseExpression.
      See #70 and ceylon/ceylon-spec#1119.
    • SpreadType, a type prefixed by an asterisk, was added. A CallableType’s argumentTypes may now be a SpreadType as well as a TypeList.
      See #72 and ceylon/ceylon-spec#1121.
    • To support negated exists and nonempty conditions, a flag negated was added to ExistsOrNonemptyCondition, ExistsCondition and NonemptyCondition.
      See #76.
    • An optional this qualifier was added to ValueSpecification and LazySpecification.
      See #78 and ceylon/ceylon-spec#1122.
    • StringTemplate was changed to contain any Expressions, not just ValueExpressions.
      See #83 and ceylon/ceylon-spec#1270.
    • TypeArguments may now be empty.
      See ceylon/ceylon-spec#791.
    • IterableType’s variadicType is no longer optional. This was actually incorrect before, since ceylon/ceylon-spec#1005 was never added.
      See #84.
    • CallableParameter and FunctionDeclaration’s type were changed to allow the same types as FunctionDefinition: 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.
  • All xToCeylon and compileX 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 is noop; the function attachOriginalNode is available as an alternative option, which attaches the original node using the originalNodeKey.
    See #87.
  • FloatLiteral.float and IntegerLiteral.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, and packageInstance - 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 of VariadicParameter and CallablePArameter now defaults to empty Annotations().
    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

16 Oct 14:49
1.1.0
Compare
Choose a tag to compare

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 between ceylon.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 of ceylon.ast.

Google Summer of Code 2014 submission state

27 Aug 19:17
gsoc-2014
Compare
Choose a tag to compare

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 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.