Talk:Word break problem: Difference between revisions

 
(2 intermediate revisions by the same user not shown)
Line 10:
 
Maybe the task description needs filling out? --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 07:34, 18 August 2017 (UTC)
 
==lex==
Highlighting the goal to use the complete sentence would have helped me. The "right" tool for the problem where many parsings are possible is the experimental version of bison which branches at alternatives, keeping those that resolve without error.
 
 
lex:
How the input is matched
 
BASIC PRINCIPLES.
 
(1)
When the generated scanner is run, it analyses its input string looking for strings which match any of its patterns.
(2)
If the current input can be matched by several expressions, then the ambiguity is resolved by the following rules.
(2.1)
The longest match is preferred.
(2.2)
The rule given first is preferred.
(3)
Once the match is determined,
(3.1)
the text corresponding to it is available in the global character pointer yytext its length is yyleng and the current line number is yylineno,
(3.2)
and the action corresponding to the matched pattern is then executed,
(3.3)
and then the remaining input is scanned for another match.
--LambertDW 01:52, 20 May 2019 (UTC)
Anonymous user