The very reason for the pouplarity of programming languages like C/C++, apart from capabilities is that these languages are free to explore, work upon, the masses have access to them etc. When I joined SAP, I was unaware of what ABAP is all about, its capabilities as a business programming language, its features etc. This is what we had in mind when we(a team of three) put forward an idea of Stand-alone ABAP Compiler for the Custom Development Innovation Challenge.
We started with searching for the best tools to build a prototype for the idea. Our search ended with LEX, YACC and SQLite. These all are open source tools.
Lex and Yacc together do the job as mentioned below:
Lex: Split the source file into tokens. Lex takes the pattern matching rules and generates a lexical analyzer.
Yacc: Find the hierarchical structure of the program. Yacc reads the grammar descriptions you provide in a text file and generates the C code for a syntax analyzer or parser.
SQLite was used as the Database Management System.
The end result of this research, analysis and coding was a prototype which was able to recognize the syntax(basic database operations included), parse the input and compile ABAP source code. The prototype was able to execute ABAP reports, detect errors, show output. The grammar and the keyword addition is up to the developer. As many keywords and related grammar rules can be added and the compiler can be enchaced to support more language features.
It is a really small(1.5 MBs) open source tool which can be run on any platform. The prototype currently supports a subset of keywords, operators, special symbols and can be enhanced further as the code is totally modular.
The basic motivation behind the idea is to make ABAP reach the masses, masses with great brains ready to experiment, innovate, transform, improvise. The target is the people who don’t have the access to the SAP systems anyhow. For those who need to prepare for certain certification and need to have some idea of ABAP as a language. We intend to provide the tool to those interested in learning and experimenting with ABAP. Once people start using ABAP at a very basic level, a tremendous innovation can be forseen and interest will crop-in which will definitely help SAP in long run.
We still work upon extending the scope and improvising the features.