| Home | Trees | Indices | Help |
|
|---|
|
|
cl2py.py: Translate IRAF CL program to Python
$Id: cl2py.py 1244 2010-07-26 18:43:58Z sontag $
R. White, 1999 December 20
|
|||
|
Container Simple container class (no methods) for holding picklable objects |
|||
|
Pycode Container for Python CL translation |
|||
|
FindLineNumber Helper class to find first line number in an AST |
|||
|
ErrorTracker Mixin class that does error tracking during AST traversal |
|||
|
ExtractProcInfo Extract name and args from procedure statement |
|||
|
Variable Container for properties of a variable |
|||
|
ExtractDeclInfo Extract list of variable definitions from parameter block |
|||
|
VarList Scan tree and get info on procedure, parameters, and local variables |
|||
|
TypeCheck Determine types of all expressions |
|||
|
BlockInfo Helper class to store block structure info for GOTO analysis |
|||
|
GoToAnalyze AST traversal for CL GOTO analysis |
|||
|
CheckArgList Check task argument list for errors |
|||
| Tree2Python | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
_parser = None
|
|||
_longTypeName =
|
|||
_SpecialArgs =
|
|||
_typeDict =
|
|||
_rfuncDict =
|
|||
_numberTypes =
|
|||
_CLVarDict =
|
|||
_translateList =
|
|||
_taskList =
|
|||
_functionList =
|
|||
_functionType =
|
|||
_LogOpDict =
|
|||
_RedirDict =
|
|||
_bothSpaceList =
|
|||
_trailSpaceList =
|
|||
_stringTypes =
|
|||
__package__ =
|
|||
Imports: cStringIO, os, sys, GenericASTTraversal, AST, Token, clscan, clparse, codeCache, Verbose, basicpar, minmatch, irafutils, irafpar, pyrafglobals
|
|||
Read CL program from file and return pycode object with Python equivalent
filename: Name of the CL source file or a filehandle from which the
source code can be read.
string: String containing the source code. Either filename or string must be
specified; if both are specified, only filename is used
parlist: IrafParList object with list of parameters (which may have already
been defined from a .par file)
parfile: Name of the .par file used to define parlist. parlist may be
defined even if parfile is null, but a null parfile is interpreted
to mean that the parameter definitions in the CL script should
override the parlist. If parfile is not null, it is an error if
the CL script parameters conflict with the parlist.
mode: Mode of translation. Default "proc" creates a procedure script
(which defines a Python function.) Normally CL scripts will be
translated using this default. If mode is "single" then the
necessary environment is assumed to be set and the Python
code simply gets executed directly. This is used in the
CL compatibility mode and other places where a single line of
CL must be executed.
Mode also determines whether parameter sets are saved in calls
to CL tasks. In "single" mode parameters do get saved; in
"proc" mode they do not get saved. This is intended to be
consistent with the behavior of the IRAF CL, where parameter
changes in scripts are not preserved.
local_vars_dict, local_vars_list: Initial definitions of local variables.
May be modified by declarations in the CL code. This is used only for
"single" mode to allow definitions to persist across statements.
usecache: Set to false value to omit use of code cache for either saving
or retrieving code. This is useful mainly for compiler testing.
|
Returns CL parameter data type if this is a CL variable, "unknown" if not Note that this can be incorrect about the data type for CL variables that are masked by package level variables. Too bad, that is just too ugly to be believed anyway. Don't do that. |
|
|||
_longTypeName
|
_typeDict
|
_rfuncDict
|
_translateList
|
_taskList
|
_functionList
|
_functionType
|
_RedirDict
|
_bothSpaceList
|
_stringTypes
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Jan 13 11:20:56 2011 | http://epydoc.sourceforge.net |