ported sym_table to main.: implement entry lookup, scope, id in expr