There are a bunch of test cases in the xmpl subdirectory of the TigerXmpl package. After you have built the TigerCompiler or just some of its CompilerPackages, you can automatically test them using various make targets.

For example, there is a test case called queens.tig that computes the solutions to the Eight Queens Problem. Running make queens.tas will parse and desugar it into queens.tas, make queens.tc.tas will typecheck it, etc.

The targets include:

  • filename.tasfix (from filename.tig) - the full parse tree (concrete syntax)
  • filename.sweettas (from filename.tasfix) - the imploded parse tree (abstract syntax)
  • filename.tas (from filename.sweettas) - the desugared abstract syntax
  • filename.tas.check (from filename.tas) - checks the validity of abstract syntax trees
  • filename.tc.tas (from filename.tas) - the abstract syntax annotated with type information; fails in case of a type error
  • filename.tc.tas.tccheck (from filename.tas) - checks the validity of type annotated abstract syntax trees
  • filename.val.tas (from filename.tas and filename.input) - interprets a desugared Tiger program, with filename.input as input
  • filename.flattas (from filename.tas) - resugared abstract syntax
  • filename.abox (from filename.flattas) - intermediate step for pretty-printing
  • filename.txt (from filename.abox) - pretty-printed Tiger code (i.e., translates abstract syntax back to concrete syntax)

Also see the CompilerArchitecture for a picture of how these file types relate to each other and what programs are involved in producing them.

Revision: r1.2 - 04 Nov 2001 - 20:53 - EelcoVisser
Tiger > HowToTestTheTigerCompiler
Copyright © 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback