Tag archive for "source"

For each source file Turbo Pascal keeps a record with essential data like file handle, file name, current line number, current position, conditional compilation If level, etc.

Source files are read into buffer from where source lines are extracted. NextLine procedure moves to the next source line. If a line was read it increments counters and returns True, otherwise if there are no more source lines NextLine returns False.

Turbo Pascal has a command line switch /Fseg:ofs which can find module name and source line number compiled at this address. The program is normally compiled but instead of compilation status the source position is displayed.

The NextNonCommentCharacter function reads and processes characters from the source line buffer. It returns pointer to the next non-comment character. The null (#0) character means end of line. Turbo Pascal tries to read the next source line. If this fails it tries to return to the previous source file (if $I include file was loaded). …

Parser operates only with tokens – basic elements of the language. Tokens like identifiers and constants have also additional data structures where actual data is stored.