-- @name aspect fortran -- @version 1.0 -- @authors Suman Roychoudhury -- @description This metamodel defines the abstract syntax of AspectFortran that extends Generic Aspect package AFortran { class AFortran extends GAspect { } abstract class FuncOrSubDefExpr extends Expression { reference func_sub_Sig container : FuncOrSubSignature; } class ExecExpr extends FuncOrSubDefExpr { } class WithinCodeExpr extends FuncOrSubDefExpr { } class NotWithinCodeExpr extends FuncOrSubDefExpr { } abstract class FuncOrSubSignature extends LocatedElement { attribute name : String; } abstract class FuncOrSubDef extends FuncOrSubSignature { reference paramdefs[*] container : FortranParamDef; } class FuncDef extends FuncOrSubDef { } class SubDef extends FuncOrSubDef { } class FortranParamDef extends ParameterDef { } class CallExpr extends Expression { reference func_sub_Sig container : FuncOrSubSignature; } class FuncOrSubCallExpr extends FuncOrSubSignature { reference params[*] container : Parameter; } class DoLoop extends LoopStatement { } } package GAspect { abstract class LocatedElement { attribute location[0-1] : String; attribute commentsBefore[*] ordered : String; attribute commentsAfter[*] ordered : String; } -- BEGIN DSL-specific classes class GAspect extends LocatedElement { attribute name : String; reference domain container : Domain; reference pointcut[*] container : Pointcut oppositeOf aspect; reference advice[*] container : Advice oppositeOf aspect; } class Domain extends LocatedElement { attribute name : String; } abstract class Element extends LocatedElement { attribute name : String; } class Parameter extends LocatedElement { attribute name : String; } abstract class ParameterDef extends LocatedElement { attribute name : String; attribute type : String; } class Pointcut extends Element { reference aspect : GAspect oppositeOf pointcut; reference paramdefs[*] container : ParameterDef; reference pctexpr[*] container : Expression oppositeOf pointcut; } -- have to link the paramdefs of pointcut to paramdefs of advice abstract class Advice extends LocatedElement { reference aspect : GAspect oppositeOf advice; reference pctname : Element; reference paramdefs[*] container : ParameterDef; reference advStmt[*] container : Statement; } class BeforeAdvice extends Advice { } class AfterAdvice extends Advice { } class ProccedStatement extends Statement { } class AroundAdvice extends Advice { } abstract class Expression extends LocatedElement { reference pointcut : Pointcut oppositeOf pctexpr; } class ArgsExpr extends Expression { attribute name : String; } abstract class Statement extends LocatedElement { } abstract class LoopStatement extends Statement { reference loopInitCondition container : LoopInitCondition; reference loopExitCondition container : LoopExitCondition; reference loopStrideCondition container : LoopStrideCondition; } abstract class LoopInitCondition extends LocatedElement { } abstract class LoopExitCondition extends LocatedElement { } abstract class LoopStrideCondition extends LocatedElement { } class IntegerLoopInitCondition extends LoopInitCondition { attribute condition :Integer; } class IntegerLoopExitCondition extends LoopExitCondition { attribute condition :Integer; } class IntegerLoopStrideCondition extends LoopStrideCondition { attribute condition :Integer; } class StringLoopInitCondition extends LoopInitCondition { attribute condition :String; } class StringLoopExitCondition extends LoopExitCondition { attribute condition :String; } class StringLoopStrideCondition extends LoopStrideCondition { attribute condition :String; } class OpaqueStatement extends Statement { attribute stmt : String; } class TryCatchFinallyStatement extends Statement { reference stmts[1-*] ordered container : Statement; reference finallyStmts[*] ordered container : Statement; reference catchStmts[*] ordered container : CatchStatement; } class CatchStatement extends LocatedElement { reference stmts[*] container : Statement; reference exceptions[*] container : ParameterDef; } class LoopExpr extends Expression { reference loopStmt container : LoopStatement; } -- END DSL-specific classes } package PrimitiveTypes { datatype Boolean; datatype Integer; datatype String; }