bb5288f035dfc5514f5dd61a151c4db7.ppt
- Количество слайдов: 64
Grammar-Driven Generation of Domain-Specific Language Testing Tools Using Aspects Ph. D. Defense Hui Wu wuh@cis. uab. edu http: //www. cis. uab. edu/wuh 10/29/2007 Advisor: Dr. Jeff Gray Thesis Committee: Dr. Barrett Bryant Dr. Brian Toone Dr. Chengcui Zhang Dr. Marjan Mernik Dr. Mikhail Auguston
Overview of Presentation Eclipse PDE Motivation Domain-Specific Languages Raise AOP to a higher level of abstraction Background Research Goals My Approach Lack of end-user DSL testing tools Testing support for DSLs public class Robot{ … x=0; y=0; time=0; //move left move_left(); Generative Programming Evaluation AOP Experimental Evaluation and Generality Analysis 2
Categories of DSL End-Users Spreadsheet Admin Assistants Business Person Auto Factory Worker Scientist Business Query Systems Modeling Language DSL for Physics 3
The Benefits of Using DSLs • Case studies and empirical evaluations documented in the research literature have identified the following benefits of DSLs – DSLs can hide the lower level programming language details from end-user programmers – DSLs assist in software maintenance whereby endusers can directly use the DSLs to make required routine modifications – DSLs assist end-users in writing more concise, descriptive, and platform independent programs – The use of DSLs increases flexibility, productivity, reliability, and usability; shorten the application development time and reduce the development cost significantly 4
Motivation of Proposed Research Editor Domain Experts program at DSL level Compiler Visualizer Domain Experts deal with GPL Debugger Test Engine DSL translated into General Purpose Language (GPL) Profiler Integrated Development Environment (IDE) Domain Experts deal with DSL 5
Mismatch Between Abstraction Levels ANTLR Grammar …. commands : ( c: command cs: commands | ) ; command : ( RIGHT { fileio. print("//move right"); fileio. print("x=x+1; "); fileio. print("time=time+1; "); fileio. print(" "); } |LEFT { fileio. print("//move left"); fileio. print("x=x-1; "); fileio. print("time=time+1; "); fileio. print(" "); … Generated Java Parser Code …. public final void commands() throws Recognition. Exception, Token. Stream. Exception { try { // for error handling { switch ( LA(1)) { case CALL: case INIT: case SET: case PRINT: { command(); commands(); break; } case END: { break; } default: { throw new No. Viable. Alt. Exception(LT(1), get. Filename()); … public final void function_name() throws Recognition. Exception, Token. Stream. Exception { try { // for error handling { switch ( LA(1)) { case RIGHT: { match(RIGHT); fileio. print(" //move right"); fileio. print(" move_right(); "); fileio. print(" "); break; } case LEFT: { match(LEFT); sllinenumber=dsllinenumber+1; fileio. print(" //move left"); fileio. print(" move_left(); "); fileio. print(" "); break; } … 6
Research Goal • A Matrix of DSL Testing Tools Imperative DSL Debugger Declarative DSL Debugger Hybrid DSL Debugger Imperative DSL Test Engine Declarative DSL Test Engine Hybrid DSL Test Engine Imperative DSL Profiler Declarative DSL Profiler Hybrid DSL Profiler Aspect. G Future Work after Ph. D • Generalized approach to automatically produce a software product line of DSL testing tools from DSL grammars
Outline • Background • DSL Debugging Framework (DDF) • DSL Unit Testing Framework (DUTF) • Aspect. G • Future Work and Conclusion 8
Different Types of Debuggers • Categorized by [Zellweger, 1984] based on behavior of a debugger – expected behavior debugger – truthful behavior debugger • Categorized by [Auguston, 1998] based on the behavioral models of higher level debugging mechanisms – algorithmic debugger – declarative debugger – event-based debugger • The work in this dissertation represents expected behavior debuggers that perform typical debugging tasks on DSL programs 9
Categories of Domain-Specific Languages • Imperative DSL – Robot DSL • Declarative DSL – Feature Description Language (FDL) – Backus–Naur Form (BNF) language syntax specification • Hybrid DSL – Swing User-interface Language (SWUL) – Hybrid Robot DSL 10
Categories of Domain-Specific Languages • Imperative DSL: Centered around assignment expressions or control flow statements – Robot Language … 17 18 19 … 21 22 23 24 25 26 27 28 … Down: position(+0, -1) Down: Init position(0, 0) Call left Call down Call knight Set position(5, 6) Call up Call right Print position 11
Categories of Domain-Specific Languages • Declarative DSL: declares the relationship between inputs and outputs – Feature Description Language (FDL) 1 2 3 4 5 6 Car : all (Carbody, Transmission, Engine, Horsepower, opt(pulls. Trailer)) Transmission : oneof (automatic, manual) Engine : moreof (electric, gasoline) Horsepower : oneof (low. Power, medium. Power, high. Power) include pulls. Trailer requires high. Power – Backus–Naur Form (BNF) language syntax specification: a set of derivation rules START : : = begin COMMANDS end ; COMMANDS : : = COMMANDS | epsilon ; COMMAND : : = left | right | up | down ; 12
Categories of Domain-Specific Languages • Hybrid DSL: embedded GPL code within the DSL description (Robot) … Random: { String answer; int max; JOption. Pane my. GUI = new JOption. Pane(); Random rand = new Random(); answer = my. GUI. show. Input. Dialog("Generate a random number for X-axis between 1 and "); max = Integer. parse. Int(answer); x = rand. next. Int(max); answer = my. GUI. show. Input. Dialog("Generate a random number for Y-axis between 1 and "); max = Integer. parse. Int(answer); y = rand. next. Int(max); my. GUI. show. Message. Dialog(null , "Generated Position(" + x + ", " + y+ ")"); } Random: … Init position(0, 0) Call left Call down Call knight Set position(5, 6) Call up Call random Call right Print position … 13
Categories of Domain-Specific Languages • Hybrid DSL: embedded DSL description (SWUL) within the GPL code import javax. swing. *; import java. awt. *; public class Welcome. Swing { public static void main(String[] ps) { JFrame frame = frame { title = "Welcome!" content = panel of border layout { center = label { text = "Hello World" } south = panel of grid layout { row = { button { text = "cancel" } button { text = "ok" } } }; frame. pack(); frame. set. Visible(true); } } 14
Eclipse Plug-In Based Software Development • Eclipse Debug Perspective • JUnit Eclipse Plug-in a) Variable Inspector b) Navigation Toolbar 15
Program Transformation with the Design Maintenance System • Design Maintenance System (DMS) is a transformation and re-engineering toolkit developed by Semantic Designs • Provides lower level transformation functions such as parsing, AST generation and manipulation, pretty printing, powerful pattern matching, and source translation capabilities • Pre-constructed domains for several dozen GPLs (e. g. , Java, C++, and Object Pascal) • This research required the creation of a new domain for ANTLR 16
Overview of my Approach Syntax-Directed Translation Eclipse Plug-In Based Software Development ANTLR public class Robot{ … x=0; y=0; time=0; //move left move_left(); Design Patterns Generative Programming Model-View-Controller Adapter Pattern Aspect-Oriented Programming on DSL Grammars pointcut productions(): within(command. *); before(): productions() { dsllinenumber=dsllinenumber+1; } … Aspect. G 17
Outline • Background • DSL Debugging Framework (DDF) • DSL Unit Testing Framework (DUTF) • Aspect. G • Future Work and Conclusion 18
DSL Debugging Framework (DDF) 19
Process of DSL Debugger Generation DSL the input DSL is grammar of isthe Lexer and defined using ANTLR Parser generated Notation by ANTLR Robot DSL corresponding GPL code generated in Java DSL translation process Additional Mapping code generated in Java Corresponding GPL and Mapping Code are inputs of Mapping Eclipse Debugging component perspective jdb communicates with communicates mapping component with mapping component 20
Source Code Mapping … 3 4 5 6 7 8 9 10 11 12 13 14 15 16 … knight: position(+0, +1); position(+1, +0); knight: … Init position(0, 0); left; down; knight; Set position(5, 6); up; right; Print position; … 6 7 8 9 10 11 12 13 14 15 … 18 … 20 21 … 26 27 … public static void move_knight(){ x=x+0; y=y+1; x=x+1; y=y+0; } public static void main(String[] args) { x=0; y=0; move_knight(); x = 5; y = 6; System. out. println("x coordinate="+x+""+ "y coordinate= " + y); } {13, "Robot. java", 20, 21, "main", "none"} 21
Debugging Methods Mapping DSL GPL Source Code n_i maps to m_i to m_j Line Number: n_1 n_2 n_. . . n_i+1 n_. . . n_j+1 n_. . . Line Number: m_1 m_2 m_. . . m_i+1 m_. . . m_j+1 m_. . . Breakpoint Set breakpoint at n_i Set breakpoint at m_i Step Over Step over line at n_i Step Over algorithm Step Into Step into line at n_i Step Into algorithm Terminate at line n_i Terminate at line m_i Resume at line n_i Resume at line m_i 22
DSL Debugging Step Over Algorithm 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 if (function name equals “main”) { if (dsl_line_number < last line number of DSL code) { set breakpoint at gpl_line_number corresponding to dsl_line_number+1 call cont() } else { call cont() step over last line of DSL code, debugging session terminated } current dsl_line_number increased by one; } else { get function_type from mapping information base if (function_type equals "functionbody") { current dsl_line_number increased by one for all the statements corresponding to this one line of DSL code { call step() } } else if (function_type equals "functionend") { call step() assign current dsl_line_number as previous_dsl_line_number + 1 } } 23
Debugging Results Mapping 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | INIT var: VARIABLES LPAREN init_num 1: NUMBER COMMA init_num 2: NUMBER RPAREN { dsllinenumber=dsllinenumber+1; fileio. print("x="+init_num 1. get. Text()+"; "); fileresult. print("x_coordinate=print x"); gplbeginline=fileio. get. Linenumber(); fileio. print("y="+init_num 2. get. Text()+"; "); fileresult. print("y_coordinate=print y"); fileio. print("time=0"+"; "); gplendline=fileio. get. Linenumber(); filemap. print("mapping. add(new Map("+dsllinenumber+", "Robot. java", "+ gplbeginline +", "+gplendline+", "+"""+funcname+"""+", "+"""+funcall+"""+")); "); fileresult. print(variable=var. get. Text()+"(x_coordinate, y_coordinate)"); } Black: Basic functionality Blue: Source code mapping Red: Debugging results mapping 24
Generated DSL Debuggers 25
Imperative DSL Debugger 26
Declarative DSL (FDL) Debugger 27
Declarative DSL (BNF) Debugger Version 1 28
Declarative DSL (BNF) Debugger Version 2 29
Hybrid Robot Debugger (Java embedded in DSL) 30
Hybrid SWUL Debugger (DSL embedded in Java) 31
Hybrid SWUL Debugger Video Demo • There are 7 sets of demos in 3 different video formats • Available at: www. cis. uab. edu/wuh/ddf/demos. html
Generality Analysis of DDF • 19 software components: 3, 429 lines of code can be reused DSL Category DSL Name Number of Specific Functions or Classes Imperative DSL Robot Language 2 69 Declarative DSL FDL 3 89 BNF 5 261 Hybrid Robot Language 4 117 SWUL 5 152 Hybrid DSL Customized Lines of Code 33
JDB, GDB, and Cordbg Basic Debugging Commands Comparison Debugging Actions JDB (Java) GDB (C++) Cordbg (C#) Set a Breakpoint stop at class: line number break filename: linenumber b[reak] [[file: ] line number] | [[ class: : ] function [: offset]] Step Over step [count] n[ext] [count] Display Value print class. staticfield print expr p[rint] [variable name] Terminate Exit quit Exit Resume continue [ignorecount] cont [count] 34
Related Work in the Area of Domain-Specific Language Debuggers • Khepera – Support optimization code debugger; store transformation in a database – Execution time and cost are high • JSR-045 – Establishes standardized debugging tools for correlating Java bytecode to the source code of languages other than Java – Does not have a debugging result mapping process • ANTLR Studio – An example of a hybrid debugger – Based on the JSR-045 mapping mechanism – Display only Java variable values • TIDE – Although uses gdb, TIDE requires the end-user to understand a precise language specification in ASF+SDF – Knowledge of the rewrite rules in the built-in library is required to construct a debugger for a new language 35
Outline • Background • DSL Debugging Framework (DDF) • DSL Unit Testing Framework (DUTF) • Aspect. G • Future Work and Conclusion 36
DSL Application Software Errors! • Before locating software errors how do we know there are bugs inside a DSL application? 37
DSL Unit Testing Framework (DUTF) • Complement to the DDF – the DUTF assists in identifying the presence of errors and the DDF assists in isolating the specific location of the error • Architecture and process of construction is similar to the DSL Debugging Framework (DDF) architecture 38
DSL Unit Testing Framework (DUTF) 39
DSL Unit Testing Framework (DUTF) • Test Cases Mapping 1 2 3 4 5 6 … Robot DSL Unit Test Case Test. Case testknight { Init position(0, 0); Expectedposition(1, 2); knight; Assert. Equal (Expectedposition, position); } 11 12 13 14 15 16 17 18 19 … GPL Unit Test Case (JUnit) public void testkinght() { robot. x = 0; robot. y =0; int x=1; int y=2; robot. move_knight(); assert. Equals(x, robot. x); assert. Equals(y, robot. y); } {1, “Test. Robot. java”, 11, “testknight”} 40
DSL Unit Testing Framework (DUTF) • Test Cases Mapping 1 2 3 4 5 6 7 } 11 12 13 14 … 27 28 … Car FDL Unit Test Case Test. Case test. Features { Expectedfeature: (carbody, manual, high. Power); use Car. FDL(All); Constraint C 1: include pulls. Trailer; Assert. True(contain(Expectedfeature, feature)); Assert. Equal(6, numberof feature); GPL Unit Test Case (JUnit) public void test. Features () { test. Features. add("carbody"); test. Features. add("manual"); test. Features. add("high. Power"); assert. True(compare. Features(test. Features, parse(fc, root, cons))); assert. Equals(6, get. Feature. List. Number(parse(fc, root, cons))); 41
DSL Unit Testing Framework (DUTF) Robot Language Unit Test Engine 42
DSL Unit Testing Framework (DUTF) FDL Unit Test Engine 43
Generality Analysis on DUTF • Among 22 software components in DUTF, there are 3, 001 lines of code that are generalized and reused to generate the different DSL unit test engines. DSL Category DSL Name Number of Specific Functions or Classes Customized Lines of Code Imperative DSL Robot Language 2 239 Declarative DSL FDL 4 482 44
JUnit and NUnit Basic Unit Test Actions Comparison Unit Test Actions JUnit (Java) NUnit (. Net languages) Equality Assertion assert. Equals (expected, actual) Assert. Are. Equal (expected, actual); assert. True(actual) Assert. Is. True(actual) assert. False(actual) Assert. Is. False(actual) assert. Null(actual) Assert. Is. Null(actual) Utility Method fail() Assert. Fail() Identity Assert assert. Same (expected, actual) Assert. Are. Same (expected, actual) Condition Test 45
Related Works in the Area of Domain-Specific Language Tools • ASF+SDF – Generate program analysis and transformation tools, and produce software renovation tools – The unit testing tool support has not been reported • JST – Complicated mechanism (e. g. , Language extension) – Does not focus on language tools generation • LISA – Can generate editor, parser, and visualizer for new languages – Debugger, test engine, and profiler are not the target language tools, LISA can be used as the front-end of our framework • Smart. Tools – Base on Java and XML technologies – Debugger, test engine, and profiler are not target language tools • Other Related Testing Tools – – Parameterized unit testing Testing grammar-driven functionality Generating unit tests using symbolic execution Generating test inputs of Aspect. J programs 46
Outline • Background • DSL Debugging Framework (DDF) • DSL Unit Testing Framework (DUTF) • Aspect. G • Future Work and Conclusion 47
Crosscutting Concerns in Tool Generation Process Crosscutting concerns observed in DSL grammars during the generation of DSL debuggers and unit test engines How do we address such concerns in DSL grammars? 48
Aspect. G • Crosscutting concerns emerge in different software artifacts (e. g. , model, grammar, and source code) • Aspect. G: A domain-specific aspect language for language grammars written in ANTLR 49
Addition of Debugging Support: A Crosscutting Grammar Concern Base Grammar … command : ( RIGHT { What if this line changes? fileio. print(" //move right"); x=x+1; "); fileio. print(" time=time+1; "); Change here Duplicate Debugging Aspect Code dsllinenumber=dsllinenumber+1; fileio. print(" "); gplbeginline=fileio. get. Linenumber(); } |LEFT { gplendline=fileio. get. Linenumber(); fileio. print(" //move left"); x=x-1; "); fileio. print(" time=time+1; "); filemap. print(" mapping. add(new Map("+dsllinenumber+", "Robot. java", "+gplbeginline+", "+gplendline +")); "); Change here fileio. print(" "); } | … Change …… 50
Aspect. G Design Challenge • Design of a join point model for Aspect. G – What are the join points that will be captured in Aspect. G? – Are Aspect. G join points static or dynamic? – What is an appropriate pointcut language syntax to describe these join points? – What are advice in this domain? – Does the ordering of the advice matter? If so, how is the weaving order prioritized? – How to deal with weaving conflicts and avoid infinite weaving? 51
Join Point Model for Aspect. G ANTLR Grammar … command : ( RIGHT { dsllinenumber=dsllinenumber+1; fileio. print("x=x+1; "); gplbeginline=fileio. get. Linenumber(); fileio. print("time=time+1; "); gplendline=fileio. get. Linenumber(); fileio. print(" "); filemap. print(" mapping. add(new Map("+ dsllinenumber+", "Robot. java", "+gplbeginline+ ", "+gplendline+")); "); } … Aspect. G pointcut productions(): within(command. *); pointcut count_gpllinenumber(): within(command. *) && match (fileio. print("time=time+1; ")); before(): productions() {dsllinenumber=dsllinenumber+1; } before(): count_gpllinenumber() {gplbeginline=fileio. get. Linenumber(); } after(): count_gpllinenumber() {gplendline=fileio. get. Linenumber(); } after(): productions() {filemap. print(" mapping. add(new Map("+ dsllinenumber+", "Robot. java", "+gplbeginline+ ", "+gplendline+")); "); } 52
Weaving into DSL Grammars Using Aspect. G aspect debugging ( pointcut productions(): within{command. *}; default base domain Antlr. pointcut count_gpllinenumber(): within {command. *} && … command : ( RIGHT { fileio. print("//move right"); fileio. print("x=x+1; "); fileio. print("time=time+1; "); fileio. print(" "); … external pattern mid_advice(bef_adv: semantic_strings, … match {fileio. print("time=time+1; ")}; semico: QUOTED_STRING, command orig_stmt: semantic): : ( RIGHT begin(): productions() semantic = 'mid_advice' in domain Antlr. { { dsllinenumber=dsllinenumber+1; } dsllinenumber=dsllinenumber+1; rule print_mid_stree(java_seq: semantic): semantic -> semantic fileio. print("//move right"); after(): count_gpllinenumber() = " java_seq " -> "mid_advice(mi_advice() , semi(), java_seq)" gplbeginline=fileio. get. Linenumber(); if java_seq ~= {gplbeginline=fileio. get. Linenumber(); semi(), ": semantic fileio. print("x=x+1; "); mid_advice(mi_advice() , java_seq)". gplendline=fileio. get. Linenumber(); } gplendline=fileio. get. Linenumber(); ) fileio. print("time=time+1; "); pattern mi_advice(): semantic_strings filemap. print(" mapping. add(new = Map("+dsllinenumber+", "command; gplbeginline=fileio. get. Linenumber(); ". "Robot. java", "+gplbeginline+", "+gplendline+")); "); fileio. print(" "); pattern semi(): QUOTED_STRING … = ""time=time+1; "". public ruleset a = { print_mid_stree }. 53
Steps to Weave Debugging Aspects into an ANTLR Grammar 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. Specify ANTLR grammar specification Specify Java semantic actions using DMS regular expression Generate ANTLR Parser Generate abstract syntax tree with ANTLR_ACTION nodes Search ANTLR_ACTION nodes from the generated AST Retrieve ANTLR_ACTION nodes and store them in a hash map Retrieve associated string expression from each ANTLR_ACTION node Modify the regular Java parser by changing the starting production Parse the associated string expressions as regular Java statement lists Transform the statement lists using the ASTInterface API Regenerate the ANTLR_ACTION nodes with debugging aspects weaved in Output the complete ANTLR AST (with modified action nodes) 54
DSL Line Number Counter Aspect in Aspect. G aspect dsllinenumber ( pointcut productions(): within{command. *}; after(): productions() {dsllinenumber=dsllinenumber+1; } } Corresponding Generated Low-level Rule Transformation 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 default base domain Antlr. external pattern after_advice(af_adv: statement_string, lefthandside: IDENTIFIER, orig_stmt: semantic): semantic = 'after_advice' in domain Antlr. rule print_after_tree(java_seq: semantic): semantic -> semantic =" java_seq " -> "after_advice(aft_advice() , lhs(), java_seq)" if java_seq~=": semantic after_advice(aft_advice(), lhs(), java_seq)". pattern aft_advice(): statement_string = "dsllinenumber=dsllinenumber+1". pattern lhs(): IDENTIFIER ="command". public ruleset a = { print_after_tree }. 55
Aspect. G Video Demo • There are 7 sets of demos in 3 different video formats • Available at www. cis. uab. edu/wuh/ddf/demos. html
Related Work in the Area of Aspect-Oriented Grammars • Aspect. LISA – Uses an explicit join point model – Inheritance of advice and pointcuts – Used for language extension, not tool generation • Aspect. ASF – Weave crosscutting properties into an ASF+SDF specification – Unit test engine is not mentioned in the generation list 57
Outline • Background • DSL Debugging Framework (DDF) • DSL Unit Testing Framework (DUTF) • Aspect. G • Future Work and Conclusion 58
Future Work • An extension of the current framework that enables DSL profiling • Investigation into the scalable, reliable, and extensible DSL testing framework – Application of different IDE platforms and GPLs – Adaptation of DDF and DUTF to address more complex DSLs • Generalize the framework in the areas of toolindependence and language-independence – A DSL IDE for end-user programmers – Adaptation to event grammar approach • Exploiting further areas of aspect-oriented 59 features within the language grammar
Contributions • Provides a software framework empowering enduser developers with traditional software engineering debugging and unit testing capabilities at the DSL level • Developed techniques for debugging and unit testing a diverse set of DSLs • Developed an aspect language for grammars and impacted the area of Grammarware 60
Publications q Journal papers: 4 (2 under review), Conference and workshop papers: 7 – – – Hui Wu, Jeff Gray, and Marjan Mernik, “Unit Testing Support for Domain-Specific Languages, ” under review, Journal of Research and Practice in Information Technology. Damijan Rebernak, Marjan Mernik, Hui Wu, and Jeff Gray, “Domain-Specific Aspect Languages for Modularizing Crosscutting Concerns in Grammars, ” under review, IET Special Issue on Domain-Specific Aspect Languages. Hui Wu, Jeff Gray, and Marjan Mernik, “Grammar-Driven Generation of Domain-Specific Language Debuggers, ” accepted for publication, Software Practice and Experience, 2007. Pedro Rangel Henriques, Maria Joao Varanda Pereira, Marjan Mernik, Mitja Lenic, Jeff Gray, and Hui Wu, “Automatic Generation of Language-based Tools using LISA, ” IEE Proceedings - Software, vol. 152, no. 02, April 2005, pp. 54 -69. Hui Wu, Jeff Gray, Suman Roychoudhury, and Marjan Mernik, “Weaving a Debugging Aspect into Domain. Specific Language Grammars, ” ACM Symposium for Applied Computing-Programming for Separation of Concerns Track, Santa Fe, NM, March 2005, pp. 1370 -1374. Jeff Gray, Jing Zhang, Yuehua Lin, Hui Wu, Suman Roychoudhury, Rajesh Sudarsan, Aniruddha Gokhale, Sandeep Neema, Feng Shi, and Ted Bapty, “Model-Driven Program Transformation of a Large Avionics Framework, ” Generative Programming and Component Engineering, Springer-Verlag LNCS, Vancouver, BC, October 2004, pp. 361 -378. Yuehua Lin, Song Zhou, Chuanxi Xu, Hui Wu, Jing Zhang, Juanqin Wang, Jeff Gray, and Barrett Bryant, “E-R Modeler: A Database Modeling Toolkit for Eclipse, ” Annual ACM SE Conference, Huntsville, Alabama, April 2004, pp. 160 -165. Suman Roychoudhury, Jeff Gray, Hui Wu, Jing Zhang, and Yuehua Lin, “A Comparative Analysis of Metaprogramming and Aspect-Orientation, ” Annual ACM SE Conference, Savannah, GA, March 2003, pp. 196 -201. Damijan Rebernak, Marjan Mernik, Hui Wu, and Jeff Gray, “Domain-Specific Aspect Languages for Modularizing Crosscutting Concerns in Grammars, ” GPCE Workshop on Domain-Specific Aspect Languages, Portland, OR, October 2006. Hui Wu, “Grammar-Driven Generation of Domain-Specific Language Testing Tools, ” Object-Oriented Programming, Systems, Languages & Applications, Doctoral Symposium 2006, Portland, OR, October 2006. Hui Wu, “Automated Generation of Testing Tools for Domain-Specific Languages, ” IEEE/ACM International Conference on Automated Software Engineering, Doctoral Symposium, Long Beach, CA, November, 2005.
Acknowledgement: The work presented in this dissertation was supported in part by the IBM Innovation Grant. Video demonstrations and papers available at: http: //www. cis. uab. edu/wuh/ddf Questions? 62
Backup Slides 63
GPL Line Number Counter Aspect in Aspect. G aspect gplbeginlinenumber ( pointcut count_gpllinenumber(): within {command. *} && match {fileio. print("time=time+1; ")}; after(): count_gpllinenumber() {gplbeginline=fileio. get. Linenumber(); }) Corresponding Generated Low-level Rule Transformation 1 default base domain Antlr. 2 3 pattern semi(): QUOTED_STRING =""time=time+1; "". 4 5 external pattern mid_advice(bef_adv: semantic_strings, 6 semico: QUOTED_STRING, 7 orig_stmt: semantic): 8 semantic = 'mid_advice' in domain Antlr. 9 10 rule print_mid_stree(java_seq: semantic): semantic -> semantic 11 = " java_seq " -> "mid_advice(mi_advice() , semi(), java_seq)" 12 if java_seq~=": semanticmid_advice(mi_advice() , semi(), java_seq)". 13 14 pattern m_advice(): semantic_strings="command; gplbeginline=fileio. get. Linenumber(); ". 15 16 public ruleset a = { print_mid_stree }. 64


