[Home] [Syllabus] [Assignments] [Resources]

Resources for CSci 4607 Computer Language Processing

On this page you will find: This list will grow as the course progresses. Your suggestions are welcome.

General little languages resources

lex, yacc and related creatures

Some examples of little languages

XML resources

Some XML resources in no particular order:

XML and little languages

C resources

Thoughts about "import" statement

In the language implementation we have encountered the following issue: should an "import" statement (as in import myfile) be a statement in the language and therefore be handled by yacc/bison, or a preprocessor directive and therefore be handled by flex. In the latter case it may be possible that the parser is not aware that the import directive has been issued at all and views the tokens from the new file as a continuation of the program, or flex may send a token to the parser indicating that the source of tokens has changed, followed by another token when the end of the file has been reached and the tokens are now coming from the standard input.

Here is an article that examines similar issues in building a compiler for processing IDLs (interface definition of components). It points out an important aspect of the issue: if an imported file has a global variable, should this variable name be resolved in the new program environment? Other interesting aspects of the proposed solution are multiple paths through the program code and creation of a new parser to process the imported file.