It occurs to me that perhaps I should be more clear about precisely what syntax is giving me trouble. It is the Object declaration syntax, which in detail runs thusly:

Classname objectid "Hardware Short Name" parent class someclass anotherclass yetanotherclass, with propertyname propertyvalue, anotherproperty anothervalue, propertythree list of values, propertyfour [ localvar anotherlocal; print "This is an embedded routine^"; anotherlocal=do_stuff(localvar); "Result: ", anotherlocal; ], has booleanattribute anotherattribute attrthree;

I don't need to handle all of that, though. The hardware short name is optional, as is the parent. (An object can be moved to another place in the object tree in the Initialise routine if need be.) The Classname can just be Object, and I don't really need class clauses, since I'm not doing anything sufficiently advanced to need more classes. I would like to be able to ignore an arbitrarily long list of boolean attributes following has, but the Perl code doesn't need to actually do anything with them. I don't really need embedded routines either. (I'm not doing anything full-fledged, just a small proof of concept, really.) What I'm mostly after are string (and maybe numeric) property values. I want to be able to put in Inform code like the object declarations in my earlier example and have the strings stored away, like I described.


sub H{$_=shift;while($_){$c=0;while(s/^2//){$c++;}s/^4//;$ v.=(' ','|','_',"\n",'\\','/')[$c]}$v}sub A{$_=shift;while ($_){$d=hex chop;for(1..4){$pl.=($d%2)?4:2;$d>>=1}}$pl}$H= "16f6da116f6db14b4b0906c4f324";print H(A($H)) # -- jonadab

In reply to Re: Pointers on working with another language's syntax by jonadab
in thread Pointers on working with another language's syntax by jonadab

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.