Abstract
Compiler is a tool to translate abstract code containing natural language terms to machine code. Meta compilers are available to compile more than one languages. We have developed a meta framework intends to combine two dissimilar programming languages, namely C++ and Java to provide a flexible object oriented programming platform for the user. Suitable constructs from both the languages have been combined, thereby forming a new and stronger Meta-Language. The framework is developed using the compiler writing tools, Flex and Yacc to design the front end of the compiler. The lexer and parser have been developed to accommodate the complete keyword set and syntax set of both the languages. Two intermediate representations have been used in between the translation of the source program to machine code. Abstract Syntax Tree has been used as a high level intermediate representation that preserves the hierarchical properties of the source program. A new machine-independent stack-based byte-code has also been devised to act as a low level intermediate representation. The byte-code is essentially organised into an output class file that can be used to produce an interpreted output. The results especially in the spheres of providing C++ concepts in Java have given an insight regarding the potential strong features of the resultant meta-language.
Similar content being viewed by others
References
Beevi S. N., Chitraprasad D., Chandra V. S. S., Enhancing flexibility and portability of Execution Preserving Language Transformation using metaprogramming, Proceedings of International Conference on Power, Signals, Controls and Computation, Epsicon’12 (Jan 3–6, 2012 Thrissur, Kerala), IEEE, 2012, 1–4
Liang S., The Java Native Interface: Programmers Guide and Specification, Addison Wesley Longmam, Inc, 1999
Dong Y., Recursive functions of Context free Languages(I) — The definitions of CFPRF and CFRG, Science in China (Series F) 45(1), 2002, 25–39
Dong Y., Recursive functions of Context free Languages(II) — Validity of CFPRF and CFRG definitions, Science in China (Series F) 45(2), 2002, 1–21
Balzer R. M., Goldman N. M., Wile D. S., On the Transformational Implementation Approach to Programming, Proceedings of the 2nd International Conference on Software Engineering (Washington DC 1976), IEEE Computer Society Press, 1976, 337–344
Holst W., Meta: Extending and Unifying languages, Proceedings of OOPSALA’04 (Oct 24–28, 2004 Vancouver, Canada), ACM, 2004, 331–344
Beevi S. N., Chitraprasad D., Chandra V. S. S., The varying faces of program transformation Systems, ACM Inroads, 2012, 3, 1, 49–55
Malabarba S., Devanbhu P. T., Stearns A., MoHca Java: A tool for C++ to Java Conversion support, Proceedings of International Conference on Software Engineering, ICSE (May 16–22, 1999 Los Angeles, USA), IEEE, 1999, 650–653
Buddrus F., Schode J., Cappuccino — a C++ to Java translator. Proceedings of the ACM Symposium on Applied Computing (Feb, 1998 Atlanta,USA), ACM, 1998, 660–665
Laffra G., C2J: a C++ to Java translator, Novosoft, 2001
Sneed H. M., Wrapping legacy COBOL programs behind an XML interface, Proceedings of 8th WCRE (Oct 02–05, 2001 Stuttgartt), IEEE Computer Society Press, 2001, 189–197
Sneed H. M., Migrating from COBOL to Java, Proceedings of International Conference on Software Maintenance (ICSM) (Sept 12-18, 2010 Timisora), IEEE, 2010, 1–7
Galler B. A., Perlis A. J., A Proposal for definition in ALGOL, CACM, 1967, 10,4, 204–219
Chandra V. S. S, Nair A. S., A MetaL for C and Pascal, ACM SIGCSE, 2007, 39,4, 87–91
Reeuwijk V. C., Rapid and Robust Compiler Construction Using Template-Based Metacompilation, 12th International Conference, ETAPS (April 7–11, 2003 Warsaw, Poland), Springer LNCS, 2622, 2003, 247–261
Lafore R., Object Oriented Programming in C++, 4th ed., Pearson Education, 2002
Schildt H., Java: The Complete Reference, 7th ed., Mc Graw Hill, 2007
Beevi S. N., Chitraprasad D., Chandra V. S. S., Overlapping optimization with parsing through metagrammars, IJARET, 2013, 4,5, 153–163
Ceccato M., Dean T. R., Tonella P., Marchignoli D., Data model reverse engineering in migrating a legacy system to Java, Proceedings of 15th WCRE (Oct 15–18, 2008 Antwerp, Belgium), IEEE, 2008, 177–186
Zhang X., Koved L., Pistoria M., Weber S. et al., The Case for Analysis Preserving Transformation, Proceedings of ISSTA’06, (July 17–20, 2006 Portland, Maine, US), ACM, 2006, 17–20
Ceccato M., Tonella P., Matteotti C., Goto Elimination Strategies in the Migration of legacy code to Java, Proceedings of 12th European Conference on SMR (April 1–4, 2008 Athens), IEEE, 2008, 53–62
Author information
Authors and Affiliations
Corresponding author
About this article
Cite this article
Beevi, N.S., Reghu, M., Chitraprasad, D. et al. MetaJC++: A flexible and automatic program transformation technique using meta framework. cent.eur.j.eng 4, 316–325 (2014). https://doi.org/10.2478/s13531-013-0161-2
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.2478/s13531-013-0161-2