Boron 2.1.0
Functions
Domain Languages

These are small, special purpose evaluators. More...

Functions

UStatus ur_parseBlock (UThread *ut, UBuffer *blk, UIndex start, UIndex end, UIndex *parsePos, const UBuffer *ruleBlk, UStatus(*eval)(UThread *, const UCell *))
 Parse a block using the parse language. More...
 
UStatus ur_parseString (UThread *ut, UBuffer *str, UIndex start, UIndex end, UIndex *parsePos, const UBuffer *ruleBlk, UStatus(*eval)(UThread *, const UCell *), int matchCase)
 Parse a string or binary using the parse language. More...
 

Detailed Description

These are small, special purpose evaluators.

Function Documentation

◆ ur_parseBlock()

UStatus ur_parseBlock ( UThread ut,
UBuffer blk,
UIndex  start,
UIndex  end,
UIndex *  parsePos,
const UBuffer ruleBlk,
UStatus(*)(UThread *, const UCell *)  eval 
)

Parse a block using the parse language.

Parameters
blkInput to parse, which must be in thread storage.
startStarting cell in input.
endEnding cell in input.
parsePosIndex in input where parse ended.
ruleBlkRules in the parse language. This block must be held and remain unchanged during the parsing.
evalEvaluator callback to do paren values in rule. The callback must return UR_OK/UR_THROW.
Returns
UR_OK or UR_THROW.

◆ ur_parseString()

UStatus ur_parseString ( UThread ut,
UBuffer str,
UIndex  start,
UIndex  end,
UIndex *  parsePos,
const UBuffer ruleBlk,
UStatus(*)(UThread *, const UCell *)  eval,
int  matchCase 
)

Parse a string or binary using the parse language.

Note
UR_ENC_UTF8 strings are accepted but multi-byte characters are not handled.
Parameters
strInput to parse, which must be in thread storage.
startStarting character in input.
endEnding character in input.
parsePosIndex in input where parse ended.
ruleBlkRules in the parse language. This block must be held and remain unchanged during the parsing.
evalEvaluator callback to do paren values in rule. The callback must return UR_OK/UR_THROW.
matchCaseUse character case when comparing strings.
Returns
UR_OK or UR_THROW.