Beispiel #1
0
func init() {
	expr.Bind(expr_actual)
	expr_single.Bind(expr_single_actual)
	item_type.Bind(item_type_actual)
	sequence_type.Bind(sequence_type_actual)
}

var (
	Rule = xpath

	xpath = expr

	param_list = tokSepBy1(param, comma)

	param = tokSeq(dollar_sign, eq_name, sickle.Opt(type_declaration))

	function_body = enclosed_expr

	enclosed_expr = tokSeq(left_brace, expr, right_brace)

	expr        = sickle.Indirect()
	expr_actual = tokSepBy1(expr_single, comma)

	expr_single        = sickle.Indirect()
	expr_single_actual = sickle.Choice(
		for_expr,
		let_expr,
		quantified_expr,
		if_expr,
		or_expr,
Beispiel #2
0
func tokOptSeq(rules ...sickle.Rule) sickle.Rule {
	return sickle.Opt(tokSeq(rules...))
}
Beispiel #3
0
	comment_contents = sickle.Many1(sickle.Right(
		sickle.Not(sickle.Choice(comment_start, comment_end)),
		char,
	))

	comment_start = sickle.TokenStr("(:")
	comment_end   = sickle.TokenStr(":)")

	char = sickle.Choice(
		ws_char,
		sickle.ChRange(0x20, 0xD7FF),
		sickle.ChRange(0x20, 0xD7FF),
		sickle.ChRange(0x20, 0xD7FF),
	)

	ignore_optional_ws = sickle.Ignore(sickle.Opt(ws))
)

// Delimiting terminal symbols
var (
	delimiting_terminal_symbol = sickle.Choice(
		bang,
		not_equal,
		pound_sign,
		dollar_sign,
		left_paren,
		right_paren,
		asterisk,
		plus_sign,
		comma,
		minus_sign,