RuleParser v0.1.1 RuleParser.Helper View Source
Helper functions for making parser work easy
Link to this section Summary
Functions
Ignore bracket and the inner space
Ignore both lowercase name and uppercase name for keyword
Ignore predefined prefixes
Ignore separator
Ignore white space and tab, and make it optional
Match an atom with space
Match integer
Match a list of predefined ops
Match string with quote, and inner quote, e.g. ~S("this is "hello world"")
We fixed the 1st char must be a-z, so for opts if min/max is given, please consider to shift with 1
parse white space or tab
Link to this section Functions
ignore_bracket(left, combinator, right)
View Source
ignore_bracket(char(), NimbleParsec.t(), char()) :: NimbleParsec.t()
ignore_bracket(char(), NimbleParsec.t(), char()) :: NimbleParsec.t()
Ignore bracket and the inner space
ignore_keyword(name)
View Source
ignore_keyword(binary()) :: NimbleParsec.t()
ignore_keyword(binary()) :: NimbleParsec.t()
Ignore both lowercase name and uppercase name for keyword
ignore_prefix(names)
View Source
ignore_prefix([binary()]) :: NimbleParsec.t()
ignore_prefix([binary()]) :: NimbleParsec.t()
Ignore predefined prefixes
ignore_sep(sep)
View Source
ignore_sep(binary()) :: NimbleParsec.t()
ignore_sep(binary()) :: NimbleParsec.t()
Ignore separator
ignore_space()
View Source
ignore_space() :: NimbleParsec.t()
ignore_space() :: NimbleParsec.t()
Ignore white space and tab, and make it optional
parse_atom()
View Source
parse_atom() :: NimbleParsec.t()
parse_atom() :: NimbleParsec.t()
Match an atom with space
parse_integer()
View Source
parse_integer() :: NimbleParsec.t()
parse_integer() :: NimbleParsec.t()
Match integer
parse_ops(ops)
View Source
parse_ops([String.t()]) :: NimbleParsec.t()
parse_ops([String.t()]) :: NimbleParsec.t()
Match a list of predefined ops
parse_string(quote_char \\ 34)
View Source
parse_string(char()) :: NimbleParsec.t()
parse_string(char()) :: NimbleParsec.t()
Match string with quote, and inner quote, e.g. ~S("this is "hello world"")
parse_tag(range \\ [97..122, 95])
View Source
parse_tag(list()) :: NimbleParsec.t()
parse_tag(list()) :: NimbleParsec.t()
We fixed the 1st char must be a-z, so for opts if min/max is given, please consider to shift with 1.
parse_ws()
View Source
parse_ws() :: NimbleParsec.t()
parse_ws() :: NimbleParsec.t()
parse white space or tab