Longest match: Add semantic action hook.