Libraries / tools needed for creating parsers

Regular expressions are programmed in the C language, and the C language doesn’t even really have a character string type. All it really has is a one-byte integer type called char. In fortran this would be an integer with a particular kind value. An array of these integers then stores a string, and there are library routines written to copy, concatenate, compare, etc. these arrays. That is how regular expressions are written in C, in terms of these low-level integer arrays. So in principle, the same thing could be done in fortran with one-byte integer arrays, all in terms of library functions. That is not the way it should be implemented in fortran, because fortran does have a higher-level character data type, so that should be used instead. But as far as having sufficient capabilities within the language, it is all there.

4 Likes