File union.icn |
union.icn - Union Object Notation (UniON) support
Authors: Gigi Young, Clinton Jeffery, Steve Wampler
The Union class is intended to support conversion of Unicon values to and from a JSON-like string format, UniON, that is suitable for storage or transmission. It draws extremely heavily from Gigi's json.icn with the major difference that it emphasizes intra-Unicon encoding and decoding of values over inter-language support for JSON syntax. For example, Unicon structures (csets, sets, tables, records, and objects) are uniquely identified as such in their UniON form.
This file is part of the propertydb package.
Source code.Details |
Procedures: |
u | Unicon value to encode |
uerror | Error handling support class instance |
Given a Unicon structure, produce a UniON equivalent if possible. Intended for internal use only.
parse_array(token, token_gen, parse_funcs, refs, uerror)
parse_class(token, token_gen, parse_funcs, refs, uerror)
Intended for internal use only.
parse_false(token, token_gen, parse_funcs, refs, uerror)
Returns a string to represent a boolean false Intended for internal use only.
parse_null(token, token_gen, parse_funcs, refs, uerror)
Returns the null value Intended for internal use only.
parse_number(token, token_gen, parse_funcs, refs, uerror)
Returns the numeric() of the token Intended for internal use only.
parse_object(token, token_gen, parse_funcs, refs, uerror)
Helper parsing function that recognizes the production rules for a UniON object. The first token can denote that the object is a Unicon table, set, record, or class. If it doesn't then a table is assumed for backward compatibility. Intended for internal use only.
parse_record(token, token_gen, parse_funcs, refs, uerror)
Intended for internal use only.
parse_ref(token, token_gen, parse_funcs, refs, uerror)
Replace with the referenced value. Intended for internal use only.
parse_set(token, token_gen, parse_funcs, refs, uerror)
Helper parsing function recognizes the production rules for a UniON set. Returns a Unicon set if the syntax is proper (success). Intended for internal use only.
parse_string(token, token_gen, parse_funcs, refs, uerror)
Removes the delimiting double-quotes from the token. Converts to cset if there are delimiting single-quotes instead of double-quotes. Intended for internal use only.
parse_table(token, token_gen, parse_funcs, refs, uerror)
Intended for internal use only.
parse_true(token, token_gen, parse_funcs, refs, uerror)
Returns a string to represent a boolean true Intended for internal use only.
uerror | Error handling support class instance |
String scanning helper function that identifies a UniON cset and returns a Unicon cset. Intended for internal use only.
uerror | Error handling support class instance |
String scanning helper function that finds a valid UniON escape sequence and returns a valid Unicon escape or escape sequence if possible. Intended for internal use only.
uerror | Error handling support class instance |
String scanning helper function to retrieve UniON value 'false' Intended for internal use only.
uerror | Error handling support class instance |
String scanning helper function to retrieve UniON value 'null' Intended for internal use only.
c | first character in scan |
uerror | Error handling support class instance |
String scanning helper function that returns a UniON number as a string Intended for internal use only.
uerror | Error handling support class instance |
String scanning helper function that identifies a UniON string and returns a Unicon string Intended for internal use only.
uerror | Error handling support class instance |
String scanning helper function to retrieve UniON value 'true' Intended for internal use only.
union_parser(token_gen, uerror)
token_gen | generator of tokens from UniON string |
uerror | Error handling support class instance |
Takes a co-expression to generate UniON tokens. Returns a Unicon equivalent UniON structure. Intended for internal use only.
s | UniON string to convert |
uerror | Error handling support class instance |
A string-scanning generator - takes a UniON-formatted string and returns single UniON tokens until scanning is complete Intended for internal use only.
s | UniON string to fix |
Handle conversions of special characters when building a UniON string. Intended for internal use only.