Ejemplo n.º 1
0
def parse(name, lines, key):
    iter = LookaheadIterator(lines)
    metric = parse_metric(iter)
    variables = parse_variables(iter, key)
    symtab = SymbolTable(variables)
    init = parse_initial_state(iter, len(variables), symtab)
    goals = parse_goals(iter, symtab)
    operators = parse_operators(iter, symtab)
    axioms = parse_axioms(iter, symtab)
    if iter.peek() is not None:
        raise ValueError(iter.next())
    assert_layering_rule(init, axioms)
    return SasTask(name, variables, init, goals, operators, axioms, metric)
Ejemplo n.º 2
0
def parse(lines):
    iter = LookaheadIterator(lines)
    groups = []
    while iter.peek() is not None:
        groups.append(parse_group(iter))
    return GroupKey(groups)
Ejemplo n.º 3
0
def parse(lines):
    iter = LookaheadIterator(lines)
    groups = []
    while iter.peek() is not None:
        groups.append(parse_group(iter))
    return GroupKey(groups)