[libmarpa-r2-perl] 02/14: Document difference between MARPA_EVENT_SYMBOL_EXPECTED and MARPA_EVENT_SYMBOL_PREDICTED: t+
Jonas Smedegaard
dr at jones.dk
Sat May 17 21:24:22 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag Marpa-R2-2.085_006
in repository libmarpa-r2-perl.
commit 2eca2062dbedace3709c9314488c0c009f239432
Author: Jeffrey Kegler <JKEGL at cpan.org>
Date: Tue Apr 29 21:31:44 2014 -0700
Document difference between MARPA_EVENT_SYMBOL_EXPECTED and MARPA_EVENT_SYMBOL_PREDICTED: t+
---
cpan/libmarpa/dev/api.texi | 17 ++++++++++++++++-
cpan/libmarpa/dev/marpa.w | 4 ++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/cpan/libmarpa/dev/api.texi b/cpan/libmarpa/dev/api.texi
index 5045914..64d8494 100644
--- a/cpan/libmarpa/dev/api.texi
+++ b/cpan/libmarpa/dev/api.texi
@@ -2653,6 +2653,12 @@ if and only if the expected symbol event bit
for @var{symbol_id} is 1.
The ``expected symbol event bit'' must be 1 or 0.
+In this context, ``expected'' means ``expected as a terminal''.
+Even if a symbol is predicted at the current earleme,
+if it is not acceptable as a terminal,
+it does not trigger an
+``expected symbol event''.
+
By default, the ``expected symbol event bit'' is 0.
It is an error to attempt to set the
``expected symbol event bit'' to 1 for a nulling symbol,
@@ -4024,9 +4030,13 @@ Suggested message: "Completed symbol".
@deftypevr Macro int MARPA_EVENT_SYMBOL_EXPECTED
The recognizer can be set to generate an event when a
-symbol is expected
+symbol is expected as a terminal,
using its @code{marpa_r_expected_symbol_event_set()}
method.
+Note that this event only triggers if the symbol is
+expected as a terminal.
+Predicted symbols which are not expected as terminals
+do not trigger this event.
This event code indicates that one of those events
occurred.
Event value: The ID of the expected symbol.
@@ -4053,6 +4063,11 @@ symbol is predicted.
To set an predicted symbol event,
use the recognizer's @code{marpa_r_predicted_symbol_event_set()}
method.
+Unlike the
+ at code{MARPA_EVENT_SYMBOL_EXPECTED} event,
+the @code{MARPA_EVENT_SYMBOL_PREDICTED} event
+triggers for predictions of both
+non-terminals and terminals.
This event code indicates that a predicted symbol event
occurred.
Event value: The ID of the predicted symbol.
diff --git a/cpan/libmarpa/dev/marpa.w b/cpan/libmarpa/dev/marpa.w
index 9a93834..6b7755e 100644
--- a/cpan/libmarpa/dev/marpa.w
+++ b/cpan/libmarpa/dev/marpa.w
@@ -6107,6 +6107,10 @@ A boolean vector by symbol ID,
with the bits set if, when
that symbol is an expected symbol,
an event should be created.
+Here ``expected'' means ``expected as a terminal''.
+All predicted symbols are expected symbols,
+but the reverse is not true --
+predicted non-terminals are not ``expected'' symbols.
@<Widely aligned recognizer elements@> = LBV t_nsy_expected_is_event;
@ @<Initialize recognizer elements@> =
r->t_nsy_expected_is_event = lbv_obs_new0(r->t_obs, nsy_count);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmarpa-r2-perl.git
More information about the Pkg-perl-cvs-commits
mailing list