package pacomb

  1. Overview
  2. Docs

Module Keywords.MakeSource

Parameters

module S : Spec

Signature

Sourceval reserve : string -> unit

reserve s reserves the word s as if it was a keyword, although it will not be defined as one. The exception Invalid_argument is raised if the word s is already reserved.

Sourceval mem : string -> bool

mem s tests whether s is a reserved word or not.

Sourceval check : string -> unit

check s calls Earley.give_up () if s is a reserved word. It can be used to reject keywords while parsing identifiers for example.

Sourceval create : string -> unit Grammar.t

create s reserves the keyword s and returns a parser accepting the string s, not followed by a character of S.id_charset. In the case where s is already reserved, Invalid_argument is raised.

Sourceval special : string -> unit Grammar.t

special s accpets the same input as create s, but the word s is not reserved.

OCaml

Innovation. Community. Security.