Breccia language definition - Breccia in practice is a production of texts, each comprising one or more documents. - Here the documents are defined in formal terms as document fracta.   │   │   ├─────┐   ╵ │ \ [graphical syntax notation], q.v. at end notes   document │   fractum ▲   ╷ │   ├─────┘   │   │   ▼ diagram, The form of a Breccian text. document fractum / A Breccian document in formal terms. - It comprises a head formed as a descriptor and/or a body formed as a sequence of body fracta.   │   │   ├──────┐ ┐   ╵ │ │   descriptor │ │ head   ╷ │ │   ┌────┤ │ ┘   │ ├──────┘   │ │   │ ├────┐ ┐   │ ╵ │ │   │ body ▲ │   │ fractum │ │ body   │ ╷ │ │   │ ├────┘ │   └────┤ ┘   │   │   ▼ - Either the descriptor or the body may be absent, but not both. / Absence of both implies no fractum and an empty document. - The descriptor is absent (and a body fractum present) if the first line of the document is perfectly indented and not part of a comment block. : re `perfectly indented` see `^^perfect indentation$` @ `^^ Whitepace$` document title - The document title, if any, is determined by the first fractal head in linear order that yields a non-empty result after collapsing the whitespace of the relevant part of its content according to head type: • document head or point head - The relevant part is the whole head exclusive of comment carriers and indentation blinds. • divider - The relevant part is its first label. ━━━━━━━━━━━━━ Alarm point ───────────── - A point with a bullet comprising ‘!!’, or ending with ‘!!’. - It forms urgent matter for the attention of authors. / E.g. indicating an error in the document. ━━━━━━━━━━━━━ Aside point ───────────── - A point with a bullet comprising ‘/’. - It forms matter of less prominence than its place would otherwise suggest. / E.g. matter to which the reader should give less attention on a first reading. - Its descriptor, if present, is largely free in form. ━━━━━━━━━━━━━━━━━━━━━━━ Associative reference ─────────────────────── / A command point. - It forms a reference by associating one or more pre-existing text sequences (referrer, or referrers) with a remote object (referent). - Its descriptor has this form:   referrer imperative   ╶── gap ──┬─╴ clause ── gap ──┬─╴ clause ────▶   │ │   └───────────────────┘ : re `(referrer).*\R.*╴ (clause)` see `^^ referrer clause$` : re `(imperative).*\R.* (clause)` see `^^ imperative clause$` diagram, The form of the descriptor in an associative reference. - The referrer clause indicates the referrer or referrers, while the imperative clause (in its referent clause) indicates the referent. : re `referent clause` see same @ `^^- The imperative clause includes` - A single referrer may be associated with multiple referents. / via multiple, sibling references that indicate the same referrer - Multiple referrers may be overlapped or nested in any manner. / via multiple, sibling references / via a single reference that indicates multiple referrers at once - An associative reference to a private referent of the same author, or authors, must itself be private, else the reference is malformed. : re `private` see `^^ Privatizer$` ───────────────── referrer clause ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ - Any referrer clause explicitly locates one or more referrers in the head of the reference’s parent. - Absent a referrer clause, the whole head is taken as the sole referrer. - Otherwise the referrers are located in the head by a pattern of text.   ╶──╴‘re’╶── gap ──╴‘`’╶── pattern ──╴‘`’╶───▶ referrers() / Every associative reference defines the resolution of its referrers, as follows. - A list in linear order of text sequences, each to be taken as a referrer. : re `text sequences` see `^^original resource$` @ `^^ Notes$` deem+ `h` a text sequence, that of `parental head text()`; `tt` a list of text sequences, intitally empty if( no referrer clause is present ) + Append `h` to `tt`. else deem+ `p` a pattern, that of the referrer clause for( each match `m` of `p` against `h` ) if( `m` captured no group ) + Append to `tt` the whole text sequence of `m`. else + Append to `tt` a disjoint text sequence comprising the union of all captured text sequences of `m`. if( `tt` is empty ) throw+ broken `re` clause, pattern `p` not found return+ `tt` parental head text() - The text sequence of the head of the parent of the associative reference. : re `text sequence` see `^^original resource$` @ `^^ Notes$` deem+ `p` a fractum, the parent of the associative reference if( `p` is headless ) / The parent is a headless document fractum. throw+ headless parent, reference is misplaced return+ the text sequence of the head of `p` ─────────────────── imperative clause ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ - The imperative clause includes a referential command, and includes or implies a referent clause.   referential   command   ┌──────────┐   ┌───────────────────────────┐   │ │   ┌─╴‘see’╶──┐ │ inferential │   ┌──┤ ├──┴── gap ──┬──╴ referent ╶──┴───┐   │ └─╴‘join’╶─┘ │ indicator │   │ │ │   ╶──┤ ┌─╴‘cf.’╶──┐ │ fractum ├────▶   │ │ │ │ ┌── indicator ──┐ │   │ ├─╴‘e.g.’╶─┤ └──┤ ├──┘   └──┤ ├───── gap ─────┤ resource │   ├─╴‘i.e.’╶─┤ └── indicator ──┘   │ │   ├─╴‘NB’╶───┤ └────────────────────┘   │ │ referent clause   ├─╴‘N.B.’╶─┤   │ │ \ [no ‘q.v.’]   ├─╴‘viz.’╶─┤   │ └──────╴◀────────┐   └─╴‘see’╶─┐ │   └── gap ─╴‘also’╶─┘ : re `(inferential).*\R.*(referent).*\R.*(indicator)` see `^^inferential referent indicator$` : re `(fractum).*\R.*(indicator)` see `^^ Fractum indicator$` : re `(resource).*\R.*(indicator)` see `^^ Resource indicator$` / The diagram includes a resource indicator only for sake of clarity. Redundant, it exactly equals a fractum indicator *comprising* a resource indicator. - The referential command of an imperative clause determines the overall type of associative reference, with implications for its overall effect. : re `overall type\R *of associative reference` see `^^. associative reference$` @ `^^ fractal types$` : re `overall effect` see `^^ effect of an associative reference$` - Any referent clause (inferential referent indicator, fractum indicator or URI reference) explicitly indicates the referent. - Absent the referent clause, any referrer clause *implies* the referent. - Absent the referrer clause, the referent is implied by the fractal head of the parent. inferential referent indicator - An inferential referent indicator comprises one or more of three parts that together define (i) referrer similarity, (ii) referential form and (iii) containment.   referrer similarity   ┌─── i ────┐   ┌────────────────────────────┐   ┌───────────────────────────┤ ┌──╴‘head’╶──┐ │   ╶──┤ ┌───╴‘same’╶────┐ └─┤ │ │ containment   └─┤ ├─┬── gap ──┤ ├─┬─┬── gap ──┴──╴ clause ╶──┬───▶   └──╴‘similar’╶──┘ │ └──╴‘term’╶──┘ │ │ │   └────────────────────────┘ └───────────────────────────┘     └── ii ──┘ └──── iii ────┘   referential form containment - The definition of referential form (ii) determines the form of the referent and how to locate it. Specifically: • ‘head’ defines the referent as a fractum to be located by the pattern of its head, while • ‘term’ defines the referent as a text sequence to be located by its own pattern. / Though formally allowed, such a referent is meaningless where the referential command is `join`. : see `^^- Where the referent is a text sequence` @ `^^effect$` @ `^^ Jointer$` - In either case, the operative pattern that pinpoints the referent is constructed by inference from the pattern of the referrer, or referrers. - Any containment clause (iii) delimits the context in which the pattern is sought. - The definition of referrer similarity (i) determines how broadly or narrowly the pattern is to be constructed. : see `^^pattern construction based on referrer similarity$` @ `^^ Notes$` default referrer similarity() return+ ‘similar’ default referential form() if( the containing associative reference includes a referrer clause ) return+ ‘term’ return+ ‘head’ indicated referent( inferential referent indicator `iIR` if present ) - The fractum or text sequence to be taken as the referent. : re `fractum or text sequence` see `^^original resource$` @ `^^ Notes$` deem+ `iF` a fractum indicator; `fR` a referential form if( `iIR` is absent ) + Set `fR` to `default referential form()`. + Set `iIR` to an an inferential referent indicator comprising `fR`. else if( `iIR` defines a referential form ) + Set `fR` to that referential form. else + Set `fR` to `default referential form()`. if( the referential form `fR` is ‘head’ ) + Set `iF` to `inferred pattern()` of `iIR` in gap-delimited conjunction with any containment clause of `iIR`. return+ `indicated fractum( iF )` / It follows that the referential form `fR` is ‘term’. if( `iIR` includes a containment clause ) + Set `iF` to the fractum indicator of the containment clause. deem+ `f` a fractum, that of `indicated fractum( iF if set )`; `p` a pattern, that of `inferred pattern()` of `iIR`; `tt` a list of text sequences, intitally empty for( each match `m` of `p` against the text sequence of the head of `f` ) if( `m` captured no group ) + Append to `tt` the whole text sequence of `m`. else + Append to `tt` each captured text sequence of `m`. if( `tt` is empty ) throw+ broken reference, pattern `p` not found return+ a disjoint text sequence comprising the union of all `tt` inferred pattern() - Constructs by inference from the pattern of the referrer, or referrers, a pattern to pinpoint the referent. deem+ `fR` the referential form if defined, else `default referential form()`; `p` a string buffer, initially empty; `cR` the referrer clause if present; `sR` the referrer similarity if defined, else `default referrer similarity()` if( `cR` is present ) then the pattern of the referrer(s) is the pattern of `cR` : re `pattern of the referrer` see @ `^^- Constructs by inference` @ `^^inferred pattern\(` + Set `p` to the pattern of `cR`. + Refine `p` according to referrer similarity `sR` and referential form `fR`. : see `^^pattern construction based on referrer similarity$` @ `^^ Notes$` else( then the pattern of the referrer(s) is the pattern of the parental head ) : re `pattern of the referrer` see @ `^^- Constructs by inference` @ `^^inferred pattern\(` + Set `p` to the string of `parental head text()`. + Trim `p` of comment carriers and indentation blinds. + Trim `p` of leading and trailing whitespace. + Set `p` to `literalized pattern( p )`. + Collapse all remaining whitespace of `p` to ‘\s+’. / Neutralizing differences in indentation and line wrapping. + Further refine `p` according to referrer similarity `sR` and referential form `fR`. : see `^^pattern construction based on referrer similarity$` @ `^^ Notes$` return+ `p` containment clause   ╶──╴‘@’╶── gap ── fractum indicator ────▶ referent() / Every associative reference defines the resolution of its referent, as follows. - The text sequence, fractum or other resource to be taken as the referent. : re `text .+ other resource` see `^^original resource$` @ `^^ Notes$` : re `other resource` see head @ https://tools.ietf.org/html/rfc3986#section-1.1 if( the imperative clause includes a resource indicator with a `non-fractal` qualifier ) return+ `indicated resource( resource indicator )` deem+ `iF` a fractum indicator; `iIR` an inferential referent indicator if( a referent clause is present ) if( the referent clause comprises a resource indicator ) + Set `iF` to a fractum indicator comprising the resource indicator. else if( the referent clause comprises a fractum indicator ) + Set `iF` to the fractum indicator. else( the referent clause comprises an inferential referent indicator ) + Set `iIR` to the inferential referent indicator. break+ `if( a referent clause is present )` deem+ `f` a fractum, that of `indicated fractum( iF )`; `mF` a match, the match of `f` if any occurred if( no `mF` occured or `mF` captured no group ) return+ `f` return+ a disjoint text sequence comprising the union of all captured text sequences of `mF`. return+ `indicated referent( iIR if set )` ──────────────────────────────────── effect of an associative reference ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ / Textual references and described effect herein are simulacral. : see `^^simulacral effect and reference$` @ `^^ Notes$` - The associative reference defines the resolution of its referrers and referent. referrers() : join @ `^^ referrer clause$` referent() : join @ `^^ imperative clause$` / Any further effect depends on the overall type of reference as determined by the referential command. : re `overall type of reference` join `^^. associative reference$` @ `^^ fractal types$` if( the referential command is `join` ) : join `^^effect$` @ `^^ Jointer$` ━━━━━━━━━━━━━━━━ Autoprivatizer ──────────────── - A privatizer that encodes within it another command, making it private. / So pertaining soley to the author, or authors. : cf. `^^ Comment carrier$` - Its descriptor has this form:   ╶──╴‘privately’╶── gap ── command point descriptor ────▶ \ No provision for a null command. - Its descriptor formally includes the descriptor of the other command. effect / Textual references and described effect herein are simulacral. : see `^^simulacral effect and reference$` @ `^^ Notes$` if( the included command point descriptor is that of a privatizer ) throw+ + Remove ‘privately’ and its subsequent gap. + Append as child a parental privatizer. ━━━━━━━━━━━━━━━ Command point ─────────────── - A point with a bullet comprising ‘:’. - The form of its descriptor, if any, varies with the type of command point. : re `type of command point` see `^^ fractal types$` @ `^^ Fractum$` / Only in the case of a *null command* may the descriptor be omitted. - Processors interpret command points and run the commands they encode in linear order. null command - A command point that does nothing. \ An artifact of formal consistency, \ it occurs only because a descriptor is defined as optional in a point head. - Its descriptor may be omitted. - If present, it has this form:   ╶── gap ───▶ ━━━━━━━━━━━━━━━━━ Comment carrier ───────────────── / Part of a descriptor gap or divider segment. - A carrier of commentary for the attention of authors, publishers or other atypical readers. : cf. `^^ Autoprivatizer$` : cf. `^^ Parental privatizer$` - Formally it appears as either a comment appender or a comment block. comment appender - A carrier for commentary subsequent to non-commentary on the same line.   commentary   ┌─────────────────────┐     ┌────╴◀─────────┐   inline non- ┌─╴◀────┐ ┌─╴◀────┐ │ │   -whitespace │ │ ┊ │ │ │ inline │ ┊ end of   or no-break ╶─┴─╴‘ ’╶─┘ ┊╶──┴─╴‘\’╶─┴─┬─╴‘ ’╶─┬─┴── character ──┴─┬─┬────▶ ┊ line   space (A0) ┊ │ │ │ │ ┊   │ └───────────────────┘ │   └─────────────────────────────┘     └───────────────────────────────────────────┘   comment appender : re `commentary` see `^^commentary$` @ `^^ Notes$` : re `A0` see `^^character identification$` @ `^^ Notes$` comment block - A comment carrier that extends over a sequence of (one or more) whole lines.   commentary   ┌─────────────────────┐     ┌────╴◀─────────┐   ┌─╴◀────┐ ┌─╴◀────┐ │ │   start ┊ │ │ │ │ │ inline │ ┊ end of   of ┊╶──┬─┴─╴‘ ’╶─┴─┬─┴─╴‘\’╶─┴─┬─╴‘ ’╶─┬─┴── character ──┴─┬─┬────▶ ┊ line   line ┊ │ │ │ │ │ │ ┊   └───────────┘ │ └───────────────────┘ │   └─────────────────────────────┘ : re `commentary` see `^^commentary$` @ `^^ Notes$` diagram, The form of each line of a comment block. comment block label / A type of commentary. Part of a comment block. - Commentary delimited by two or more backslashes in a comment block.   label   ┌───────────────────┐     ┌────╴◀─────────┐   ┌─╴◀────┐ ┌─╴◀────┐ │ │   start │ │ │ │ ┊ │ inline │ ┊ end of   of ╶──┬─┴─╴‘ ’╶─┴─┬─╴‘\’╶─┴─╴‘\’╶─┴─╴‘ ’ ┊╶──┴── character ──┴────▶ ┊ line   line │ │ ┊ ┊   └───────────┘ ━━━━━━━━━━━━ Descriptor ──────────── / Part of a document head or point head. - Elaborative, explanatory text in the head of a point or document fractum. - It starts with a gap.   · · · ·   · · ┊ end boundary   ╶── gap ─── · ? · ────▶ ┊ of head   · · ┊   · · · · : re `(end boundary)\R.+(of head)` see `^^- Its end boundary` @ `^^head$` @ `^^ Fractum$` diagram, The abstract form of a descriptor. - Only in the head of a document fractum may the leading gap begin with a comment block or indentation blind. - What follows the gap (abstracted from the diagram) depends on the type of fractum in which the descriptor appears. - Most descriptors are largely free in form, constrained only by the end boundary of their head (as shown). - The descriptor of a command point, however, is further constrained. gap - A form of separator appearing in a descriptor.   ┌────────────────────────────╴◀─────────────────┐   │ │   │ ┌───────────────╴‘ ’╶─────────────────────┐ │   ╶──┬──────────────────────┴──┤ comment ├──┴────▶   │ ┌─╴◀────┐ │ ┌────╴ block ╶────┐ │   │ │ │ comment └──┬── newline ──┬──┤ ├─┬─┘   └──┴─╴‘ ’╶─┴─── appender ────┘ │ └── indentation ──┘ │   │ blind │   └──────────────────────┘ : re `(comment).+\R.+(block)` see `^^comment block$` : re `(comment).+\R.+(appender)` see `^^comment appender$` : re `(indentation).+\R.+(blind)` see `^^ Indentation blind$` @ `^^ Whitepace$` - Outside of a comment block, no gap contains perfect indentation. / Outside of a comment block, such indentation would instead start a body fractum, and therewith form the end boundary of the gap and the head that contains it. ━━━━━━━━━━ Division ────────── - A body fractum with a head in the form of a divider. divider - The head of a division. - It comprises one or more divider segments.   │   │   ├─────┐   ╵ │   divider ▲   segment │   ╷ │   ├─────┘   │   │   ▼ - It follows that sibling dividers cannot be made contiguous; rather their segments would join to comprise one divider. divider segment / Part of a divider. - It starts with a perfectly indented divider drawing character.   ┌───╴◀────────┐ ┊   perfect divider │ │ ┊ divider segment,   indentation ──╴ drawing ──┬─┴─ character ─┴─┬───▶ ┊ non-divider fractum,   character │ │ ┊ or end of document   └─────────────────┘ ┊ : re `(perfect).+\R.+(indentation)` see `^^perfect indentation$` @ `^^ Whitepace$` : re `(divider).+\R.+(drawing).+\R.+(character)` see `^^divider drawing character$` - Outside of comment carriers and indentation blinds, characters between the leading, divider drawing character and the end boundary of the segment (rightmost in diagram) are unconstrained in form. divider drawing character - A character in the Unicode range 2500-259F. : re `2500-259F` see `^^character identification$` @ `^^ Notes$` division label / Part of a divider segment. - A sequence of characters that ⁃ lies within a divider segment, ⁃ lies outside of a comment carrier, ⁃ lies outside of an indentation blind, ⁃ contains no divider drawing character and ⁃ excludes any leading or trailing whitespace. division titles( divider `d` ) - A list in linear order of character strings, each to be taken as a title of the division headed by `d`. / Presenters may give greater prominence to division titles, e.g. showing them in bold face. / Consider for example this divider:   ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╮   This is a division title, ┊ This is not   and it includes this ┊   ┄┄┄┄┄┄┄┄┄┄┄┄┄ This is not ┄╯   This is a 2nd division title / Assume the horizontal lines above (‘┄┄┄’) are perfectly indented. : re `perfectly indented` see `^^perfect indentation$` @ `^^ Whitepace$` / Calling `division titles( example divider )` would yield: ⇒ ‘This is a division title, and it includes this’ ‘This is a 2nd division title’ deem+ `tt` a string list, intitally empty / `tt` The list of title strings. deem+ `t` a string, `n` a text line / `t` The title being assembled, yet to be appended to `tt`. / `n` The line whose label last contributed to `t`. for( each division label `b` of divider `d` ) if( `b` leads the line on which it occurs, discounting spaces (20) ) : see `^^character identification$` @ `^^ Notes$` - Then `b` is a titling label, meaning it contributes to a title. if( `n` is unset ) - Then `b` starts the first title. + Set `t` to the string of `b`. else if( `b` occurs on the line succeeding `n` ) - Then `b` appends to the title (`t`) made by its predecessor. + Set `t` to the concatenation of `t` + space character + string of `b`. else( `t` is fully assembled and `b` starts a new title ) + Append to `tt` a copy of `t`. + Set `t` to the string of `b`. + Set `n` to the line on which `b` occurs. if( `t` is set ) - Then `d` has a titling label and final title assembly `t`. + Append to `tt` a copy of `t`. return+ `tt` ──────────────── false division ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ - A false division is a group of siblings wherein only the first is a true division (often a headless one, a bare divider), the remainder being of other fractal types. - Normally a sibling *successor* to a division is itself a division. - Where it is not, it may appear (owing to its placement under the same divider) to be *part* of that division. - Such an apparently *extended* division is called a false division. / The appearance of extension is false because the successors lie ‘under’ the same divider merely in terms of linear order, not hierarchy. - False divisions are a linear form of partition, as opposed to the hierarchic form of true divisions. / The whole of a false division may be transformed to a true division by indenting all but the first sibling into the *body* of the first. ━━━━━━━━━ Fractum ───────── - A fractum is the basic formal unit of Breccian composition, recursion and order. - It divides formally into two parts: a head and a body.   │   │   ╵   · · · · ┐   · · │   · ? · │ head   · · │   · · · · ┘   ╷   │   ┌────┤ ┐   │ ├────┐ │   │ ╵ │ │   │ body ▲ │ body   │ fractum │ │   │ ╷ │ │   │ ├────┘ │   └────┤ ┘   │   │   ▼ diagram, The abstract form of a fractum. head - The part of a fractum exclusive of its children. - Its form (shown abstractly in the diagram) varies according to fractal type. - Never does the head of a body fractum, however, begin with a newline. / Only a document head may begin with a newline. - Every newline belongs to the same fractal head as the character that precedes it; or, if no character precedes it, then it belongs to the document head. - Always its end boundary (not fully shown) comprises one of: • The head successor. - The head successor (S) is the fractum succeeding the head in linear order. - In terms relative to the head’s own fractum F, S is the first applicable of: ⁃ The first child of F. / In its body, that is. ⁃ The next sibling of F. ⁃ The next sibling of the nearest ancestor of F. - Always in this case the final character sequence of the head comprises one or more newlines. / In this case, even a point head that nominally omits its descriptor must in fact have a descriptor comprising one or more newlines. • The end of the document. body - The part of a fractum comprising its children alone; a sequence of sibling body fracta. - A body is always optional: regardless of fractal type, it may be omitted. ─────────────── fractal types ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ ◆ document fractum ◆ body fractum ◆ division ◆ point ◆ alarm point ◆ aside point ◆ command point ◆ associative reference ◆ jointer ◆ pointer ◆ null command ◇ privatizer ◆ autoprivatizer ◆ parental privatizer ◇ generic point ◆ task point legend ◆ formal type ◇ informal type ───────────────────── hierarchic relata ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ : privately cf. `comparative genealogical terms$` @ http://reluk.ca/project/proto-wayic/origins/doc.task ancestor, of a body fractum - One of the parent and the parent’s ancestors. / No document fractum has an ancestor, body fracta alone have ancestors. parent, of a body fractum - The nearest predecessor of less indentation, if any, otherwise the document fractum. / No document fractum has a parent, body fracta alone have parents. sibling, of a body fractum - Another of the same parent. / No document fractum has a sibling, body fracta alone may have siblings. / No document fractum is a sibling; all siblings are body fracta. child, of a fractum - One for whom the fractum is parent. / No document fractum is a child; all children are body fracta, and vice versa. descendant, of a fractum - One of the children and their descendants. / No document fractum is a descendant; all descendants are body fracta, and vice versa. ─────────────── linear relata ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ predecessor, of a fractum or character - Another that precedes in linear order. / (in the definite sense, e.g. ‘the predecessor’) The immediate predecessor. successor, of a fractum or character - Another that follows in linear order. / (in the definite sense, e.g. ‘the successor’) The immediate successor. ━━━━━━━━━━━━━━━━━━━ Fractum indicator ─────────────────── / Part of an associative reference or other referential markup. - A fractum indicator comprises one or both of a pattern series and a resource indicator.   ┌──────────────────────────────────────────┐   ╶──┤ │   └──┬──╴‘`’╶── pattern ──╴‘`’╶──┬──┬── CS ──┴── resource indicator ──┬────▶   │ │ │ │   └─────────────╴◀── CS ──────┘ └─────────────────────────────────┘ - In the nominal case, absent a `non-fractal` qualifier that is, it indicates a fractum. : re `\`non-fractal\` qualifier` see `^^ Resource indicator$` - Any pattern series pinpoints with each pattern a fractal head, while any resource indicator resolves to a Breccian document and therewith a document fractum. - The overall indicated fractum is the one resolved leftmost in the indicator and so deepest in the fractal hierarchy. / For example, here is a fractum indicator for the present fractum:   `^^/ For example, here is` @ `^^ Fractum indicator$` @ ./language_definition.brec     └────────────────────────┘ └─────────────────────┘ └──────────────────────────┘   pattern pattern resource indicator - Otherwise no actual fractal indication is here defined. - The only definite indication in the presence of a `non-fractal` qualifier is the indicated resource, namely the referent of the URI reference. : re `URI reference` see @ `^^ Resource indicator$` / It may be left to the reader to determine what more, if anything, the author intends. CS, containment separator   ╶── gap ──╴‘@’╶── gap ───▶ indicated fractum( fractum indicator `i` if present ) - The fractum indicated, together with any match that occurred to pinpoint it. : re `fractum` see `^^original resource$` @ `^^ Notes$` deem+ `p` a pattern / The next pattern to seek in the body of fractum `f`. if( `i` is present ) if( `i` includes a resource indicator with a `non-fractal` qualifier ) throw+ non-fractal resource if( `i` includes a pattern series ) + Set `p` to the final pattern in linear order. deem+ `r` a resource, namely `indicated resource( any resource indicator of i )` if( `r` contains no document fractum ) throw+ non-Breccian resource deem+ `f` a fractum, initially the document fractum of `r`; `mF` a match; `desc` a fractum / `desc` A descendant fractum of `f`, the last matched. while( `p` is set ) for( each match `m` of pattern `p` against the body of `f` ) deem+ `head` the fractal head intersected by the first line of `m` unless( all lines of `m` intersect `head` ) throw+ ambiguous reference, `p` intersects multiple heads if( `desc` is set ) throw+ ambiguous reference, `p` matches multiple fracta + Set `desc` to the fractum of `head`. + Set `mF` to `m`. if( `desc` is unset ) throw+ broken reference, pattern `p` not found + Set `f` to `desc`. + Unset `desc`. + Set `p` to its predecessor in `i`, if any, else unset it. return+ `f` and any `mF` ━━━━━━━━━━━━━━━ Generic point ─────────────── - A point of no formal subtype. : see `^^ fractal types$` - It is largely free in form and its descriptor may be omitted. ━━━━━━━━━━━━━━━━━━━ Indentation blind ─────────────────── / Part of a descriptor gap or divider segment. - A sequence of lines whose first non-plain-space character (non-20) is a no-break space (A0). : see `^^character identification$` @ `^^ Notes$` ·   ┌─╴◀────┐ ┌───╴◀────────┐ ┊   start ┊ │ │ │ │ ┊ end of line or   of ┊╶──┬─┴─╴‘ ’╶─┴─┬── A0 ──┬─┴─ character ─┴─┬────▶ ┊ comment appender   line ┊ └───────────┘ │ │ ┊   └─────────────────┘ diagram, The form of each line in an indentation blind. This diagram itself is an example of a blind comprising several such lines. - Regardless of its indentation, no line of an indentation blind is *perfectly* indented. : re `.perfectly. indented` see `^^perfect indentation$` @ `^^ Whitepace$` - Therefore no indentation blind ever interrupts the fractal head in which it occurs; always the head continues through the blind. - Outside of any comment appender, the inline characters after the leading no-break space are unconstrained in form. ━━━━━━━━━ Jointer ───────── - An associative reference with a referential command of `join`. - In effect it stands for the fractal body of its referent. - Any referrer clause in a jointer indicates the referrer in particular as the rationale for writing the jointer into the text. effect / Textual references and described effect herein are simulacral. : see `^^simulacral effect and reference$` @ `^^ Notes$` - Where the referent is a non-fractal resource, the jointer has no effect beyond that of an associative reference. - Where the referent is a text sequence, instead the referent is taken as the fractum in whose head the text sequence occurs. - Each parent of the jointer gains for a child each child of the referent that does not duplicate a pre-existing child. / Not to imply that the text would be presentable in this form. / If in the source code the referent fractum itself has a jointer as its child, then the effect will apply recursively. - By the same token, the children of the referent gain for a parent each parent of the jointer that does not duplicate a pre-existing parent. / Again, the effect here is recursive. - In both cases, the duplication test ignores variance in whitespace and comment carriers. ━━━━━━━━━━━━━━━━━━━━━ Parental privatizer ───────────────────── - A command point that makes a private fractum of its simulacral parent. / So pertaining soley to the author, or authors. : cf. `^^ Comment carrier$` / The effect applies to the parent and all its descendants. - Its descriptor has this form:   ╶──╴‘private’╶───▶ ━━━━━━━━━━━━━━━━━━ Pattern matching ────────────────── - Certain command points use regular-expression patterns to match text sequences. - Pattern matching there is blind both to comment carriers and to sequences of space characters that immediately precede a comment appender. / Effectively they are removed before matching proceeeds. - It proceeds in multiline mode, as for Perl’s `m` operator. : see `^^m$` @ non-fractal https://perldoc.perl.org/perlre#Modifiers - The pattern language comprises a subset of the formal elements defined by Perl, together with a few additions tailored to Breccia, all as detailed below. \b - Word boundary. : see https://perldoc.perl.org/perlrebackslash#%5Cb%7B%7D,-%5Cb,-%5CB%7B%7D,-%5CB \d - Decimal digit. : see https://perldoc.perl.org/perlrebackslash#Character-classes \R - Line break. : see https://perldoc.perl.org/perlrebackslash#%5CR \t - Four spaces, viz. one unit of Breccian perfect indentation. / As opposed to (Perl) a tab character. : see https://perldoc.perl.org/perlrebackslash#Fixed-characters \N{⋯} - Character or character sequence by name or number. : see https://perldoc.perl.org/perlrebackslash#Named-or-numbered-characters-and-character-sequences \  - To take ‘away the special meaning of the character following it’. : see https://perldoc.perl.org/perlrebackslash#The-backslash / It could inadvertently form a comment appender:   : see ` \\ ` @ non-fractal foo.html / To avoid that, use instead an equivalent pattern, such as:   : see ` \\\N{U+20}` @ non-fractal foo.html ^^ - Breccian perfect indentation. / Equivalent to `^\t*` ^ - The beginning of a line (zero width). : see https://perldoc.perl.org/perlre#Metacharacters . - Any character except a logical newline. : see https://perldoc.perl.org/perlre#Metacharacters $ - The end of a line (zero width). : see https://perldoc.perl.org/perlre#Metacharacters | - Alternation. : see https://perldoc.perl.org/perlre#Metacharacters (⋯) - Capture group. : see https://perldoc.perl.org/perlre#Capture-groups (?:⋯) - Cluster group. : see https://perldoc.perl.org/perlre#(?:pattern) / Excluding the flag modifiers. * - Zero or more times. : see https://perldoc.perl.org/perlre#Metacharacters +  - One or more times. : see https://perldoc.perl.org/perlre#Metacharacters ? - Once or not at all. : see https://perldoc.perl.org/perlre#Metacharacters ━━━━━━━ Point ─────── - A body fractum with a head in this form:   start ┊ perfect ┊ head successor,   of ┊╶─── indentation ─── bullet ──┬── descriptor ──┬────▶ ┊ or end of document   line ┊ │ │ ┊   └────────────────┘ : re `(perfect).+\R.+(indentation)` see `^^perfect indentation$` @ `^^ Whitepace$` : re `head successor` see `^^\| the head successor$` @ `^^ Fractum$` diagram, The form of a point head. - Whether the descriptor may be omitted depends on the subtype of point. : re `subtype of point` see `^^. point$` @ `^^ fractal types$` @ `^^ Fractum$` bullet - The bullet of a point head is defined by its leading and trailing edges as shown in the diagrams below.   non-backslash, non-whitespace,   perfect ┊ ┌─────╴ non-divider-drawing character ────────┐   indentation ┊╶──┤ ├────▶   ┊ └──┬─╴‘\’╶─┬──╴ non-backslash, non-newline, ──┘   │ │ non-plain-space character   └─╴◀────┘ : re `(perfect).+\R.+(indentation)` see `^^perfect indentation$` @ `^^ Whitepace$` : re `divider-drawing character` see `^^divider drawing character$` diagram, The form of a bullet’s leading edge. - The edge definitions are not mutually exclusive, their characters may overlap. / The bullet may, for example, comprise a single character that alone occupies both the leading and trailing edge. - Between the edges, any non-alphanumeric, non-whitespace character may be followed by a single no-break space (A0). : see `^^character identification$` @ `^^ Notes$` / Authors may use such a no-break space in lieu of a plain space in order to avoid the formation of a trailing edge that would prematurely terminate the bullet. ·   ┊   non-alphanumeric ┌───▶ ┊╶───╴‘ ’   ┌──╴ non-whitespace ╶──┤ ┊   ╶──┤ character └───▶ ┊╶──┬── A0 ──┐ comment   │ ┊ │ │ ┌─╴◀────┐ ┌───▶ appender   └──── alphanumeric ────┐ ┊ └────────┴──┐ │ │ │   character └───▶ ┊╶──────────────┴──┬─┴─╴‘ ’╶─┴──┴──┬──▶ end of line   ┊ │ │ or document   └───────────────┘ : re `(comment).+\R.+(appender)` see `^^comment appender$` diagram, The form of a bullet’s trailing edge. The bullet itself includes only the parts left of the dashed line. - No bullet ends with a space character (20 or A0). - Any space character at the trailing edge is separate from the bullet proper. ━━━━━━━━━ Pointer ───────── - An associative reference whose referential command is one of: ⁃ `cf.` ⁃ `e.g.` ⁃ `i.e.` ⁃ `NB` ⁃ `N.B.` ⁃ `see` ⁃ `see also` \ Has no abbreviated form. https://english.stackexchange.com/q/491883/371457 ⁃ `viz.` ━━━━━━━━━━━━━━━━━━━━ Resource indicator ──────────────────── / Part of an associative reference or other referential markup. ·   ╶──┬──╴‘non-fractal’╶── gap ──┬── URI reference ────▶   │ │   └──────────────────────────┘ : re `URI reference` see https://tools.ietf.org/html/rfc3986#section-4.1 - The `non-fractal` qualifier, if present, stops any runtime attempt to distinguish fracta in the URI referent. / Authors may use it to forestall runtime errors, e.g. in cases where the referent is non-Breccian or malformed. indicated resource( resource indicator `i` if present ) : re `resource` see head @ https://tools.ietf.org/html/rfc3986#section-1.1 : re `resource` see `^^original resource$` @ `^^ Notes$` deem+ `r` a resource, initially the present document if( `i` is present ) unless( the URI reference of `i` resolves to a referent ) throw+ broken reference + Set `r` to the referent. return+ `r` ━━━━━━━━━━━━ Simulacrum ──────────── - A simulacrum is the dynamic, runtime form of a Breccian text, as opposed to the static, written form of its source code. - It results from executing the text. - Initially made equal to the source text at runtime, the simulacral text is then transformed by the effect of its embedded command points. - The transforms themselves are executed till repeated execution leaves the simulacrum unchanged. - If execution throws an error or other exception, then no simulacrum results. default referent: source code or simulacrum? - Throughout the language definition, the default referent is the source code. - Where otherwise it would be unclear whether the definition is referring to the simulacral versus the source text, take it as referring to the source text. ━━━━━━━━━━━━ Task point ──────────── - A point with a bullet comprising ‘+’, or ending with ‘+’. - It describes work to be done or undertaken. / After the definition of ‘task’ in the Oxford English Dictionary. : see https://www.lexico.com/en/definition/task \ Defining a specialized point for tasking is justified by the Breccian purpose of text drafting \ for which inline tasking is an important capability. \ re `purpose of text drafting` see `for point-form outlining and drafting` @ README.html ━━━━━━━━━━━━ Whitespace ──────────── allowed whitespace : see `^^character identification$` @ `^^ Notes$` • plain space ‘ ’ (20) • newline (A and/or D) • no-break space (A0) as described for use in bullets and indentation blinds \ Allowing other horizontal whitespace characters (e.g. 9, 2000-200A, 202F, 205F, 3000) \ might lead to confusion, considering that indentation determines syntax. perfect indentation - Perfect indentation comprises zero or more plain-space sequences (20), each four characters in length, properly bound.   ┌───────────╴◀────────────┐   start ┊ │ │ ┊   of ┊╶──┬─┴─╴‘ ’╶─╴‘ ’╶─╴‘ ’╶─╴‘ ’╶─┴─┬───▶ ┊ non-whitespace   line ┊ │ │ ┊   └─────────────────────────────┘ - The start boundary is the start of a line, and the end boundary a non-whitepace character. ━━━━━━━ Notes ─────── character identification - Characters are here identified by the hexadecimal codes of the Unicode standard. : re `Unicode standard` see https://www.unicode.org/standard/standard.html commentary - Though unclear from the diagram, the part labeled ‘commentary’ excludes any leading or trailing space character. \\ [graphical syntax notation] \ - The present text uses syntax diagrams because it is aimed at Breccian authors in general, \ who are not expected to be comfortable with a textual notation such as Backus-Naur Form. \\ [no ‘q.v.’] \ - No referential command of `q.v.` is defined. \ ∵ It would complicate the definition. \ ∵ Formally it would make grammatical sense to the reader only in conjunction with both \ no referrer clause, and either an inferential referent indicator or no referent clause. \ ∵ It would be redundant. \ ∵ The present commands suffice to handle all potential use cases of `q.v.`. original resource - Each text sequence, markup element or other resource here mentioned is the original in its place, not a separate copy of the original. pattern construction based on referrer similarity : see @ http://reluk.ca/project/Breccia/action_plan.brec - How the construction is refined according to referrer similarity in particular cases has yet to be defined, pending implementation trials. simulacral effect and reference - The described effect is located in the simulacrum. - Here the default referent is the simulacral text, not the source text. : cf. `^^default referent` @ `^^ Simulacrum$` \ Copyright © 2019-2020 Michael Allan. Licence MIT.