Vol: 55(69) No: 3 / September 2010 Formal Analysis of Incremental Code Generation in OCL Compilers Tamás Vajk Department of Automation and Applied Informatics, Budapest University of Technology and Economics, Faculty of Electrical Engineering and Informatics, Goldmann György tér 3. IV. em., 1111 Budapest, Hungary, phone: (361) 463-2870, e-mail: tamas.vajk@aut.bme.hu, web: http://www.aut.bme.hu/Portal/tamas.vajk/ Márk Asztalos Department of Automation and Applied Informatics, Budapest University of Technology and Economics, Faculty of Electrical Engineering and Informatics, Goldmann György tér 3. IV. em., 1111 Budapest, Hungary, e-mail: asztalos@aut.bme.hu Gergely Mezei Department of Automation and Applied Informatics, Budapest University of Technology and Economics, Faculty of Electrical Engineering and Informatics, Goldmann György tér 3. IV. em., 1111 Budapest, Hungary, e-mail: gmezei@aut.bme.hu Keywords: Object Constraint Language, compiler, code generation, incremental Abstract Software modeling with the Unified Modeling Language and the Object Constraint Language is becoming the standard way of designing large scale applications. Model developers can choose between more and more CASE tools based on feature list, flexibility and performance. Due to the iterative, incremental model development approach, in which the model developer defines static structure and later the corresponding restrictions one-by-one, the constant need for recompiling the constraints necessitates translator optimizations, such as incremental compilation. In this paper, we present the most wide-spread OCL compilers with their code generation approaches and our environment, the Visual Modeling and Transformation System. We illustrate an algorithm to translate OCL code fragments to their C# equivalents incrementally. Also, we provide a feasible mapping between the languages, and a formal analysis of the mapping is given to verify the applicability of the algorithms. The introduced algorithm is universal enough to be used in any compiler application that utilizes an underlying Abstract Syntax Tree representation of the input code if an expression-preserving mapping has been given between source and target languages. The main achievement of the proposed method is that the duration of model development can be decreased, thus, the efficiency of the environment is improved. References [1] P. Stevens and R. Pooley, Using UML: Software Engineering with Objects and Components, ser. Object Technology Series. Addison-Wesley, 1999. [2] OCL 2.0 Specification, Object Management Group, June 2005, http://www.omg.org/docs/ptc/05-06-06.pdf. [3] J. Warmer and A. Kleppe, Object Constraint Language, The: Getting Your Models Ready for MDA, Second Edition.Addison Wesley, 2003. [4] S. Kelly and J.-P. Tolvanen, Domain-Specific Modeling: Enabling Full Code Generation. John Wiley & Sons, March 2008. [5] B. J. MacLennan, Functional programming: practice and theory. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc., 1990. [6] A. Hamie, F. Civello, J. Howse, S. Kent, and R. Mitchell, “Reflections on the Object Constraint Language,” in The Unified Modeling Language (UML), LNCS. IEEE Press, 1998, pp. 137–145. [7] Technische Universit¨at Dresden, “Dresden OCL Toolkit,” http://dresden-ocl.sourceforge.net/. [8] Kent OCL, “Kent Object Constraint Language Library,” http://www.cs.kent.ac.uk/projects/ocl/. [9] D. Akehurst, P. Linington, and O. Patrascoiu, “OCL 2.0: Implementing the Standard,” University of Kent, Tech. Rep. 12-03, 2003. [10] H. Hussmann, B. Demuth, and F. Finger, “Modular architecture for a toolset supporting OCL,” Sci. Comput. Program., vol. 44, no. 1, pp. 51-69, 2002. [11] B. Demuth, H. Hussmann, and S. Loecher, “OCL as a Specification Language for Business Rules in Database Applications,” in Proc. 4th Intl. Conf. on The Unified Modeling Language, Modeling Languages, Concepts, and Tools, London, UK, pp. 104-117, 2001. [12] T. Levendovszky, L. Lengyel, G. Mezei and H. Charaf, “A Systematic Approach to Metamodeling Environments and Model Transformation Systems in VMTS”, in: International Workshop on Graph-Based Tools (GraBaTs) Electronic Notes in Theoretical Computer Science, Rome, Italy, 2005, pp. 65–75. [13] Jay, “(Language Processing),” http://www.cs.rit.edu/˜ats/projects/lp/doc/jay/package-summary.html. [14] C. Donnelly and R. M. Stallman, Bison Manual for Version 1.875. Free Software Foundation; 8th edition, September 2003. [15] A. V. Aho, R. Sethi, and J. D. Ullman, Compilers: Principles, Techniques, and Tools. Addison Wesley, Pearson Education, 1986. [16] T. Vajk, G. Mezei, and T. Levendovszky, “Incremental Type Checking in OCL Compilers,” IEEE Eastern European Conference on the Engineering of Computer Based Systems, pp. 9–18, 2009. [17] J. Albahari and B. Albahari, C# 3.0 in a Nutshell: A Desktop Quick Reference. O’Reilly, 2007. [18] J. C. Rattz, Pro LINQ: Language Integrated Query in C# 2008 (Windows.Net). Apress, 2007. [19] T. Vajk and T. Mészáros, “Code Generation in OCL Compilers,” in Automation and Applied Computer Science Workshop, Budapest, Hungary, June 2009. [20] T. Vajk and G. Mezei, “Incremental OCL to C# Code Generation,” in Proc. ICCC-CONTI, Timisoara, Romania, 2010. |