Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
symtable Namespace Reference

Data Structures

class  SymbolTableFactory
 
class  SymbolTable
 
class  Function
 
class  Class
 
class  Symbol
 

Functions

def symtable
 
def bool
 
def is_free
 

Variables

list __all__
 
tuple newSymbolTable = SymbolTableFactory()
 
tuple src = open(sys.argv[0])
 
tuple mod = symtable(src, os.path.split(sys.argv[0])[1], "exec")
 
tuple info = mod.lookup(ident)
 

Detailed Description

Interface to the compiler's internal symbol tables

Function Documentation

def symtable.bool (   x)
Helper to force boolean result to 1 or 0

Definition at line 38 of file symtable.py.

38 
39 def bool(x):
40  """Helper to force boolean result to 1 or 0"""
41  if x:
42  return 1
43  return 0
def symtable.is_free (   flags)

Definition at line 44 of file symtable.py.

44 
45 def is_free(flags):
46  if (flags & (USE | DEF_FREE)) \
47  and (flags & (DEF_LOCAL | DEF_PARAM | DEF_GLOBAL)):
48  return 1
49  if flags & DEF_FREE_CLASS:
50  return 1
51  return 0
def symtable.symtable (   code,
  filename,
  compile_type 
)

Definition at line 14 of file symtable.py.

References newSymbolTable.

14 
15 def symtable(code, filename, compile_type):
16  raw = _symtable.symtable(code, filename, compile_type)
17  return newSymbolTable(raw[0], filename)

Variable Documentation

list __all__
Initial value:
1 = ["symtable", "SymbolTable", "newSymbolTable", "Class",
2  "Function", "Symbol"]

Definition at line 11 of file symtable.py.

tuple info = mod.lookup(ident)

Definition at line 254 of file symtable.py.

tuple mod = symtable(src, os.path.split(sys.argv[0])[1], "exec")

Definition at line 252 of file symtable.py.

tuple newSymbolTable = SymbolTableFactory()

Definition at line 36 of file symtable.py.

tuple src = open(sys.argv[0])

Definition at line 251 of file symtable.py.