The Meta-Environment API

asf-pretty-print.tb

Go to the documentation of this file.
00001 #ifndef ASF_PRETTY_PRINT
00002 #define ASF_PRETTY_PRINT
00003 
00004 #include <undefined.h>
00005 #include <asf-utils.tb>
00006 #include <sdf-module-utils.tb>
00007 
00008 /**
00009  * \file This file coordinates the process of pretty printing a term.
00010  * It links a module X to another module Y that contains a pretty printer
00011  * for the language in X, then executes that specification (applies the
00012  * rewrite rules), and then applies the default mapping to a box and
00013  * returns the pretty printed result as text.
00014  */
00015 
00016 process BoxAndPrettyPrint(ModuleId : module-id, Path: str, Tree: term, RTree :term?) is
00017 let
00018   PrettyModuleId: module-id,
00019   PrettySpec: term,
00020   PrettyEquations: term,
00021   UserDefined: term,
00022   Result: term
00023 in
00024   RTree := UNDEFINED
00025   . LookupFeatureModuleId(ModuleId, "format", PrettyModuleId?)
00026   .
00027   if not-equal(PrettyModuleId, UNDEFINED) then 
00028      AddJob("User defined pretty printing")
00029      . Reduce(PrettyModuleId, Path, off, UserDefined?)
00030      . JobDone("User defined pretty printing")
00031   else 
00032     UserDefined := Tree
00033   fi
00034   . PrettyPrint(Path, UserDefined, Result?)
00035   . RTree := Result
00036 endlet
00037 
00038 #endif

Generated on Fri Sep 12 13:16:07 2008 for asfsdf-meta by  doxygen 1.4.6