Package theia :: Package running :: Module parser
[hide private]
[frames] | no frames]

Module parser

source code

Module for the parsing on input data from .tia file.

Functions [hide private]
 
dicOf(st, line, fileName, lineNumber)
Extract the initializer dictionary from a line.
source code
 
readIn(name)
Finds the input data in a file.
source code
Variables [hide private]
  GHz = 1000000000.0
  Hz = 1.0
  MHz = 1000000.0
  THz = 1e+12
  W = 1.0
  __package__ = 'theia.running'
  arccos = <ufunc 'arccos'>
  arcsin = <ufunc 'arcsin'>
  arctan = <ufunc 'arctan'>
  cm = 0.01
  cos = <ufunc 'cos'>
  deg = 0.0174532925199
  exp = <ufunc 'exp'>
  kHz = 1000.0
  kW = 1000.0
  km = 1000.0
  m = 1.0
  mHz = 0.001
  mW = 0.001
  mm = 0.001
  nW = 1e-09
  nm = 1e-09
  pi = 3.14159265359
  ppm = 1e-06
  rad = 1.0
  sin = <ufunc 'sin'>
  sqrt = <ufunc 'sqrt'>
  tan = <ufunc 'tan'>
  uHz = 1e-06
  uW = 1e-06
  um = 1e-06
Function Details [hide private]

dicOf(st, line, fileName, lineNumber)

source code 
Extract the initializer dictionary from a line.

st: object tag, 'bm', 'th', ... [string]
line: line of data in .tia format (supposed no spaces nor tabs nor comments)
and without the obect tag. [string]
fileName: name of file (used to write errors). [string]
lineNumber: number fo this line in the file (used to write errors). [int]

    May raise an InputError
    Returns a dictionary ready for construction.

readIn(name)

source code 
Finds the input data in a file.

Returns a list of tuples where tuple[0] identifies the object of which data
has been found and tuple[1] the data itself. tuple[1] may be a simple value
or a dictionary for constructors, etc.

Example return value: [ ('bd', {'X': 0., 'Y': 0., 'Z': 1.}),    #constructor
                        ('LName', 'foo')]   #string data.

name: file to read. [string]

May raise an InputError.

Returns a list of tuples.