Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: eb4c43ad69
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (25 sloc) 0.92 kb
from pyparsing import *
class UnaryOperand(object):
# Since we only have 1 unary operation we can safely assume it is a negation
def __init__(self, op, term):
self.term = term
self.op = op
def __repr__(self):
return "(" + self.op + " " + repr(self.term) + ")"
def __eq__(self,other):
return repr(self) == repr(other)
class BinaryOperand(object):
def __init__(self, op, left_term, right_term):
self.terms = (left_term, right_term)
self.op = op
def __repr__(self):
return "(" + repr(self.terms[0]) + " " + self.op + " " + repr(self.terms[1]) + ")"
def __eq__(self,other):
return repr(self) == repr(other)
class Identifier(object):
def __init__(self, string):
self.name = string[0]
def __repr__(self):
return "<" + self.name + ">"
def __eq__(self,other):
return repr(self) == repr(other)
Jump to Line
Something went wrong with that request. Please try again.