Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Technique for Constructing Aspect Weavers using a Program Transformation Engine Jeff Gray Suman Roychoudhury Department of Computer and Information Sciences.

Similar presentations


Presentation on theme: "A Technique for Constructing Aspect Weavers using a Program Transformation Engine Jeff Gray Suman Roychoudhury Department of Computer and Information Sciences."— Presentation transcript:

1 A Technique for Constructing Aspect Weavers using a Program Transformation Engine Jeff Gray Suman Roychoudhury Department of Computer and Information Sciences University of Alabama at Birmingham

2 Program Transformation - A Definition A program is a structured object with semantics. The structure allows us to transform a program. Program transformation is the act of changing one program (source) into another (target). The source and target languages could be the same, but sometimes could be different too.

3 An AST representation The structure of the source tree is defined by the production rules associated with the grammar… Condition StatementExpression Statement IfReturn... VarLiteral... CompoundBooleanExpr Statement Node

4 Transforming the source Plug in new nodes… Condition StatementExpression Statement IfReturn... VarLiteral... CompoundBooleanExpr Statement List Node Condition Statement IfReturnCompound...

5 Case Study Processing Dialog Meter Logging of SQL Query Statements Language Internationalization Utility Database Error Handler Synchronization

6 Processing Dialog Meter Inc(TotalInserts); if not ProcDlg1.Process(TotalInserts/TotalCalc) then begin ProcDlg1.Canceled := True; Result := True; exit; end; // if not Process

7 Logging of SQL Query Statements with dmSERVERS.qryCreateTriggers do begin LogSQL.AddSQL(dmSERVERS.qryCreateTriggers, True); ExecSQL; end;

8 Language Internationalization Utility // The user wants to perform another search using //the same search criteria procedure TLangMan.SearchAgainClick(Sender: TObject); begin // Perform an update if an edit occurred that //might change the focus of the listview if EditMadeDirtyBit then SaveDBControls; … end;

9 Database Error Handler Synchronization function TExNullField.Handle(ServerType: TServerType; E : EDBEngineError) : Integer; begin TExHandleCollection(Collection).LockHandle; try finally TExHandleCollection(Collection).UnLockHandle; end;

10 Weaver Construction Aspect Source Attribute Evaluator RSL Rules DMS Transformat ion Engine Lexer Parser PARLANSE f (x) Delphi Source Transformed Delphi Source Pattern Instantiation FRONT END BACK END


Download ppt "A Technique for Constructing Aspect Weavers using a Program Transformation Engine Jeff Gray Suman Roychoudhury Department of Computer and Information Sciences."

Similar presentations


Ads by Google