<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse(s):
 """ Parse a Boolean expression string, and return an expression abstract syntax tree. Parameters s : str String containing a Boolean expression. See ``pyeda.parsing.boolexpr.GRAMMAR`` for details. Examples -------- ('or', ('var', ('a',), ()), ('xor', ('var', ('b',), ()), ('and', ('var', ('c',), ()), ('var', ('d',), ())))) ('implies', ('var', ('p',), ()), ('var', ('q',), ())) Returns ------- An ast tuple, defined recursively: ast := ('const', bool) | ('var', names, indices) | ('not', ast) | ('implies', ast, ast) | ('ite', ast, ast, ast) bool := 0 | 1 func := 'or' | 'and' | 'nor' | 'nand' | 'xor' | 'xnor' | 'equal' | 'unequal' | 'onehot0' | 'onehot' | 'majority' | 'achillesheel' """

    lexer = iter(BoolExprLexer(s))
    try:
        expr = _expr(lexer)
    except lex.RunError as exc:
        fstr = ("{0.args[0]}: "
                "(line: {0.lineno}, offset: {0.offset}, text: {0.text})")
        raise Error(fstr.format(exc))

    # Check for end of buffer
    _expect_token(lexer, {EndToken})

    return expr