Parser for linear expressions with named variables