Talk:Word break problem: Difference between revisions

no edit summary
No edit summary
Line 10:
 
Maybe the task description needs filling out? --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 07:34, 18 August 2017 (UTC)
 
==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