private void mark_char_as_ordinal() { ordinal_type_interface oti=new ordinal_type_interface(); oti.inc_method=create_oti_method(SemanticTree.basic_function_type.cinc,_char_type); oti.dec_method=create_oti_method(SemanticTree.basic_function_type.cdec,_char_type); SymbolInfo si=_char_type.find_in_additional_names(compiler_string_consts.greq_name); basic_function_node bfn=(basic_function_node)si.sym_info; oti.greater_eq_method=bfn; si=_char_type.find_in_additional_names(compiler_string_consts.smeq_name); bfn=(basic_function_node)si.sym_info; oti.lower_eq_method=bfn; constant_node cn_max=new int_const_node(char.MaxValue,_char_type); constant_node cn_min=new int_const_node(char.MinValue,_char_type); oti.upper_value=cn_max; oti.lower_value=cn_min; parameterArrayList pal=new parameterArrayList(); bfn=new basic_function_node(SemanticTree.basic_function_type.chartoi,pal,_integer_type); common_parameter cp=new common_parameter(compiler_string_consts.unary_param_name,_char_type, SemanticTree.parameter_type.value,null); oti.value_to_int=bfn; oti.ordinal_type_to_int=new ordinal_type_to_int(char_to_int); _char_type.add_internal_interface(oti); }
public void AddParameter(common_parameter vdn) { ParamInfo vi = new ParamInfo(); ht[vdn] = vi; }
private basic_function_node create_oti_method(SemanticTree.basic_function_type bft,type_node type) { parameterArrayList pal=new parameterArrayList(); basic_function_node bfn=new basic_function_node(bft,pal,type); common_parameter cp=new common_parameter(compiler_string_consts.unary_param_name,type, SemanticTree.parameter_type.var,null); pal.Add(cp); bfn.is_overload=true; return bfn; }
public ParamInfo GetParameter(common_parameter vdn) { return((ParamInfo)ht[vdn]); }