def call(st): for chr in s: c = st.next() if chr != c: raise ParsecError(st, "Expect '{0}' but got {1}".format(s, c)) else: return s
def eof(state): re = None try: re = state.next() except ParsecEof: return None raise ParsecError(state, "Expect eof but got {0}".format(re))
def call(st): re = st.next() for item in data: if re == item: raise ParsecError( st, "Expect none item of {0} but got {1}".format(data, re)) else: return re
def call(st): raise ParsecError(st, message)
def call(st): re = st.next() if re != data: return re else: raise ParsecError(st, "Expect not equal {0}".format(data))
def call(st): re = st.next() if re == data: return re else: raise ParsecError(st, "Expect {0} but got {1}".format(data, re))
def space(state): c = state.next() if c.isspace(): return c raise ParsecError(st, "Expect a space but got {0}".format(c))