Kaydet (Commit) 8b6323d3 authored tarafından Jeremy Hylton's avatar Jeremy Hylton

checking in initial weekend's work

compile.py: ASTVisitor framework plus bits of a code generator that
    should be bug-for-buf compatible with compile.c

misc.py: Set and Stack helpers

test.py: a bit of simple sample code that compile.py will work on
üst 106a02da
class Set:
def __init__(self):
self.elts = {}
def add(self, elt):
self.elts[elt] = elt
def items(self):
return self.elts.keys()
def has_elt(self, elt):
return self.elts.has_key(elt)
class Stack:
def __init__(self):
self.stack = []
self.pop = self.stack.pop
def push(self, elt):
self.stack.append(elt)
def top(self):
return self.stack[-1]
This diff is collapsed.
class Set:
def __init__(self):
self.elts = {}
def add(self, elt):
self.elts[elt] = elt
def items(self):
return self.elts.keys()
def has_elt(self, elt):
return self.elts.has_key(elt)
class Stack:
def __init__(self):
self.stack = []
self.pop = self.stack.pop
def push(self, elt):
self.stack.append(elt)
def top(self):
return self.stack[-1]
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment