The warning messages for missing inherited equations have been improved by including an example AST path that lacks an equation for the attribute.
An example of the new warning messages: "missing inherited equation for attribute attr in class Expr when being child of X (path: Program->C->X->Expr)"
JastAdd no longer generates the Tracer
class when the --tracing
option is
absent.
Disabled the generation of an unused interface named Filter
. This interface
was generated by the previous version of JastAdd as a side-effect of how the
Tracer
class was generated.
Interface Modifiers: JastAdd strips all modifiers from interface declarations. This stripping of access modifiers is probably an unintentional error in the parser.
In future versions of JastAdd the interface modifiers will be retained in the generated code. Unfortunately if incorrect modifiers are given to an interface declaration in an aspect, then the generated code will fail to compile.
Note that the protected
, private
and static
modifiers are only
allowed on member interfaces (declared inside an enclosing class). Top-level
interface declarations should not use protected
, private
, or static
.
JastAdd now prints warning messages for each interface declaration that has any modifiers. Check that your interfaces use correct modifiers to ensure that your code continues to compile even with future JastAdd versions.
Type Declaration Modifiers: In addition to the stripping of modifiers
from interface declarations JastAdd alters the modifiers of class and
interface declarations by removing any occurrence of static
and adding the
public
modifier if the modifier list was empty.
We want to remove this behaviour from JastAdd, so a new warning message is
generated for all type declarations where the implicit public
modifier is
added. The message warns that future versions of JastAdd will cease to make the
class public
automatically. To silence the warning, simply add public
or
protected
modifiers to the declaration.
SuppressWarnings: JastAdd no longer generates @SuppressWarnings
annotations. The purpose of using the annotation was to reduce the number of
Java warnings in the generated code - however JastAdd was not smart enough to
correctly use the annotation, and if the annotation is incorrectly used it will
raise another warning. Ideally the number of warnings should be reduced by
generating better code instead.
The --suppressWarnings
flag, and corresponding JastAddTask option, has
been deprecated and will be removed from JastAdd in a future release.
Renaming ASTNode, List, Opt: New options have been added to JastAdd that
allow renaming the generated ASTNode
, List
and Opt
classes. The names
can be specified using the following command-line flags (corresponding options
for the Ant task are also available):
--ASTNode=<NewName>
ASTNode will be named "NewName"--List=<NewName>
List will be named "NewName"--Opt=<NewName>
Opt will be named "NewName"Annotations: Annotations are now supported for synthesized attributes and aspect-declared classes and interfaces!
Annotations on attributes are allowed before the attribute keyword (syn
,
eq
). For synthesized attributes the annotation is generated on the method
with the same name - not the "compute" method. Annotations are not yet
supported for other kinds of attributes although they should now produce more
readable error messages rather than standard mysterious parser syntax errors.
Tracing: Attribute evaluation tracing is now done in-memory by the
generated class Tracer
.
Comments: Fixed several issues with comments in the generated code:
@ast method
tagJastAdd now generates the utility method List.addAll(Collection)
which can
be used to initialize an AST List with a set of children.
List components now get a "has" accessor which returns true
if the list
component is non-empty.
Added flag --lineColumnNumbers
which makes JastAdd generate methods to get
and set start- and end positions for AST nodes.
The syntax for annotating collection attributes has been slightly changed.
Annotations are now only allowed before the coll
keyword, rather than
after. The supported annotations for collection attributes are not discussed in
the documentation, so we don't expect this change to affect anyone. It is
possible that these annotations will disappear in the future anyway - use at
your own peril!
Generated source files have been moved to the package org.jastadd
The build script now compiles to ant-bin in order to avoid conflicts with the eclipse project
fullCopy
to initialize NTA children with
incorrect child indices.org.jastadd
(but left a deprecated
class with the same name as a working entry point for backward compatibility)List
nodes (previously also affected
Opt
nodes)minListSize
optionfullFlush
was added to enable more thorough flush behaviour
(makes flushCache
flush rewrites and NTAs)ASTNode.copy()
now sets the parent pointer of the copy to null
ASTNode.getChild(ASTNode,int)
--doxygen
option is now deprecated--indent
command-line option which allows changing the
indentation in generated code. Can be set to tabs or 2-, 4-, and 8 space
indentation.