modified grammar for '$' operator