private void init_constants(SymbolTable.Scope sc) { _true_constant = new bool_const_node(true, _bool_type); _false_constant = new bool_const_node(false, _bool_type); _true_constant_definition = new constant_definition_node(compiler_string_consts.true_const_name, _true_constant); _false_constant_definition = new constant_definition_node(compiler_string_consts.false_const_name, _false_constant); sc.AddSymbol(compiler_string_consts.true_const_name, new SymbolInfo(_true_constant_definition)); sc.AddSymbol(compiler_string_consts.false_const_name, new SymbolInfo(_false_constant_definition)); }
private void VisitBoolConstNode(bool_const_node expr) { bw.Write(expr.constant_value); }
private static void make_constants() { _true_constant = new bool_const_node(true, null); _false_constant = new bool_const_node(false, null); }
public override void visit(SyntaxTree.bool_const _bool_const) { expression_node en = new bool_const_node(_bool_const.val, get_location(_bool_const)); switch (motivation_keeper.motivation) { case motivation.address_reciving: throw new CompilerInternalError("Address reciving from constant"); break; case motivation.expression_evaluation: return_value(en); break; case motivation.semantic_node_reciving: return_semantic_value(en); break; } //return_value(en); return; }
private void init_constants(SymbolTable.Scope sc) { _true_constant=new bool_const_node(true,_bool_type); _false_constant=new bool_const_node(false,_bool_type); _true_constant_definition=new constant_definition_node(compiler_string_consts.true_const_name,_true_constant); _false_constant_definition=new constant_definition_node(compiler_string_consts.false_const_name,_false_constant); sc.AddSymbol(compiler_string_consts.true_const_name,new SymbolInfo(_true_constant_definition)); sc.AddSymbol(compiler_string_consts.false_const_name,new SymbolInfo(_false_constant_definition)); }