@classmethod<EOL><INDENT>def from_selection(cls, selection):<DEDENT>
expressions = []<EOL>if selection[<NUM_LIT:0>] == "<STR_LIT:*>":<EOL><INDENT>return cls(expressions)<EOL><DEDENT>elif selection[<NUM_LIT:0>] == "<STR_LIT>":<EOL><INDENT>return cls(expressions, True)<EOL><DEDENT>for attr in selection:<EOL><INDENT>name = attr.getName()<EOL>if name == "<STR_LIT>":<EOL><INDENT>expr = NamedExpression.from_statement(attr)<EOL><DEDENT>else:<EOL><INDENT>raise SyntaxError("<STR_LIT>" % (name, attr))<EOL><DEDENT>expressions.append(expr)<EOL><DEDENT>return cls(expressions)<EOL>
Factory for creating a Selection expression