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
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |