示例#1
0
func (g *Grammar) NewRule(lhs_id SymbolID, rhs_ids []SymbolID) RuleID {
	i_rhs := make([]C.Marpa_Symbol_ID, len(rhs_ids))
	for i, id := range rhs_ids {
		i_rhs[i] = C.Marpa_Symbol_ID(id)
	}
	return RuleID(C.marpa_g_rule_new(g.handle, C.Marpa_Symbol_ID(lhs_id), &i_rhs[0], C.int(len(rhs_ids))))
}
示例#2
0
func (g *Grammar) SymbolIsStart(sym_id SymbolID) int {
	return int(C.marpa_g_symbol_is_start(g.handle, C.Marpa_Symbol_ID(sym_id)))
}
示例#3
0
func (g *Grammar) SymbolIsProductive(sym_id SymbolID) int {
	return int(C.marpa_g_symbol_is_productive(g.handle, C.Marpa_Symbol_ID(sym_id)))
}
示例#4
0
func (g *Grammar) SymbolIsNulling(sym_id SymbolID) int {
	return int(C.marpa_g_symbol_is_nulling(g.handle, C.Marpa_Symbol_ID(sym_id)))
}
示例#5
0
func (g *Grammar) SymbolIsAccessible(sym_id SymbolID) int {
	return int(C.marpa_g_symbol_is_accessible(g.handle, C.Marpa_Symbol_ID(sym_id)))
}
示例#6
0
func (g *Grammar) StartSymbolSet(sym_id SymbolID) SymbolID {
	return SymbolID(C.marpa_g_start_symbol_set(g.handle, C.Marpa_Symbol_ID(sym_id)))
}
示例#7
0
func (v *Value) SymbolIsValuedSet(sym_id SymbolID, value int) int {
	return int(C.marpa_v_symbol_is_valued_set(v.handle, C.Marpa_Symbol_ID(sym_id), C.int(value)))
}
示例#8
0
func (g *Grammar) SymbolIsValued(symbol_id SymbolID) int {
	return int(C.marpa_g_symbol_is_valued(g.handle, C.Marpa_Symbol_ID(symbol_id)))
}
示例#9
0
func (r *Recognizer) ExpectedSymbolEventSet(symbol_id SymbolID, value int) int {
	return int(C.marpa_r_expected_symbol_event_set(r.handle, C.Marpa_Symbol_ID(symbol_id), C.int(value)))
}
示例#10
0
func (v *Value) SymbolIsValued(sym_id SymbolID) int {
	return int(C.marpa_v_symbol_is_valued(v.handle, C.Marpa_Symbol_ID(sym_id)))
}
示例#11
0
func (r *Recognizer) Alternative(token_id SymbolID, value int, length int) int {
	return int(C.marpa_r_alternative(r.handle, C.Marpa_Symbol_ID(token_id), C.int(value), C.int(length)))
}
示例#12
0
func (g *Grammar) SymbolIsCounted(sym_id SymbolID) int {
	return int(C.marpa_g_symbol_is_counted(g.handle, C.Marpa_Symbol_ID(sym_id)))
}
示例#13
0
func (g *Grammar) NewSequence(lhs_id SymbolID, rhs_id SymbolID, separator_id SymbolID, min int, flags int) RuleID {
	return RuleID(C.marpa_g_sequence_new(g.handle, C.Marpa_Symbol_ID(lhs_id), C.Marpa_Symbol_ID(rhs_id), C.Marpa_Symbol_ID(separator_id), C.int(min), C.int(flags)))
}
示例#14
0
func (g *Grammar) SymbolIsTerminal(sym_id SymbolID) int {
	return int(C.marpa_g_symbol_is_terminal(g.handle, C.Marpa_Symbol_ID(sym_id)))
}
示例#15
0
func (g *Grammar) SymbolRank(sym_id SymbolID) Rank {
	return Rank(C.marpa_g_symbol_rank(g.handle, C.Marpa_Symbol_ID(sym_id)))
}
示例#16
0
func (g *Grammar) SymbolIsTerminalSet(sym_id SymbolID, value int) int {
	return int(C.marpa_g_symbol_is_terminal_set(g.handle, C.Marpa_Symbol_ID(sym_id), C.int(value)))
}
示例#17
0
func (g *Grammar) SymbolRankSet(sym_id SymbolID, rank Rank) Rank {
	return Rank(C.marpa_g_symbol_rank_set(g.handle, C.Marpa_Symbol_ID(sym_id), C.Marpa_Rank(rank)))
}
示例#18
0
func (g *Grammar) SymbolIsValuedSet(symbol_id SymbolID, value int) int {
	return int(C.marpa_g_symbol_is_valued_set(g.handle, C.Marpa_Symbol_ID(symbol_id), C.int(value)))
}
示例#19
0
func (g *Grammar) NewRule(lhs_id SymbolID, rhs_ids []SymbolID, length int) RuleID {
	return RuleID(C.marpa_g_rule_new(g.handle, C.Marpa_Symbol_ID(lhs_id), C.Marpa_Symbol_ID*(rhs_ids), C.int(length)))
}