APG
… an ABNF Parser Generator
|
During the parsing of the input string the AST object will collect records for all rule and UDT nodes with non-NULL call back function pointers. The call back function itself is never called during the parsing stage. Therefore, for parsing purposes, any non-NULL value will suffice to collect a record for the rule or UDT.
During translation, vAstTranslate(), rule and UDT call back functions are called only if
Therefore, it is possible to redefine the call back functions between the parsing and translation operations.
Note that this means, also, that multiple translations of an AST are possible. Simply redefine the call back functions with vAstSetRuleCallback() and vAstSetUdtCallback() and rerun vAstTranslate() as many times a needed. The AST data records remain unchanged until a new input string is parsed or the object is destroyed.