A Technique for Constructing Aspect Weavers using a Program Transformation Engine - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

A Technique for Constructing Aspect Weavers using a Program Transformation Engine

Description:

Program transformation is the act of changing one program ... DMS Transformation Engine. Lexer. Parser. PARLANSE f (x) Delphi Source. Transformed Delphi Source ... – PowerPoint PPT presentation

Number of Views:69
Avg rating:3.0/5.0
Slides: 11
Provided by: Sum44
Category:

less

Transcript and Presenter's Notes

Title: A Technique for Constructing Aspect Weavers using a Program Transformation Engine


1
A Technique for Constructing Aspect Weavers
using a Program Transformation Engine
  • Jeff Gray
  • Suman Roychoudhury

Department of Computer and Information
SciencesUniversity 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

Statement Node
Condition Statement
Expression Statement
...
...
If
Return
Var
Literal
Compound
BooleanExpr
4
Transforming the source
  • Plug in new nodes

Statement List Node
Condition Statement
Expression Statement
...
...
If
Return
Var
Literal
Compound
BooleanExpr
Condition Statement
If
Return
Compound
...
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
  • ltstatements that build a SQL Create Triggergt
  • 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
  • ltdatabase error handling code omitted
    heregt
  • finally
  • TExHandleCollection(Collection).UnLockHandle
  • end
  • end

10
Weaver Construction
Write a Comment
User Comments (0)
About PowerShow.com