5. cs:parser-options

Set the parser options to use in subsequent parses.

cs:parser-options($options)xs:boolean
$optionsmap(xs:string, xs:string)Parser options

The following options are recognized:

ignoreTrailingWhitespace, boolean

If true, trailing whitespace on the document input string is ignored.

suppressAmbiguousState, boolean

If a parse is ambiguous, Invisible XML mandates that an ixml:state attribute be added to the root element contining the value ambiguous. If this option is true, that state will be suppressed.

suppressPrefixState, boolean

If a parse consumes only a (proper) prefix of the input, Invisible XML mandates that an ixml:state attribute be added to the root element contining the value prefix. If this option is true, that state will be suppressed.

allowUndefinedSymbols, boolean

If true, the parser will attempt to use a grammar that contains undefined symbols.

allowUnreachableSymbols, boolean

If true, the parser will attempt to use a grammar that contains unreachable symbols.

allowUnproductiveSymbols, boolean

If true, the parser will attempt to use a grammar that contains unproductive symbols.

allowMultipleDefinitions, boolean

If true, the parser will attempt to use a grammar that contains multiple definitions for a given nonterminal.

allowMultipleDefinitions, boolean

If true, the parser will attempt to use a grammar that contains multiple definitions for a given nonterminal.

showMarks, boolean

If true, the parser will return all of the nonterminals in your grammar as elements, irrespective of their marks. The actual mark will be returned in an ixml:mark attribute.

showBnfNonterminals, boolean

If true, the parser will return all of the otherwise hidden nonterminals used in the parse.

parser, string

Selects the parser type, “Earley” for the Earley parser and “GLL” for the GLL parser. The Earley parser is the default.

The function will log errors (unrecognized options or values). It will return false if any errors occur, otherwise it returns true.

Changing parser options causes the cache to be cleared.