Skip to main content
Log in

MetaJC++: A flexible and automatic program transformation technique using meta framework

  • Research Article
  • Published:
Central European Journal of Engineering

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. 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

    Chapter  Google Scholar 

  2. Liang S., The Java Native Interface: Programmers Guide and Specification, Addison Wesley Longmam, Inc, 1999

    Google Scholar 

  3. 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

    MATH  MathSciNet  Google Scholar 

  4. 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

    Google Scholar 

  5. 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

    Google Scholar 

  6. Holst W., Meta: Extending and Unifying languages, Proceedings of OOPSALA’04 (Oct 24–28, 2004 Vancouver, Canada), ACM, 2004, 331–344

    Google Scholar 

  7. Beevi S. N., Chitraprasad D., Chandra V. S. S., The varying faces of program transformation Systems, ACM Inroads, 2012, 3, 1, 49–55

    Article  Google Scholar 

  8. 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

    Google Scholar 

  9. 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

    Chapter  Google Scholar 

  10. Laffra G., C2J: a C++ to Java translator, Novosoft, 2001

    Google Scholar 

  11. 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

    Google Scholar 

  12. 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

    Chapter  Google Scholar 

  13. Galler B. A., Perlis A. J., A Proposal for definition in ALGOL, CACM, 1967, 10,4, 204–219

    Article  MATH  Google Scholar 

  14. Chandra V. S. S, Nair A. S., A MetaL for C and Pascal, ACM SIGCSE, 2007, 39,4, 87–91

    Article  Google Scholar 

  15. 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

    Google Scholar 

  16. Lafore R., Object Oriented Programming in C++, 4th ed., Pearson Education, 2002

    Google Scholar 

  17. Schildt H., Java: The Complete Reference, 7th ed., Mc Graw Hill, 2007

    Google Scholar 

  18. Beevi S. N., Chitraprasad D., Chandra V. S. S., Overlapping optimization with parsing through metagrammars, IJARET, 2013, 4,5, 153–163

    Google Scholar 

  19. 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

    Google Scholar 

  20. 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

    Google Scholar 

  21. 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

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Nadera S. Beevi.

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.2478/s13531-013-0161-2

Keywords

Navigation