next up previous contents
Next: The return Statement Up: Statements Previous: The require Statement   Contents

The result Statement


$$ Result-Statement ::= "result" Expression ["," (Rule-Set | "accept")] ";" .

In combi rules:
The statement
result expr,
rules rule1, rule2, $...$;
specifies the Result category of the rule and the successor rules. The value expr is the Result category. Behind the keyword rules the names of all successor rules are enumerated. For every successor rule that is being executed a new rule path will be created. The rule set may be enclosed in parentheses.

If you want successor rules to be executed only if no other rule has been successful, you can put their names behind the other rules' names and write an else in front of them:

rules rule1, rule2 else rule3, rule4 else $...$;
If none of the normal rules (here: rule1 and rule2) has been successful, rule3 and rule4 are executed. If these rule also fail, the next rules are executed, and so on. A rule has been successful if it has executed at least one result statement.

In combi-rules and end-rules:
If the input is to be accepted by the result statement (and therefore no successor rules are to be called) the following format has to be used:
result expr, accept;
If this statement is reached in a rule path, the input is accepted as grammatically well-formed. The value expr is returned as the result of the morphological or syntactic analysis.

In filters and robust-rules:
The format of a result statement in a filter or robust-rule:
result expr;
If this statement is reached, the value expr is used as a result of the executed rule.

In allo rules:
The format of the result statement in an allo rule is:
result surface, category;
It creates an entry in the allomorph lexicon. The allomorph surface surface must be a string; category is the categorical information of the allomorph.


next up previous contents
Next: The return Statement Up: Statements Previous: The require Statement   Contents
Bjoern Beutel