OK, I'm at another computer, same system as yours, no older files but copied your code and my replacement from this thread, and downloaded portable Strawberry Perl v5.16.3

C:\>perl rec.pl Enter --> a=2 print 2 2 Enter --> C:\>perl -MParse::RecDescent -wE "say $Parse::RecDescent::VERSION" 1.967015 C:\>perl -v This is perl 5, version 16, subversion 3 (v5.16.3) built for MSWin32-x +64-multi-thread

Edit: I think failure to parse should prevent any changes to your "symbol table" i.e. %VARIABLE and suppress output from "print":

# ... expression : INTEGER OP expression { main::expression(@item) } | VARIABLE OP expression { main::expression(@item) } | INTEGER | VARIABLE <defer: $main::VARIABLE{$item{VARIABLE}} ||= 0 > { $main::VARIABLE{$item{VARIABLE}}} print_instruction : /print/i expression <defer: print $item{expression}."\n" > assign_instruction : VARIABLE "=" expression <defer: $main::VARIABLE{$item{VARIABLE}} = $item +{expression} > # ...

Enter --> a=1 Enter --> a=2 print a blah blah ERROR (line 1): Invalid instruction: Was expecting assign instr +uction, or print instruction Error returned by parsing Enter --> print a 1

Though perhaps it's laughable because lacks serious studying about how it really must be built.


In reply to Re^5: how to match entire buffer with Parse::RecDescent by vr
in thread how to match entire buffer with Parse::RecDescent by expo1967

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.