Next: Internal error codes, Previous: Error Macros, Up: Error methods macros and codes [Contents][Index]
This section lists the external error codes. These are the only error codes that users of the Libmarpa external interface should ever see. Internal error codes are in their own section (Internal error codes).
No error condition.
The error code is initialized to this value.
Methods that do not result in failure
sometimes reset the error code to MARPA_ERR_NONE
.
Numeric value: 0.
Suggested message: "No error".
A separator was specified for a sequence rule, but its ID was not that of a valid symbol. Numeric value: 6. Suggested message: "Separator has invalid symbol ID".
A tree iterator is positioned before the first tree,
and the tree iterator was specified in a context where
the tree iterator must be positioned at or after
the first tree.
A newly created tree is positioned before the first
tree.
To position a newly created tree iterator to the first tree
use the
marpa_t_next()
method.
Numeric value: 91.
Suggested message: "Tree iterator is before first tree".
A “counted” symbol was found that is also a nullable symbol. A “counted” symbol is one that appears on the RHS of a sequence rule. If a symbol is nullable, counting its occurrences becomes difficult. Questions of definition and problems of implementation arise. At a minimum, a sequence with counted nullables would be wildly ambigious.
Sequence rules are simply an optimized shorthand for rules that can also be written in ordinary BNF. If the equivalent of a sequence of nullables is really what your application needs, nothing in Libmarpa prevents you from specifying that sequence with ordinary BNF rules.
Numeric value: 8. Suggested message: "Nullable symbol on RHS of a sequence rule".
This error indicates an attempt to add a BNF rule that is a duplicate of a BNF rule already in the grammar. Two BNF rules are considered duplicates if
Duplication of sequence rules, and duplication between BNF rules and sequence rules, is dealt with by requiring that the LHS of a sequence rule not be the LHS of any other rule.
Numeric value: 11. Suggested message: "Duplicate rule".
This error indicates an attempt to add a duplicate token. A token is a duplicate if one already read at the same earleme has the same symbol ID and the same length. Numeric value: 12. Suggested message: "Duplicate token".
This error code indicates that an implementation-defined limit on the number of Earley items per Earley set was exceeded. This limit is different from the Earley item warning threshold, an optional limit on the number of Earley items in an Earley set, which can be set by the application.
The implementation-defined limit is very large, at least 500,000,000 Earley items. An application is unlikely ever to see this error. Libmarpa’s use of memory would almost certainly exceed the limit imposed by the application environment before this error occurs. Numeric value: 13. Suggested message: "Maximum number of Earley items exceeded".
A negative event index was specified. That is not allowed. Numeric value: 15. Suggested message: "Negative event index".
An non-negative event index was specified, but there is no event at that index. Since the events are in sequence, this means it was too large. Numeric value: 16. Suggested message: "No event at that index".
The grammar has a cycle. Parsing using a grammar that contains a cycle is deprecated. See Cycles. Numeric value: 17. Suggested message: "Grammar has cycle".
This error indicates that Libmarpa was incorrectly built. Libmarpa was compiled with headers that do not match the rest of the code. The solution is to find a correctly built Libmarpa. Numeric value: 98. Suggested message: "Internal error: Libmarpa was built incorrectly"
The Libmarpa base grammar is in a “not ok” state. Currently, the only way this can happen is if Libmarpa memory is being overwritten. Numeric value: 29. Suggested message: "Marpa is in a not OK state".
This error code indicates that the token symbol is an inaccessible symbol — one that cannot be reached from the start symbol. Since the inaccessibility of a symbol is a property of the grammar, this error code typically indicates an application error.
Numeric value: 18. Suggested message: "Token symbol is inaccessible".
A function was called that takes a boolean argument, but the value of that argument was not either 0 or 1. Numeric value: 22. Suggested message: "Argument is not boolean".
The location (Earley set ID) is not valid. It may be invalid for one of two reasons:
For users of input models other than the standard one, the term “location”, as used in association with this error code, means Earley set ID or Earley set ordinal. In the standard input model, this will always be identical with Libmarpa’s other idea of location, the earleme.
Numeric value: 25. Suggested message: "Location is not valid".
A start symbol was specified, but its symbol ID is not that of a valid symbol. Numeric value: 27. Suggested message: "Specified start symbol is not valid".
A method was called with an invalid assertion ID. This is a assertion ID that not only does not exist, but cannot exist. Currently that means its value is less than zero. Numeric value: 96. Suggested message: "Assertion ID is malformed".
A method was called with an invalid rule ID. This is a rule ID that not only does not exist, but cannot exist. Currently that means its value is less than zero. Numeric value: 26. Suggested message: "Rule ID is malformed".
A method was called with an invalid symbol ID. This is a symbol ID that not only does not exist, but cannot exist. Currently that means its value is less than zero. Numeric value: 28. Suggested message: "Symbol ID is malformed".
There was a mismatch in the major version number between the requested version of libmarpa, and the actual one. Numeric value: 30. Suggested message: "Libmarpa major version number is a mismatch".
There was a mismatch in the micro version number between the requested version of libmarpa, and the actual one. Numeric value: 31. Suggested message: "Libmarpa micro version number is a mismatch".
There was a mismatch in the minor version number between the requested version of libmarpa, and the actual one. Numeric value: 32. Suggested message: "Libmarpa minor version number is a mismatch".
A non-negative Earley set ID (also called an Earley set ordinal) was specified, but there is no corresponding Earley set. Since the Earley set ordinals are in sequence, this means that the specified ID is greater than that of the latest Earley set. Numeric value: 39. Suggested message: "Earley set ID is after latest Earley set".
The grammar is not precomputed, and attempt was made to do something with it that is not allowed for unprecomputed grammars. For example, a recognizer cannot be created from a grammar until it is precomputed. Numeric value: 34. Suggested message: "This grammar is not precomputed".
The application attempted to create a bocage from a recognizer with no parse tree. Numeric value: 41. Suggested message: "No parse".
A grammar that has no rules is being used in a way that is not allowed. Usually the problem is that the user is trying to precompute the grammar. Numeric value: 42. Suggested message: "This grammar does not have any rules".
The grammar has no start symbol, and an attempt was made to perform an operation that requires one. Usually the problem is that the user is trying to precompute the grammar. Numeric value: 43. Suggested message: "This grammar has no start symbol".
A method was called with an assertion ID that is well-formed (a non-negative integer), but the assertion does not exist. Numeric value: 97. Suggested message: "No assertion with this ID exists".
A method was called with a rule ID that is well-formed (a non-negative integer), but the rule does not exist. Numeric value: 89. Suggested message: "No rule with this ID exists".
A method was called with a symbol ID that is well-formed (a non-negative integer), but the symbol does not exist. Numeric value: 90. Suggested message: "No symbol with this ID exists".
An attempt was made to read a token using marpa_r_alternative
,
but no tokens were expected at this earleme location.
This can only happen in alternative input models.
See marpa_r_alternative().
Numeric value: 44. Suggested message: "No token is expected at this earleme location".
This error occurs in situations where a rule is required to be a sequence, and indicates that the rule of interest is, in fact, not a sequence.
Numeric value: 99. Suggested message: "Rule is not a sequence".
This error occurs only if LHS terminals feature is in use. The LHS terminals feature is deprecated. See LHS terminals. Numeric value: 49. Suggested message: "A symbol is both terminal and nulling".
The Marpa order object has been frozen. If a Marpa order object is frozen, it cannot be changed.
Multiple tree iterators can share a Marpa order object, but that order object is frozen after the first tree iterator is created from it. Applications can order an bocage in many ways, but they must do so by creating multiple order objects.
Numeric value: 50. Suggested message: "The ordering is frozen".
The parse is exhausted. Numeric value: 53. Suggested message: "The parse is exhausted".
The parse is too long. The limit on the length of a parse is implementation dependent, but it is very large, at least 500,000,000 earlemes.
In the standard input model, Libmarpa’s use of memory would almost certainly exceed the limit imposed by the application environment before this error could occur. If an application sees this error, it almost certainly using one of the non-standard input models.
In the non-standard input models, this message will occur most often because of an attempt to add a single extremely long token, perhaps as a result of an application error. It is also possible this error condition will occur after the input of a large number of long tokens.
Numeric value: 54. Suggested message: "This input would make the parse too long".
In a method that takes pointers as arguments,
one of the pointer arguments is NULL
,
in a case where that is not allowed.
One such method is marpa_r_progress_item()
.
Numeric value: 56.
Suggested message: "An argument is null when it should not be".
An attempt was made to use a precomputed grammar in a way that is not allowed. Often this is an attempt to change the grammar. Nearly every change to a grammar after precomputation invalidates the precomputation, and is therefore not allowed. Numeric value: 57. Suggested message: "This grammar is precomputed".
No recognizer progress report is currently active,
and an action has been attempted that
requires the progress report to be active.
One such action would be a
marpa_r_progress_item()
call.
Numeric value: 59.
Suggested message: "No progress report has been started".
The progress report is “exhausted” — all its items have been iterated through. Numeric value: 58. Suggested message: "The progress report is exhausted".
A symbol or rule rank was specified that was less than an implementation-defined minimum. Implementations will always allow ranks in the range between -500,000,000 and 500,000,000. Numeric value: 85. Suggested message: "Rule or symbol rank too low".
A symbol or rule rank was specified that was greater than an implementation-defined maximum. Implementations will always allow ranks in the range between -500,000,000 and 500,000,000. Numeric value: 86. Suggested message: "Rule or symbol rank too high".
The recognizer is not accepting input, and the application has attempted something that is inconsistent with that fact. Numeric value: 60. Suggested message: "The recognizer is not accepting input".
The recognizer has not been started. and the application has attempted something that is inconsistent with that fact. Numeric value: 61. Suggested message: "The recognizer has not been started".
The recognizer has been started. and the application has attempted something that is inconsistent with that fact. Numeric value: 62. Suggested message: "The recognizer has been started".
The index of a RHS symbol was specified, and it was negative. That is not allowed. Numeric value: 63. Suggested message: "RHS index cannot be negative".
A non-negative index of RHS symbol was specified, but there is no symbol at that index. Since the indexes are in sequence, this means the index was greater than or equal to the rule length. Numeric value: 64. Suggested message: "RHS index must be less than rule length".
An attempt was made to add a rule with too many right hand side symbols. The limit on the RHS symbol count is implementation dependent, but it is very large, at least 500,000,000 symbols. Libmarpa’s use of memory would almost certainly exceed the limit imposed by the application environment before this error could occur. Numeric value: 65. Suggested message: "The RHS is too long".
The LHS of a sequence rule cannot be the LHS of any other rule, whether a sequence rule or a BNF rule. An attempt was made to violate this restriction. Numeric value: 66. Suggested message: "LHS of sequence rule would not be unique".
The start symbol is not on the LHS on any rule. That means it could never match any possible input, not even the null string. This is likely to be a mistake in writing the grammar, which can be fixed by rewriting the grammar. Numeric value: 73. Suggested message: "Start symbol not on LHS of any rule".
An attempt was made to use a symbol in a way that requires it to be set up for completion events, but the symbol was not set up for completion events. This error can occur when the application attempts to activate a completion event in the recognizer for a symbol that is not set up as a completion event. Numeric value: 92. Suggested message: "Symbol is not set up for completion events".
An attempt was made to use a symbol in a way that requires it to be set up for nulled events, but the symbol was not set up for nulled events. This error can occur when the application attempts to activate a nulled symbol event in the recognizer for a symbol that is not set up as a nulled event. Numeric value: 93. Suggested message: "Symbol is not set up for nulled events".
An attempt was made to use a symbol in a way that requires it to be set up for prediction events, but the symbol was not set up for prediction events. This error can occur when the application attempts to activate a prediction event in the recognizer for a symbol that is not set up as a prediction event. Numeric value: 94. Suggested message: "Symbol is not set up for prediction events".
Unvalued symbols are a deprecated Marpa feature,
which may be avoided with
the
marpa_g_force_valued()
method.
An unvalued symbol may take on any value,
and therefore a symbol that is unvalued at some points
cannot safely to be used to contain a value at
others.
This error indicates that such an unsafe use is
being attempted.
Numeric value: 74.
Suggested message: "Symbol is treated both as valued and unvalued".
An attempt was made to change the terminal status of a symbol to a different value after it was locked. Numeric value: 75. Suggested message: "The terminal status of the symbol is locked".
A token was specified whose symbol ID is not a terminal. Numeric value: 76. Suggested message: "Token symbol must be a terminal".
A token length was specified that is less than or equal to zero. Zero-length tokens are not allowed in Libmarpa. Numeric value: 77. Suggested message: "Token length must greater than zero".
The token length is too long. The limit on the length of a token is implementation dependent, but it is at least 500,000,000 earlemes. Libmarpa’s use of memory would almost certainly exceed the limit imposed by the application environment before this error could occur. Numeric value: 78. Suggested message: "Token is too long".
A Libmarpa parse tree iterator is “exhausted”, that is, it has no more parse trees. Numeric value: 79. Suggested message: "Tree iterator is exhausted".
A Libmarpa tree is “paused”
and an operation was attempted that
is inconsistent with that fact.
Typically, this operation will be
a call of the
marpa_t_next()
method.
Numeric value: 80.
Suggested message: "Tree iterator is paused".
An attempt was made to read a token where a token with that symbol ID is not expected. This message can also occur when an attempt is made to read a token at a location where no token is expected. Numeric value: 81. Suggested message: "Unexpected token".
The start symbol is unproductive. That means it could never match any possible input, not even the null string. This is likely to be a mistake in writing the grammar, which can be fixed by rewriting the grammar. Numeric value: 82. Suggested message: "Unproductive start symbol".
The valuator is inactive in a context where that should not be the case. Numeric value: 83. Suggested message: "Valuator inactive".
Unvalued symbols are a deprecated Marpa feature,
which may be avoided with
the
marpa_g_force_valued()
method.
See marpa_g_force_valued().
This error code
indicates that the valued status of a symbol is locked,
and an attempt was made
to change it to a status different from the
current one.
Numeric value: 84.
Suggested message: "The valued status of the symbol is locked".
An attempt was made to do something with a nulling
symbol that is not allowed.
For example,
the ID of a nulling symbol cannot be an argument
to
marpa_r_expected_symbol_event_set()
,
because it is not possible to create an “expected symbol” event
for a nulling symbol.
Numeric value: 87.
Suggested message: "Symbol is nulling".
An attempt was made to do something with an unused symbol that is not allowed.
An “unused” symbol is a inaccessible or unproductive symbol.
For example,
the ID of a unused symbol cannot be an argument
to
marpa_r_expected_symbol_event_set()
,
because it is not possible to create an “expected symbol” event
for an unused symbol.
Numeric value: 88.
Suggested message: "Symbol is not used".
Next: Internal error codes, Previous: Error Macros, Up: Error methods macros and codes [Contents][Index]