Pacomb.Word_listSourceType of a word list with 'a : the type of characters (typically, char for ascii or string for utf8) 'b : a value associated to each word
exception raise when multiple binding are added and not allowed
val create :
?unique:bool ->
?map:('a -> 'a) ->
?cs:Charset.t ->
?final_test:(Input.buffer -> Input.idx -> bool) ->
unit ->
('a, 'b) tCreate a new empty table. The optional parameter unique defaults to true. Setting it to false with allow multiple identical bindings, creating ambiguous grammars. If unique is true, then adding multiple bindings will raise the exception Already_bound .
map is a function transforming character before addition (typically a case transformer or a unicode normalisation). (defaults to identity).
final_test will be called after parsing. It may be used typically to ensure that the next character is not alphanumeric. Defaults to an always passing test.
cs can be given as an optimisation. All words added should start with characters in this set.
add_ascii tbl s v adds a binding from s to v in tbl, keep all previous bindings.
mem_ascii tbl s tells if s if present in tbl. Typically used to reject identifiers that are keywords
Same as above for a unicode string, which are splitted in graphemes
Parses word from a dictionnary returning as action all the assiociated values (it is an ambiguous grammar if there is more than one value).