transformation Reserve2Java: Reserve ==> Java { transform { Java, CompilationUnit, PackageDeclaration, ImportDeclarations, ImportDeclaration, ImportName, TypeDeclarations, TypeDeclaration, InterfacesOpt, Interfaces, InterfaceTypeList, ClassType, InterfaceType, Modifiers, Modifier, ModifiersOpt, ClassDeclaration, SuperOpt, Super, ClassBody, ClassBodyDeclarations, ClassBodyDeclaration, ClassMemberDeclaration, StaticInitializer, InterfaceDeclaration, ExtendsInterfacesOpt, ExtendsInterfaces, ExtendsInterfacesRest, InterfaceBody, InterfaceMemberDeclarationsOpt, InterfaceMemberDeclarations, InterfaceMemberDeclaration, ConstantDeclaration, AbstractMethodDeclaration, FieldDeclaration, VariableDeclarators, VariableDeclarator, VariableDeclaratorId, VariableDeclaratorIdRest, VariableInitializer, ArrayInitializer, VariableInitializersOpt, VariableInitializers, MethodDeclaration, MethodHeader, MethodDeclarator, MethodDeclaratorRest, MethodBody, FormalParameterListOpt, FormalParameterList, FormalParameter, ThrowsOpt, Throws, ClassTypeList, ConstructorDeclaration, ConstructorDeclarator, ConstructorBody, ExplicitConstructorInvocationOpt, ExplicitConstructorInvocation, ConstructorModifier, Type, ReferenceType, ArrayTypeRest, PrimitiveType, NumericType, IntegralType, FloatingPointType, ResultType, Statement, LabeledStatement, Block, BlockStatements, BlockStatement, LocalVariableDeclaration, LocalVariableDeclarationRest, EmptyStatement, StatementExpression, SwitchStatement, SwitchBlocks, SwitchLabel, IfStatement, WhileStatement, DoStatement, ForStatement, ForInitOpt, ForInit, StatementExpressionList, ForUpdateOpt, ForUpdate, BreakStatement, ContinueStatement, ReturnStatement, ThrowStatement, SynchronizedStatement, TryStatement, Catchblock, ExpressionOpt, Expression, AssignmentOperator, ConditionalExpression, ConditionalOrExpression, ConditionalOrExpressionRest, ConditionalAndExpression, ConditionalAndExpressionRest, InclusiveOrExpression, InclusiveOrExpressionRest, ExclusiveOrExpression, ExclusiveOrExpressionRest, AndExpression, AndExpressionRest, EqualityExpression, EqualityExpressionRest, InstanceOfExpression, RelationalExpression, RelationalExpressionRest, ShiftExpression, ShiftExpressionRest, AdditiveExpression, AdditiveExpressionRest, MultiplicativeExpression, MultiplicativeExpressionRest, UnaryExpression, PreIncrementExpression, PreDecrementExpression, UnaryExpressionNotPlusMinus, PostfixExpression, CastExpression, PrimaryExpression, PrimaryExpressionRest, PrimaryPrefix, PrimarySuffix, Literal, BooleanLiteral, NullLiteral, Arguments, ArgumentList, AllocationExpression, ArrayDimsAndInits, ArrayDimsExpression, ArrayDims, Name, SimpleName, QualifiedName, IntegerLiteral; } transform AcqIds: Identifiers ==> Statement; transform RelIds: Identifiers ==> Statement; Statement[reserve](Is,S) Is.AcqIds()=>Ac, S()=>S, Is.RelIds()=>Re ==> << { } >> AcqIds[one](I) ==> << acquire( ); >> AcqIds[more](I,Is) Is.AcqIds()=>Is ==> << { acquire( ); } >> RelIds[one](I) ==> << release( ); >> RelIds[more](I,Is) Is.RelIds()=>Is ==> << { release( ); } >> }