Permalink
Browse files

Documentation

  • Loading branch information...
1 parent 090054e commit f539cf043d6d8540e5f4c40d743bf9a2f7d20fb1 Jeffrey Kegler committed May 23, 2012
Showing with 22 additions and 14 deletions.
  1. +6 −6 r2/pod/Marpa_R2.pod
  2. +12 −4 r2/pod/Recognizer.pod
  3. +4 −4 r2/t/syn_engine.t
View
@@ -47,9 +47,9 @@ normalize-whitespace: 1
my $recce = Marpa::R2::Recognizer->new( { grammar => $grammar } );
$recce->read( 'Number', 42 );
- $recce->read( 'Multiply', );
+ $recce->read('Multiply');
$recce->read( 'Number', 1 );
- $recce->read( 'Add', );
+ $recce->read('Add');
$recce->read( 'Number', 7 );
sub My_Actions::do_add {
@@ -322,9 +322,9 @@ partial: 1
normalize-whitespace: 1
$recce->read( 'Number', 42 );
- $recce->read( 'Multiply', );
+ $recce->read('Multiply');
$recce->read( 'Number', 1 );
- $recce->read( 'Add', );
+ $recce->read('Add');
$recce->read( 'Number', 7 );
=for Marpa::R2::Display::End
@@ -570,9 +570,9 @@ normalize-whitespace: 1
Marpa::R2::Recognizer->new( { grammar => $ambiguous_grammar } );
$ambiguous_recce->read( 'Number', 42 );
- $ambiguous_recce->read( 'Multiply', );
+ $ambiguous_recce->read('Multiply');
$ambiguous_recce->read( 'Number', 1 );
- $ambiguous_recce->read( 'Add', );
+ $ambiguous_recce->read('Add');
$ambiguous_recce->read( 'Number', 7 );
my @values = ();
View
@@ -26,9 +26,9 @@ normalize-whitespace: 1
my $recce = Marpa::R2::Recognizer->new( { grammar => $grammar } );
$recce->read( 'Number', 42 );
- $recce->read( 'Multiply', );
+ $recce->read('Multiply');
$recce->read( 'Number', 1 );
- $recce->read( 'Add', );
+ $recce->read('Add');
$recce->read( 'Number', 7 );
=for Marpa::R2::Display::End
@@ -127,9 +127,9 @@ partial: 1
normalize-whitespace: 1
$recce->read( 'Number', 42 );
- $recce->read( 'Multiply', );
+ $recce->read('Multiply');
$recce->read( 'Number', 1 );
- $recce->read( 'Add', );
+ $recce->read('Add');
$recce->read( 'Number', 7 );
=for Marpa::R2::Display::End
@@ -184,6 +184,14 @@ including an attempt to C<read> a token
into an exhausted parser,
Marpa throws an exception.
+Note that passing an explicit C<undef> as the token value
+argument is
+quite different from omitting it.
+If the token value is omitted, it is a "whatever" value,
+one which could be anything.
+If it is C<undef>, then the token value
+is always a Perl C<undef>.
+
=head2 set
=for Marpa::R2::Display
View
@@ -54,9 +54,9 @@ $grammar->precompute();
my $recce = Marpa::R2::Recognizer->new( { grammar => $grammar } );
$recce->read( 'Number', 42 );
-$recce->read( 'Multiply' );
+$recce->read('Multiply');
$recce->read( 'Number', 1 );
-$recce->read( 'Add' );
+$recce->read('Add');
$recce->read( 'Number', 7 );
sub My_Actions::do_add {
@@ -101,9 +101,9 @@ my $ambiguous_recce =
Marpa::R2::Recognizer->new( { grammar => $ambiguous_grammar } );
$ambiguous_recce->read( 'Number', 42 );
-$ambiguous_recce->read( 'Multiply' );
+$ambiguous_recce->read('Multiply');
$ambiguous_recce->read( 'Number', 1 );
-$ambiguous_recce->read( 'Add' );
+$ambiguous_recce->read('Add');
$ambiguous_recce->read( 'Number', 7 );
my @values = ();

0 comments on commit f539cf0

Please sign in to comment.