THIS PAGE DESCRIBES SOME ACTION CONTROLS ======================================== COMMONLY USED: -------------- .n - no action; : - ":" if not the last queue-element is interpreted as .n if last, then is a queue-continuation .end - terminates text (file) execution; nest reset to -r queue is deleted; variables undeclared .end_text - the same as .end .stop - terminates project execution and resets compiler .compile_schema - immidiately triggers Compi to interpret incoming text as text of schema .i prepare an indent. Explained in indent_help.txt. .I same as .i, but outputs indent immediately. .& output action cluster's text (or token if text is empty) to open streams if any; if not, then to resut text; .&& to BOTH opens streams and and result text. .~ output to console. .= assign prepared-text text.=MyVariable - assigns text to variable MyVariable .=MyVariable - assigns current token to MyVariable text.= - assigns text to token control = can be used for replacement; format is: [text].=variable.replacee.replacer which replaces "replacee" with "replacer" in a [text]. If [text] is omitted, then token used instead. .0 clean up global queue, fast; .1 clean up gloabl queue slow, but cleans up memory from garbage also; CONTROLS WHICH ALTERNATE BETWEEN TOKEN AND TEXT ----------------------------------------------- [text].=[variable] - assigns text to variable; ..variable[.text] has the same effect; [text].=variable.replacee.replacer - replaces "replacee" with "replacer" in a [text]. [text].~ - outputs text to console [text].L[.[variable]] - assigns variable = low case ( text ) [text].U[.[variable]] - assigns variable = upper case ( text ) [text].T[.[variable]] - assigns variable = trim ( text ) [text].& - outputs text to streams if any and not to main stream if none of streams are open, outputs to main stream [text].&& - outputs text to streams and ultimately to main stream "out" text. - the same as text.& text - the same as text.& "". - the same as "".& "some text" - the same as "some text".& If text is omitted in [text], then token used instead. If variable is omitted then token is used instead. DIRECT SOURCE TEXT ACCESS ------------------------- [text].byte - takes one byte from position pos from the source text. Byte's value is interpreted as a number from 0 to 256. If expression or srting [text] is not empty, then pos = [text]. token = extracted byte is assigned to token. Then position is advanced: pos = pos + 1; NO EVENTS ARE PRODUCED AT THIS ACTION [text].char - acts similar way as "byte" but value is interpreted as a character. [text].upto - assumes that there is only one sepatator, and it is equal to [text]; so, all before [text] is assumed to be a token, and internal variable "token" receives a value of this token; current tokenizer cursor is set to the beginning of [text]; if [text] is not found, all remaining text in source file is assigned to the token, and "pos" is set to file_len + 1, where "pos" is current tokenizer position. for example: if action is =.upto , and current source-text is string=string2, , then 'text' = '=' , token = "string", , and position = 7; Schema: \\-r .bot : ?.upto "token=$ " . " Here: $" .end | Where is the end ? Omitted ... Output: token= Where is the end Here: ? token resulted from this controls is (as always) a string: therefore, byte, word, lword, ... are the strings of decimal characters, f.e. byte in source text 0x40 will give string: "64". .char - takes character from current pos .2chars - takes two consequent chars .word - token = cstr( first*256 + second ); assuming that first byte is most significant: big endian word storage; .bword - "backward" word: token = cstr( first + second * 256 ); little endian word storage; .lword - "long word": token = cstr( first*256*256*256 + second*256*256 + third*256 + fourth); note: values greater than 2^31-1 submitted as negative .blword - token = cstr( fourth*256*256*256 + third*256*256 + second*256 + first); note: values greater than 2^31-1 submitted as negative .byte - token = cstr( first ) .str<number> - takes <number>-bytes length string from current pos; pos is advanced to the first untaken byte after taken string; FEW CONVERSION CONTROLS (most of them are useless) -------------------------------------------------- this controls do not accept text from the first action fragment as a token's replacement; the text must be empty; result goes to varible "v" or to token: .%hc[.v] - hexadecimal to character: v = Chr(CInt(token)) like: &h41 --> "A" 41 --> "A" .%oc[.v] - octal to character: &O101 --> "A" 101 --> "A" .%dc... - v = char(clng(token)); "no change" useless; .%dd... - v = cstr(clng(token)); "no change", useless; .%cd... - v = cstr(asc(token's first char)); taking ASCII;