GRPP, a scientific programming language preprocessor designed using lex and yacc

James Kent Blackburn · Computers in Physics · 1994

There have been many advances in the functionality and usefulness of high level computer languages since the early incarnations of FORTRAN. The recent trend towards structured and object oriented languages has given the scientific programmer very sophisticated tools for developing applications motivated by data, procedure, and reusability. However, in many areas of scientific and numerical software development, what is needed most is a programming language possessing the basic grammar familiar from analytical discussions of the field of study. The use of lex and yacc for developing specialized computer dialects or languages provide a powerful means of injecting the customary analytic notation and grammar into a scientific programming project. A general relativity preprocessor, grpp, is presented as such an application of lex and yacc to extend C style computer languages to handle tensor analysis in a manner consistent with that which is taught to students of general relativity, differential geometry, and tensor analysis. As an application demonstrating the usefulness of grpp, the fully relativistic four-dimensional trajectory of a test particle around a Kerr black hole is calculated using a very simple to follow, bug-free program taken straight out of any text on general relativity or differential geometry.

Read the paper · More papers on PaperTik